[network/angelfish] /: Use KirigamiAppDefaults for setting up style and other defaults in main()
Arjen Hiemstra <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 02c5a8a78b4ed44ef85844e20e2376530a4d7875 by Arjen Hiemstra.
Committed on 29/07/2026 at 13:03.
Pushed by tfella into branch 'master'.
Use KirigamiAppDefaults for setting up style and other defaults in main()
This reduces code duplication and handles some cases better.
M +1 -1 CMakeLists.txt
M +1 -0 src/CMakeLists.txt
M +3 -9 src/main.cpp
https://invent.kde.org/network/angelfish/-/commit/02c5a8a78b4ed44ef85844e20e2376530a4d7875
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 177b240e..34bc9a10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,8 +59,8 @@ ecm_setup_version(${PROJECT_VERSION}
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2 Sql Widgets)
find_package(Qt6 ${QT_MIN_VERSION} OPTIONAL_COMPONENTS Feedback)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami Purpose I18n Config CoreAddons DBusAddons WindowSystem Notifications Crash OPTIONAL_COMPONENTS QQC2DesktopStyle)
-find_package(KF6KirigamiAddons 0.6 REQUIRED)
set_package_properties(KF6QQC2DesktopStyle PROPERTIES TYPE RUNTIME)
+find_package(KF6KirigamiAddons 1.12 REQUIRED)
# TODO: This should probably be done in QCoros installed CMake file instead.
if(Qt6Core_VERSION VERSION_GREATER_EQUAL "6.9.0")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 52001ae6..1827b8bc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -102,6 +102,7 @@ target_link_libraries(angelfish PRIVATE
AngelfishCore
AngelfishCoreplugin
angelfish_settingsplugin
+ KirigamiApp
)
install(TARGETS angelfish ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/src/main.cpp b/src/main.cpp
index 69fb368c..3a938876 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -21,6 +21,7 @@
#include <KLocalizedContext>
#include <KLocalizedString>
#include <KWindowSystem>
+#include <KirigamiAddons/App/KirigamiAppDefaults>
#include <csignal>
@@ -35,12 +36,6 @@ using namespace Qt::StringLiterals;
Q_DECL_EXPORT int main(int argc, char *argv[])
{
- // set default style and icon theme
- QIcon::setFallbackThemeName(QStringLiteral("breeze"));
- if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE") && QQuickStyle::name().isEmpty()) {
- QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
- }
-
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
// Setup QtWebEngine
@@ -65,6 +60,8 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QGuiApplication::setDesktopFileName(QStringLiteral("org.kde.angelfish"));
KLocalizedString::setApplicationDomain("angelfish");
+ KirigamiAppDefaults::apply(&app);
+
// Command line parser
QCommandLineParser parser;
parser.addPositionalArgument(QStringLiteral("url"), i18n("URL to open"), QStringLiteral("[url]"));
@@ -96,9 +93,6 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
aboutData.setBugAddress("https://bugs.kde.org/describecomponents.cgi?product=angelfish");
KAboutData::setApplicationData(aboutData);
- // Crash Handling
- KCrash::initialize();
-
// Open links in the already running window when e.g clicked on in another application.
KDBusService service(KDBusService::Unique, &app);
QObject::connect(&service, &KDBusService::activateRequested, &app, [&parser, &engine](const QStringList &arguments) {