From 24f37186037f0a01525b95081bc512cb4ad4c0bfa960b5b311b808b5a831668f Mon Sep 17 00:00:00 2001 From: Raymond Wooninck Date: Thu, 28 Apr 2016 12:47:26 +0000 Subject: [PATCH] Accepting request 391723 from home:wolfi323:branches:KDE:Applications - Added specify-fallback-icon.patch: fixes missing icons for certain filetypes where the specified icon doesn't exist (kde#358958, kde#361034) OBS-URL: https://build.opensuse.org/request/show/391723 OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/dolphin?expand=0&rev=42 --- dolphin.changes | 7 +++++++ dolphin.spec | 3 +++ specify-fallback-icon.patch | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 specify-fallback-icon.patch diff --git a/dolphin.changes b/dolphin.changes index 26f9223..74917f1 100644 --- a/dolphin.changes +++ b/dolphin.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 26 14:32:54 UTC 2016 - wbauer@tmo.at + +- Added specify-fallback-icon.patch: fixes missing icons for + certain filetypes where the specified icon doesn't exist + (kde#358958, kde#361034) + ------------------------------------------------------------------- Sun Apr 17 05:50:36 UTC 2016 - tittiatcoke@gmail.com diff --git a/dolphin.spec b/dolphin.spec index c62d15d..0776007 100644 --- a/dolphin.spec +++ b/dolphin.spec @@ -26,6 +26,8 @@ Url: http://www.kde.org/ Source: dolphin-%{version}.tar.xz Source1: dolphinsu.desktop Patch0: dolphin-go_up.diff +# PATCH-FIX-UPSTREAM specify-fallback-icon.patch kde#358958, kde#361034 -- fixes missing icons for certain filetypes where the specified icon doesn't exist +Patch1: specify-fallback-icon.patch BuildRequires: baloo5-devel BuildRequires: baloo5-widgets-devel BuildRequires: extra-cmake-modules >= 1.6.0 @@ -94,6 +96,7 @@ This package contains the libraries used by Dolphin and Konqueror. %prep %setup -q -n dolphin-%{version} %patch0 -p1 +%patch1 -p1 %build %cmake_kf5 -d build diff --git a/specify-fallback-icon.patch b/specify-fallback-icon.patch new file mode 100644 index 0000000..2c79479 --- /dev/null +++ b/specify-fallback-icon.patch @@ -0,0 +1,39 @@ +From: Wolfgang Bauer +Date: Tue, 26 Apr 2016 14:11:26 +0000 +Subject: Specify a fallback icon to QIcon::fromTheme() +X-Git-Url: http://quickgit.kde.org/?p=dolphin.git&a=commitdiff&h=44d4d2ea715719a08c639541530a5b330647297d +--- +Specify a fallback icon to QIcon::fromTheme() + +The default fallback of QIcon::fromTheme() is QIcon(), i.e. a null icon. +Set the generic "unknown" icon as fallback to prevent missing icons for +filetypes that specify an icon name that doesn't exist. + +This also gets rid of "QPixmap::scaled: Pixmap is a null pixmap" +warnings in that case. + +BUG: 358958 +BUG: 361034 +FIXED-IN: 16.04.1 +REVIEW: 127713 +--- + + +--- a/src/kitemviews/kstandarditemlistwidget.cpp ++++ b/src/kitemviews/kstandarditemlistwidget.cpp +@@ -1440,12 +1440,13 @@ + + QPixmap KStandardItemListWidget::pixmapForIcon(const QString& name, const QStringList& overlays, int size) + { ++ static const QIcon fallbackIcon = QIcon::fromTheme(QStringLiteral("unknown")); + size *= qApp->devicePixelRatio(); + const QString key = "KStandardItemListWidget:" % name % ":" % overlays.join(QStringLiteral(":")) % ":" % QString::number(size); + QPixmap pixmap; + + if (!QPixmapCache::find(key, pixmap)) { +- const QIcon icon = QIcon::fromTheme(name); ++ const QIcon icon = QIcon::fromTheme(name, fallbackIcon); + + int requestedSize; + if (size <= KIconLoader::SizeSmall) { +