From a6d2f30141999e9cc8c84fbbb3a784675a2af5ea05d7e3be7e7a7aa948369962 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Tue, 9 Sep 2014 10:14:49 +0000 Subject: [PATCH 1/2] 5.2.0 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=35 --- 0001-Fix-thumbnails-for-mimetype-groups.patch | 52 +++++++++++++++++++ kio-5.1.0.tar.xz | 3 -- kio-5.2.0.tar.xz | 3 ++ kio.changes | 9 ++++ kio.spec | 7 ++- 5 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 0001-Fix-thumbnails-for-mimetype-groups.patch delete mode 100644 kio-5.1.0.tar.xz create mode 100644 kio-5.2.0.tar.xz diff --git a/0001-Fix-thumbnails-for-mimetype-groups.patch b/0001-Fix-thumbnails-for-mimetype-groups.patch new file mode 100644 index 0000000..db30eea --- /dev/null +++ b/0001-Fix-thumbnails-for-mimetype-groups.patch @@ -0,0 +1,52 @@ +From c372f9d634fa61aff5d4df6700ed294433df913b Mon Sep 17 00:00:00 2001 +From: Maarten De Meyer +Date: Mon, 8 Sep 2014 23:58:55 +0200 +Subject: [PATCH] Fix thumbnails for mimetype groups. + +KService::mimeTypes cannot handle mimetype groups. ex: text/* +Go back to KService::serviceTypes and remove 'ThumbCreator' entries. + +REVIEW: 119958 +--- + src/widgets/previewjob.cpp | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp +index 55a3fb7..c8ea2b7 100644 +--- a/src/widgets/previewjob.cpp ++++ b/src/widgets/previewjob.cpp +@@ -268,20 +268,25 @@ void PreviewJobPrivate::startPreview() + protocols.append(p); + } + foreach (const QString &protocol, protocols) { +- const QStringList mtypes = (*it)->mimeTypes(); ++ // We cannot use mimeTypes() here, it doesn't support groups. text/* ++ const QStringList mtypes = (*it)->serviceTypes(); + // Add supported mimetype for this protocol + QStringList &_ms = m_remoteProtocolPlugins[protocol]; + foreach (const QString &_m, mtypes) { +- protocolMap[protocol].insert(_m, *it); +- if (!_ms.contains(_m)) { +- _ms.append(_m); ++ if (_m != QLatin1String("ThumbCreator")) { ++ protocolMap[protocol].insert(_m, *it); ++ if (!_ms.contains(_m)) { ++ _ms.append(_m); ++ } + } + } + } + if (enabledPlugins.contains((*it)->desktopEntryName())) { +- const QStringList mimeTypes = (*it)->mimeTypes(); ++ const QStringList mimeTypes = (*it)->serviceTypes(); + for (QStringList::ConstIterator mt = mimeTypes.constBegin(); mt != mimeTypes.constEnd(); ++mt) { +- mimeMap.insert(*mt, *it); ++ if (*mt != QLatin1String("ThumbCreator")) { ++ mimeMap.insert(*mt, *it); ++ } + } + } + } +-- +2.1.0 + diff --git a/kio-5.1.0.tar.xz b/kio-5.1.0.tar.xz deleted file mode 100644 index 615e6ad..0000000 --- a/kio-5.1.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:73ceb6be282b9ceb0bc8ca12ddbc2c10cf215ec8807455136cdcb91fbf5c3dab -size 2251736 diff --git a/kio-5.2.0.tar.xz b/kio-5.2.0.tar.xz new file mode 100644 index 0000000..8447ec0 --- /dev/null +++ b/kio-5.2.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7be3026dbf32efb6245ca4443cec2c0be52e0b303e396cbb70c2e09834046db +size 2253536 diff --git a/kio.changes b/kio.changes index d8743ad..e2620da 100644 --- a/kio.changes +++ b/kio.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Sep 9 09:49:34 UTC 2014 - hrvoje.senjan@gmail.com + +- Update to 5.2.0 + * For more details please see: + http://kde.org/announcements/kde-frameworks-5.2.php +- Added 0001-Fix-thumbnails-for-mimetype-groups.patch, fixes thumbnail + generation for mimetypes with wildcard usage + ------------------------------------------------------------------- Sat Aug 2 10:20:18 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/kio.spec b/kio.spec index 7595f66..7016542 100644 --- a/kio.spec +++ b/kio.spec @@ -17,11 +17,11 @@ Name: kio -Version: 5.1.0 +Version: 5.2.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.1.0 +BuildRequires: extra-cmake-modules >= 1.2.0 BuildRequires: fdupes BuildRequires: karchive-devel >= %{kf5_version} BuildRequires: kbookmarks-devel >= %{kf5_version} @@ -66,6 +66,8 @@ Group: System/GUI/KDE Url: http://www.kde.org Source: http://download.kde.org/stable/frameworks/%{version}/%{name}-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-UPSTREAM 0001-Fix-thumbnails-for-mimetype-groups.patch -- https://git.reviewboard.kde.org/r/119958/ +Patch0: 0001-Fix-thumbnails-for-mimetype-groups.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -95,6 +97,7 @@ Development files. %lang_package %prep %setup -q +%patch0 -p1 %build %cmake_kf5 -d build From 80bd7f5f9a85e8dda2fd45473894ac8cf19b42772240ba13b572632f541375a0 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Wed, 10 Sep 2014 15:16:16 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kio?expand=0&rev=36 --- 0001-Fix-thumbnails-for-mimetype-groups.patch | 8 +- ...hs-being-turned-into-http-urls-by-fr.patch | 77 +++++++++++++++++++ kio.changes | 7 ++ kio.spec | 3 + 4 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 0002-Fix-relative-paths-being-turned-into-http-urls-by-fr.patch diff --git a/0001-Fix-thumbnails-for-mimetype-groups.patch b/0001-Fix-thumbnails-for-mimetype-groups.patch index db30eea..b752fd1 100644 --- a/0001-Fix-thumbnails-for-mimetype-groups.patch +++ b/0001-Fix-thumbnails-for-mimetype-groups.patch @@ -1,7 +1,7 @@ -From c372f9d634fa61aff5d4df6700ed294433df913b Mon Sep 17 00:00:00 2001 +From ae87a7d6999fc6ad90ab300dd8ea0c9c68c02bd4 Mon Sep 17 00:00:00 2001 From: Maarten De Meyer Date: Mon, 8 Sep 2014 23:58:55 +0200 -Subject: [PATCH] Fix thumbnails for mimetype groups. +Subject: [PATCH 1/2] Fix thumbnails for mimetype groups. KService::mimeTypes cannot handle mimetype groups. ex: text/* Go back to KService::serviceTypes and remove 'ThumbCreator' entries. @@ -12,7 +12,7 @@ REVIEW: 119958 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp -index 55a3fb7..c8ea2b7 100644 +index 55a3fb7..ca47934 100644 --- a/src/widgets/previewjob.cpp +++ b/src/widgets/previewjob.cpp @@ -268,20 +268,25 @@ void PreviewJobPrivate::startPreview() @@ -20,7 +20,7 @@ index 55a3fb7..c8ea2b7 100644 } foreach (const QString &protocol, protocols) { - const QStringList mtypes = (*it)->mimeTypes(); -+ // We cannot use mimeTypes() here, it doesn't support groups. text/* ++ // We cannot use mimeTypes() here, it doesn't support groups such as: text/* + const QStringList mtypes = (*it)->serviceTypes(); // Add supported mimetype for this protocol QStringList &_ms = m_remoteProtocolPlugins[protocol]; diff --git a/0002-Fix-relative-paths-being-turned-into-http-urls-by-fr.patch b/0002-Fix-relative-paths-being-turned-into-http-urls-by-fr.patch new file mode 100644 index 0000000..f2b08aa --- /dev/null +++ b/0002-Fix-relative-paths-being-turned-into-http-urls-by-fr.patch @@ -0,0 +1,77 @@ +From 5a5aa4b1786e793f457ad5a88a4e49d7469a92fa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= +Date: Tue, 9 Sep 2014 22:49:27 +0200 +Subject: [PATCH 2/2] Fix relative paths being turned into http urls by + fromUserInput. + +Reviewed-By: (well, written by) David Faure. +--- + src/filewidgets/kfilewidget.cpp | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +diff --git a/src/filewidgets/kfilewidget.cpp b/src/filewidgets/kfilewidget.cpp +index 42320e3..58dd92e 100644 +--- a/src/filewidgets/kfilewidget.cpp ++++ b/src/filewidgets/kfilewidget.cpp +@@ -325,6 +325,22 @@ static bool containsProtocolSection(const QString &string) + return false; + } + ++// this string-to-url conversion function handles relative paths, full paths and URLs ++// without the http-prepending that QUrl::fromUserInput does. ++static QUrl urlFromString(const QString& str) ++{ ++ if (QDir::isAbsolutePath(str)) { ++ return QUrl::fromLocalFile(str); ++ } ++ QUrl url(str); ++ if (url.isRelative()) { ++ url.clear(); ++ url.setPath(str); ++ } ++ return url; ++} ++ ++ + KFileWidget::KFileWidget(const QUrl &_startDir, QWidget *parent) + : QWidget(parent), d(new KFileWidgetPrivate(this)) + { +@@ -909,7 +925,7 @@ void KFileWidget::slotOk() + containsProtocolSection(locationEditCurrentText))) { + + QString fileName; +- QUrl url = QUrl::fromUserInput(locationEditCurrentText); ++ QUrl url = urlFromString(locationEditCurrentText); + if (d->operationMode == Opening) { + KIO::StatJob *statJob = KIO::stat(url, KIO::HideProgressInfo); + KJobWidgets::setWindow(statJob, this); +@@ -1447,7 +1463,7 @@ void KFileWidgetPrivate::_k_urlEntered(const QUrl &url) + + bool blocked = locationEdit->blockSignals(true); + if (keepLocation) { +- QUrl currentUrl = QUrl::fromUserInput(filename); ++ QUrl currentUrl = urlFromString(filename); + locationEdit->changeUrl(0, QIcon::fromTheme(KIO::iconNameForUrl(currentUrl)), currentUrl); + locationEdit->lineEdit()->setModified(true); + } +@@ -1494,7 +1510,7 @@ void KFileWidgetPrivate::_k_enterUrl(const QString &url) + { + // qDebug(); + +- _k_enterUrl(QUrl::fromUserInput(KUrlCompletion::replacedPath(url, true, true))); ++ _k_enterUrl(urlFromString(KUrlCompletion::replacedPath(url, true, true))); + } + + bool KFileWidgetPrivate::toOverwrite(const QUrl &url) +@@ -1677,7 +1693,7 @@ QList KFileWidgetPrivate::tokenize(const QString &line) const + urls.append(u); + } + } else { +- urls << QUrl::fromUserInput(line); ++ urls << QUrl::fromLocalFile(line); + } + + return urls; +-- +2.1.0 + diff --git a/kio.changes b/kio.changes index e2620da..49844c0 100644 --- a/kio.changes +++ b/kio.changes @@ -2,10 +2,17 @@ Tue Sep 9 09:49:34 UTC 2014 - hrvoje.senjan@gmail.com - Update to 5.2.0 + * KIO/KService: now follows the mime-apps spec, for better + interoperability with gio when it comes to the user's + preferred and default apps. + * KIO: new classes EmptyTrashJob and RestoreJob + * KIO: new functions isClipboardDataCut and setClipboardDataCut. * For more details please see: http://kde.org/announcements/kde-frameworks-5.2.php - Added 0001-Fix-thumbnails-for-mimetype-groups.patch, fixes thumbnail generation for mimetypes with wildcard usage +- 0002-Fix-relative-paths-being-turned-into-http-urls-by-fr.patch, + fixes filedialog appening 'http://' on directory change ------------------------------------------------------------------- Sat Aug 2 10:20:18 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/kio.spec b/kio.spec index 7016542..e738dc5 100644 --- a/kio.spec +++ b/kio.spec @@ -68,6 +68,8 @@ Source: http://download.kde.org/stable/frameworks/%{version}/%{name}-%{v Source1: baselibs.conf # PATCH-FIX-UPSTREAM 0001-Fix-thumbnails-for-mimetype-groups.patch -- https://git.reviewboard.kde.org/r/119958/ Patch0: 0001-Fix-thumbnails-for-mimetype-groups.patch +# PATCH-FIX-UPSTREAM 0002-Fix-relative-paths-being-turned-into-http-urls-by-fr.patch +Patch1: 0002-Fix-relative-paths-being-turned-into-http-urls-by-fr.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -98,6 +100,7 @@ Development files. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %cmake_kf5 -d build