Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.3
apper
0006-Fixes-package-installation-of-files-in-non...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0006-Fixes-package-installation-of-files-in-non-latin-pat.patch of Package apper
From 216a03a19a295cb9b2889651212f60d5bf1ebd6d Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti <dantti12@gmail.com> Date: Wed, 9 Jan 2013 15:24:43 -0200 Subject: [PATCH 06/14] Fixes package installation of files in non-latin paths BUG:307258 --- PkSession/FilesModel.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/PkSession/FilesModel.cpp b/PkSession/FilesModel.cpp index e2e6e1a..cc1f37f 100644 --- a/PkSession/FilesModel.cpp +++ b/PkSession/FilesModel.cpp @@ -74,31 +74,32 @@ bool FilesModel::insertFiles(const QList<QUrl> &urls) { bool ret = false; foreach (const QUrl &url, urls) { - if (files().contains(url.path())) { + QString path = QUrl::fromPercentEncoding(url.path().toUtf8()); + if (files().contains(path)) { continue; } - QFileInfo fileInfo(url.path()); + QFileInfo fileInfo(path); QStandardItem *item = 0; if (fileInfo.isFile()) { - KMimeType::Ptr mime = KMimeType::findByFileContent(url.path()); + KMimeType::Ptr mime = KMimeType::findByFileContent(path); kDebug() << url << mime->name(); foreach (const QString &mimeType, m_mimes) { if (mime->is(mimeType)) { ret = true; /* kDebug() << "Found Supported Mime" << mimeType << mime->iconName();*/ item = new QStandardItem(fileInfo.fileName()); - item->setData(url.path()); - item->setToolTip(url.path()); + item->setData(path); + item->setToolTip(path); item->setIcon(KIconLoader::global()->loadMimeTypeIcon(mime->iconName(), - KIconLoader::Desktop)); + KIconLoader::Desktop)); break; } } if (ret == false && m_mimes.isEmpty()) { if (mime->name() == "application/x-desktop") { - KService *service = new KService(url.path()); + KService *service = new KService(path); item = new QStandardItem(service->name()); item->setData(true, Qt::UserRole); item->setIcon(KIconLoader::global()->loadMimeTypeIcon(service->icon(), @@ -108,20 +109,20 @@ bool FilesModel::insertFiles(const QList<QUrl> &urls) item->setIcon(KIconLoader::global()->loadMimeTypeIcon(mime->iconName(), KIconLoader::Desktop)); } - item->setData(url.path()); - item->setToolTip(url.path()); + item->setData(path); + item->setToolTip(path); } else if (ret == false && !m_mimes.isEmpty()) { item = new QStandardItem(fileInfo.fileName()); - item->setData(url.path()); - item->setToolTip(url.path()); + item->setData(path); + item->setToolTip(path); item->setEnabled(false); item->setIcon(KIconLoader::global()->loadIcon("dialog-cancel", KIconLoader::Desktop)); } } else if (m_mimes.isEmpty()) { // It's not a file but we don't have a mime so it's ok item = new QStandardItem(fileInfo.fileName()); - item->setData(url.path()); - item->setToolTip(url.path()); + item->setData(path); + item->setToolTip(path); item->setIcon(KIconLoader::global()->loadIcon("unknown", KIconLoader::Desktop)); } -- 1.8.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor