diff options
author | Michael Palimaka <kensington@gentoo.org> | 2013-08-25 15:05:56 +0000 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2013-08-25 15:05:56 +0000 |
commit | 511729dfab195bd76655077658036106e819b959 (patch) | |
tree | c6bda2bf676be4d81d4c6c4be344656fb6f8ddd7 /kde-base/kdelibs/files | |
parent | Drop old revision (diff) | |
download | gentoo-2-511729dfab195bd76655077658036106e819b959.tar.gz gentoo-2-511729dfab195bd76655077658036106e819b959.tar.bz2 gentoo-2-511729dfab195bd76655077658036106e819b959.zip |
Backport patch from upstream fixing a crash.
(Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key 675D0D2C)
Diffstat (limited to 'kde-base/kdelibs/files')
-rw-r--r-- | kde-base/kdelibs/files/kdelibs-4.11.0-themecrash.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/kde-base/kdelibs/files/kdelibs-4.11.0-themecrash.patch b/kde-base/kdelibs/files/kdelibs-4.11.0-themecrash.patch new file mode 100644 index 000000000000..971d00b32815 --- /dev/null +++ b/kde-base/kdelibs/files/kdelibs-4.11.0-themecrash.patch @@ -0,0 +1,51 @@ +From 59e88c777b92935cc95f28e52f84fe97563dec9d Mon Sep 17 00:00:00 2001 +From: Aaron Seigo <aseigo@kde.org> +Date: Wed, 14 Aug 2013 12:52:52 +0200 +Subject: [PATCH] when the request theme does not exist, delete all old caches + for it and don't crash + +BUG:320855 +--- + plasma/theme.cpp | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/plasma/theme.cpp b/plasma/theme.cpp +index 4554de7..cb44878 100644 +--- a/plasma/theme.cpp ++++ b/plasma/theme.cpp +@@ -222,18 +222,25 @@ bool ThemePrivate::useCache() + { + if (cacheTheme && !pixmapCache) { + const bool isRegularTheme = themeName != systemColorsTheme; +- QString cacheFile = "plasma_theme_" + themeName; ++ const QString cacheFile = "plasma_theme_" + themeName; + + if (isRegularTheme) { ++ const QString cacheFileBase = cacheFile + "*.kcache"; ++ + const QString path = KStandardDirs::locate("data", "desktoptheme/" + themeName + "/metadata.desktop"); +- const KPluginInfo pluginInfo(path); ++ // if the path is empty, then we haven't found the theme and so ++ // we will leave currentCacheFileName empty, resulting in the deletion of ++ // *all* matching cache files ++ QString currentCacheFileName; ++ if (!path.isEmpty()) { ++ const KPluginInfo pluginInfo(path); ++ currentCacheFileName = cacheFile + "_v" + pluginInfo.version() + ".kcache"; ++ } + +- // now we check for, and remove if necessary, old caches +- const QString cacheFileBase = cacheFile + "*.kcache"; +- cacheFile += "_v" + pluginInfo.version(); +- const QString currentCacheFileName = cacheFile + ".kcache"; ++ // now we check for (and remove) old caches + foreach (const QString &file, KGlobal::dirs()->findAllResources("cache", cacheFileBase)) { +- if (!file.endsWith(currentCacheFileName)) { ++ if (currentCacheFileName.isEmpty() || ++ !file.endsWith(currentCacheFileName)) { + QFile::remove(file); + } + } +-- +1.8.3.2 + |