diff options
Diffstat (limited to 'pkgs/applications/kde/grantleetheme/grantlee-merge-theme-dirs.patch')
-rw-r--r-- | pkgs/applications/kde/grantleetheme/grantlee-merge-theme-dirs.patch | 164 |
1 files changed, 83 insertions, 81 deletions
diff --git a/pkgs/applications/kde/grantleetheme/grantlee-merge-theme-dirs.patch b/pkgs/applications/kde/grantleetheme/grantlee-merge-theme-dirs.patch index fe8b15febf2..ebb81248475 100644 --- a/pkgs/applications/kde/grantleetheme/grantlee-merge-theme-dirs.patch +++ b/pkgs/applications/kde/grantleetheme/grantlee-merge-theme-dirs.patch @@ -1,82 +1,8 @@ -Index: grantleetheme-17.04.0/src/grantleetheme_p.h -=================================================================== ---- grantleetheme-17.04.0.orig/src/grantleetheme_p.h -+++ grantleetheme-17.04.0/src/grantleetheme_p.h -@@ -47,7 +47,7 @@ public: - QString description; - QString name; - QString dirName; -- QString absolutePath; -+ QStringList absolutePaths; - QString author; - QString email; - -Index: grantleetheme-17.04.0/src/grantleetheme.h -=================================================================== ---- grantleetheme-17.04.0.orig/src/grantleetheme.h -+++ grantleetheme-17.04.0/src/grantleetheme.h -@@ -50,11 +50,14 @@ public: - QStringList displayExtraVariables() const; - QString dirName() const; - QString absolutePath() const; -+ QStringList absolutePaths() const; - QString author() const; - QString authorEmail() const; - - QString render(const QString &templateName, const QVariantHash &data, const QByteArray &applicationDomain = QByteArray()); - -+ void addThemeDir(const QString&); -+ - static void addPluginPath(const QString &path); - - private: -Index: grantleetheme-17.04.0/src/grantleethememanager.cpp -=================================================================== ---- grantleetheme-17.04.0.orig/src/grantleethememanager.cpp -+++ grantleetheme-17.04.0/src/grantleethememanager.cpp -@@ -142,25 +142,18 @@ public: - - for (const QString &directory : qAsConst(themesDirectories)) { - QDirIterator dirIt(directory, QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot); -- QStringList alreadyLoadedThemeName; - while (dirIt.hasNext()) { - dirIt.next(); - const QString dirName = dirIt.fileName(); - GrantleeTheme::Theme theme = q->loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName); - if (theme.isValid()) { - QString themeName = theme.name(); -- if (alreadyLoadedThemeName.contains(themeName)) { -- int i = 2; -- const QString originalName(theme.name()); -- while (alreadyLoadedThemeName.contains(themeName)) { -- themeName = originalName + QStringLiteral(" (%1)").arg(i); -- ++i; -- } -- theme.d->name = themeName; -+ QMap<QString, GrantleeTheme::Theme>::iterator i = themes.find(dirName); -+ if (i != themes.end()) { -+ i.value().addThemeDir(dirIt.filePath()); -+ } else { -+ themes.insert(dirName, theme); - } -- alreadyLoadedThemeName << themeName; -- themes.insert(dirName, theme); -- //qDebug()<<" theme.name()"<<theme.name(); - } - } - watch->addDir(directory); -@@ -374,7 +367,7 @@ QString ThemeManager::pathFromThemes(con - GrantleeTheme::Theme theme = loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName); - if (theme.isValid()) { - if (dirName == themeName) { -- return theme.absolutePath(); -+ return theme.absolutePaths().first(); - } - } - } ---- src/grantleetheme.cpp.orig 2017-12-22 16:11:39.863598126 +0300 -+++ ./src/grantleetheme.cpp 2017-12-22 16:16:14.045664607 +0300 -@@ -46,7 +46,7 @@ ThemePrivate::ThemePrivate(const ThemePr +diff --git a/src/grantleetheme.cpp b/src/grantleetheme.cpp +index 27d5bc8..8d43140 100644 +--- a/src/grantleetheme.cpp ++++ b/src/grantleetheme.cpp +@@ -46,7 +46,7 @@ ThemePrivate::ThemePrivate(const ThemePrivate &other) , description(other.description) , name(other.name) , dirName(other.dirName) @@ -105,7 +31,7 @@ Index: grantleetheme-17.04.0/src/grantleethememanager.cpp loader->setTheme(dirName); if (!sEngine) { -@@ -121,7 +124,7 @@ Theme::Theme(const QString &themePath, c +@@ -121,7 +124,7 @@ Theme::Theme(const QString &themePath, const QString &dirName, const QString &de KConfigGroup group(&config, QStringLiteral("Desktop Entry")); if (group.isValid()) { d->dirName = dirName; @@ -137,7 +63,7 @@ Index: grantleetheme-17.04.0/src/grantleethememanager.cpp } QString Theme::author() const -@@ -223,6 +231,13 @@ QString Theme::render(const QString &tem +@@ -223,6 +231,13 @@ QString Theme::render(const QString &templateName, const QVariantHash &data, con return result; } @@ -151,3 +77,79 @@ Index: grantleetheme-17.04.0/src/grantleethememanager.cpp void Theme::addPluginPath(const QString &path) { if (!ThemePrivate::sEngine) { +diff --git a/src/grantleetheme.h b/src/grantleetheme.h +index a25c27b..be38299 100644 +--- a/src/grantleetheme.h ++++ b/src/grantleetheme.h +@@ -48,11 +48,14 @@ public: + Q_REQUIRED_RESULT QStringList displayExtraVariables() const; + Q_REQUIRED_RESULT QString dirName() const; + Q_REQUIRED_RESULT QString absolutePath() const; ++ Q_REQUIRED_RESULT QStringList absolutePaths() const; + Q_REQUIRED_RESULT QString author() const; + Q_REQUIRED_RESULT QString authorEmail() const; + + Q_REQUIRED_RESULT QString render(const QString &templateName, const QVariantHash &data, const QByteArray &applicationDomain = QByteArray()); + ++ void addThemeDir(const QString&); ++ + static void addPluginPath(const QString &path); + + private: +diff --git a/src/grantleetheme_p.h b/src/grantleetheme_p.h +index eb73dcb..00510e9 100644 +--- a/src/grantleetheme_p.h ++++ b/src/grantleetheme_p.h +@@ -43,7 +43,7 @@ public: + QString description; + QString name; + QString dirName; +- QString absolutePath; ++ QStringList absolutePaths; + QString author; + QString email; + +diff --git a/src/grantleethememanager.cpp b/src/grantleethememanager.cpp +index 606d717..dc99041 100644 +--- a/src/grantleethememanager.cpp ++++ b/src/grantleethememanager.cpp +@@ -125,25 +125,18 @@ public: + + for (const QString &directory : qAsConst(themesDirectories)) { + QDirIterator dirIt(directory, QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot); +- QStringList alreadyLoadedThemeName; + while (dirIt.hasNext()) { + dirIt.next(); + const QString dirName = dirIt.fileName(); + GrantleeTheme::Theme theme = q->loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName); + if (theme.isValid()) { + QString themeName = theme.name(); +- if (alreadyLoadedThemeName.contains(themeName)) { +- int i = 2; +- const QString originalName(theme.name()); +- while (alreadyLoadedThemeName.contains(themeName)) { +- themeName = originalName + QStringLiteral(" (%1)").arg(i); +- ++i; +- } +- theme.d->name = themeName; ++ QMap<QString, GrantleeTheme::Theme>::iterator i = themes.find(dirName); ++ if (i != themes.end()) { ++ i.value().addThemeDir(dirIt.filePath()); ++ } else { ++ themes.insert(dirName, theme); + } +- alreadyLoadedThemeName << themeName; +- themes.insert(dirName, theme); +- //qDebug()<<" theme.name()"<<theme.name(); + } + } + watch->addDir(directory); +@@ -366,7 +359,7 @@ QString ThemeManager::pathFromThemes(const QString &themesRelativePath, const QS + GrantleeTheme::Theme theme = loadTheme(dirIt.filePath(), dirName, defaultDesktopFileName); + if (theme.isValid()) { + if (dirName == themeName) { +- return theme.absolutePath(); ++ return theme.absolutePaths().first(); + } + } + } |