[utilities/kclock] src/kclock: Use KirigamiAppDefaults for setting up defaults

Tobias Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 45bc53d439ddf58809903e003c23a2710557ccad by Tobias Fella, on behalf of Arjen Hiemstra.
Committed on 25/07/2026 at 20:36.
Pushed by tfella into branch 'master'.

Use KirigamiAppDefaults for setting up defaults

Drop the custom style setting with KirigamiAppDefaults so we handle more
cases and reduce duplicate code.

M  +1    -0    src/kclock/CMakeLists.txt
M  +3    -10   src/kclock/main.cpp

https://invent.kde.org/utilities/kclock/-/commit/45bc53d439ddf58809903e003c23a2710557ccad

diff --git a/src/kclock/CMakeLists.txt b/src/kclock/CMakeLists.txt
index eb7943fd..7e3bdbab 100644
--- a/src/kclock/CMakeLists.txt
+++ b/src/kclock/CMakeLists.txt
@@ -160,6 +160,7 @@ target_link_libraries(kclock PRIVATE
     KF6::Crash
     KF6::I18nQml
     KF6::Svg
+    KirigamiApp
 )
 
 if(KCLOCK_BUILD_SHELL_OVERLAY)
diff --git a/src/kclock/main.cpp b/src/kclock/main.cpp
index b8584e36..0b7b8241 100644
--- a/src/kclock/main.cpp
+++ b/src/kclock/main.cpp
@@ -19,6 +19,7 @@
 #include <KLocalizedContext>
 #include <KLocalizedQmlContext>
 #include <KLocalizedString>
+#include <KirigamiAddons/App/KirigamiAppDefaults>
 
 #include <KDBusService>
 
@@ -35,15 +36,6 @@
 
 int main(int argc, char *argv[])
 {
-    // set default style
-    if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) {
-        QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
-    }
-    // if using org.kde.desktop, ensure we use kde style if possible
-    if (qEnvironmentVariableIsEmpty("QT_QPA_PLATFORMTHEME")) {
-        qputenv("QT_QPA_PLATFORMTHEME", "kde");
-    }
-
     QApplication app(argc, argv);
 
     KLocalizedString::setApplicationDomain("kclock");
@@ -58,7 +50,8 @@ int main(int argc, char *argv[])
     aboutData.addAuthor(i18n("Han Young"), QString(), QStringLiteral("[email protected]"));
     aboutData.addAuthor(i18n("Kai Uwe Broulik"), i18nc("Author", "Desktop Integration"), QStringLiteral("[email protected]"));
     KAboutData::setApplicationData(aboutData);
-    KCrash::initialize();
+
+    KirigamiAppDefaults::apply(&app);
 
     QCommandLineParser parser;
     aboutData.setupCommandLine(&parser);
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.