summaryrefslogtreecommitdiff
blob: 4af27c7d7c11615938816f36041199109965a3da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From e4fb7dda788e5dc44ada56f089053453f3ff0c1c Mon Sep 17 00:00:00 2001
From: Christoph Cullmann <cullmann@kde.org>
Date: Mon, 29 Mar 2021 19:42:15 +0200
Subject: [PATCH] Revert "avoid race condition on loading the plugin"

This reverts commit 65ee2fac5eae6f69a6c72b315f0e5d702f1c4493.
---
 src/kiconloader.cpp | 12 ------------
 src/kicontheme.cpp  | 12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/kiconloader.cpp b/src/kiconloader.cpp
index 33c378b..f608966 100644
--- a/src/kiconloader.cpp
+++ b/src/kiconloader.cpp
@@ -383,8 +383,6 @@ public:
     bool mCustomPalette = false;
 };
 
-extern void initRCCIconTheme();
-
 class KIconLoaderGlobalData : public QObject
 {
     Q_OBJECT
@@ -392,16 +390,6 @@ 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 8e499d2..5be083d 100644
--- a/src/kicontheme.cpp
+++ b/src/kicontheme.cpp
@@ -57,7 +57,19 @@ void initRCCIconTheme()
         }
     }
 }
+Q_COREAPP_STARTUP_FUNCTION(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
+static void setBreezeFallback()
+{
+    QIcon::setFallbackThemeName(QStringLiteral("breeze"));
+}
+
+Q_COREAPP_STARTUP_FUNCTION(setBreezeFallback)
 class KIconThemeDir;
 class KIconThemePrivate
 {
-- 
GitLab