forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apply svgiconengine patch to kiconthemes package
Related discussion: - https://invent.kde.org/utilities/kcharselect/-/merge_requests/20 - msys2#20687
- Loading branch information
Showing
3 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x '*\.o' -x '*\.pyc' -x CMakeLists.txt.user kiconthemes-6.1.0.orig/src/kicontheme.cpp kiconthemes-6.1.0/src/kicontheme.cpp | ||
--- kiconthemes-6.1.0.orig/src/kicontheme.cpp 2024-04-05 12:56:43.000000000 +0200 | ||
+++ kiconthemes-6.1.0/src/kicontheme.cpp 2024-04-15 11:51:58.968290800 +0200 | ||
@@ -45,8 +45,8 @@ | ||
// For this reason we use AppDataLocation: BINDIR/data on Windows, Resources on OS X | ||
void initRCCIconTheme() | ||
{ | ||
-#ifdef WITH_BREEZEICONS | ||
- BreezeIcons::initIcons() | ||
+#ifdef WITH_BREEZEICONS_LIB | ||
+ BreezeIcons::initIcons(); | ||
#else | ||
const QString iconThemeRcc = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("icontheme.rcc")); | ||
if (!iconThemeRcc.isEmpty()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
diff --git a/src/kiconengineplugin.json b/src/kiconengineplugin.json | ||
index bc09e41..a5b4228 100644 | ||
--- a/src/kiconengineplugin.json | ||
+++ b/src/kiconengineplugin.json | ||
@@ -1,4 +1,4 @@ | ||
{ | ||
- "Keys": [ "KIconEngine" ] | ||
+ "Keys": [ "KIconEngine", "svg", "svgz", "svg.gz" ] | ||
} | ||
|
||
diff --git a/src/kiconloader.cpp b/src/kiconloader.cpp | ||
index 3cebfc6..0eded28 100644 | ||
--- a/src/kiconloader.cpp | ||
+++ b/src/kiconloader.cpp | ||
@@ -147,6 +147,8 @@ QString KIconThemeNode::findIcon(const QString &name, int size, KIconLoader::Mat | ||
extern KICONTHEMES_EXPORT int kiconloader_ms_between_checks; | ||
KICONTHEMES_EXPORT int kiconloader_ms_between_checks = 5000; | ||
|
||
+extern void initRCCIconTheme(); | ||
+ | ||
class KIconLoaderGlobalData : public QObject | ||
{ | ||
Q_OBJECT | ||
@@ -154,6 +156,16 @@ class KIconLoaderGlobalData : public QObject | ||
public: | ||
KIconLoaderGlobalData() | ||
{ | ||
+ // ensure we load rcc files for application bundles (+ setup their theme) | ||
+ initRCCIconTheme(); | ||
+ | ||
+ // Set the icon theme fallback to breeze | ||
+ // Most of our apps use "lots" of icons that most of the times | ||
+ // are only available with breeze, we still honour the user icon | ||
+ // theme but if the icon is not found there, we go to breeze | ||
+ // since it's almost sure it'll be there | ||
+ QIcon::setFallbackThemeName(QStringLiteral("breeze")); | ||
+ | ||
const QStringList genericIconsFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("mime/generic-icons")); | ||
// qCDebug(KICONTHEMES) << genericIconsFiles; | ||
for (const QString &file : genericIconsFiles) { | ||
diff --git a/src/kicontheme.cpp b/src/kicontheme.cpp | ||
index 4eee2ff..e94f10c 100644 | ||
--- a/src/kicontheme.cpp | ||
+++ b/src/kicontheme.cpp | ||
@@ -61,32 +61,7 @@ void initRCCIconTheme() | ||
} | ||
} | ||
} | ||
-Q_COREAPP_STARTUP_FUNCTION(initRCCIconTheme) | ||
- | ||
-// Makes sure the icon theme fallback is set to breeze or one of its | ||
-// variants. Most of our apps use "lots" of icons that most of the times | ||
-// are only available with breeze, we still honour the user icon theme | ||
-// but if the icon is not found there, we go to breeze since it's almost | ||
-// sure it'll be there | ||
-static void setBreezeFallback() | ||
-{ | ||
- if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) { | ||
- const QVariant themeHint = theme->themeHint(QPlatformTheme::SystemIconFallbackThemeName); | ||
- if (themeHint.isValid()) { | ||
- const QString iconTheme = themeHint.toString(); | ||
- if (iconTheme.contains(QStringLiteral("breeze"), Qt::CaseInsensitive)) { | ||
- QIcon::setFallbackThemeName(iconTheme); | ||
- return; | ||
- } | ||
- } | ||
- } | ||
|
||
- QIcon::setFallbackThemeName(QStringLiteral("breeze")); | ||
-} | ||
- | ||
-#ifndef Q_OS_ANDROID | ||
-Q_COREAPP_STARTUP_FUNCTION(setBreezeFallback) | ||
-#endif | ||
class KIconThemeDir; | ||
class KIconThemePrivate | ||
{ |