]> jfr.im git - irc/kvirc/KVIrc.git/commitdiff
KviRuntimeInfo: Fix the Qt theme detection
authorIceN9ne <redacted>
Thu, 31 Aug 2017 11:00:34 +0000 (07:00 -0400)
committerIceN9ne <redacted>
Thu, 31 Aug 2017 11:00:34 +0000 (07:00 -0400)
    * Fixes #2290

src/kvilib/ext/KviRuntimeInfo.cpp
src/kvirc/kernel/KviApplication.cpp

index c75e2b13d615f3d65302498a46c06647be32a70f..f2e623c40bed7724284075df451d30c7eac8193a 100644 (file)
@@ -732,6 +732,7 @@ namespace KviRuntimeInfo
 
        QString qtTheme()
        {
-               return QString(qApp->style()->objectName());
+               static QString theme{qApp->style()->objectName()};
+               return theme;
        }
 }
index 05679db1c8149dede8d2e6cf172d8e5a3b6275b8..713c3b8437cd634c5f9c5a1c9591256be9c99fb9 100644 (file)
@@ -87,6 +87,7 @@
 #include "KviSignalHandler.h"
 #include "KviPtrListIterator.h"
 #include "KviIrcNetwork.h"
+#include "KviRuntimeInfo.h"
 
 #include <QMenu>
 #include <algorithm>
@@ -448,6 +449,9 @@ void KviApplication::setup()
        // Script object controller
        //g_pScriptObjectController = new KviScriptObjectController(); gone
 
+       // Cache the QStyle theme before it's overriden
+       (void)KviRuntimeInfo::qtTheme();
+
        // use the default stylesheet unless the user has specified one
        if(styleSheet().isEmpty())
        {