[multimedia/plasmatube] src: Use KirigamiAppDefaults to setup style in main()

Arjen Hiemstra <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 709a8133b08c9ffb1f5993b45bd245d948b8441c by Arjen Hiemstra.
Committed on 29/07/2026 at 15:50.
Pushed by tfella into branch 'master'.

Use KirigamiAppDefaults to setup style in main()

There is now common code for this, let's use it to reduce code
duplication.

M  +1    -0    src/CMakeLists.txt
M  +4    -6    src/main.cpp

https://invent.kde.org/multimedia/plasmatube/-/commit/709a8133b08c9ffb1f5993b45bd245d948b8441c

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 594c25ed..87743d7c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -231,6 +231,7 @@ target_link_libraries(plasmatube PRIVATE
         KF6::ConfigCore
         KF6::ConfigGui
         KF6::I18n
+        KirigamiApp
         MpvQt::MpvQt)
 
 if (NOT ANDROID)
diff --git a/src/main.cpp b/src/main.cpp
index 27eeeb0b..ebf192ac 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -19,9 +19,10 @@
 #include <QQuickStyle>
 #include <QQuickWindow>
 
-#include <KLocalizedContext>
 #include <KAboutData>
+#include <KLocalizedContext>
 #include <KLocalizedString>
+#include <KirigamiAddons/App/KirigamiAppDefaults>
 
 #ifdef HAVE_KDBUSADDONS
 #include <KDBusService>
@@ -38,15 +39,12 @@ int main(int argc, char **argv)
 {
 #ifdef Q_OS_ANDROID
     QGuiApplication app(argc, argv);
-    QQuickStyle::setStyle(QStringLiteral("org.kde.breeze"));
 #else
     QApplication app(argc, argv);
-
-    if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) {
-        QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
-    }
 #endif
 
+    KirigamiAppDefaults::apply(&app);
+
     KLocalizedString::setApplicationDomain("plasmatube");
     QCoreApplication::setOrganizationName(QStringLiteral("KDE"));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.