diff --git a/CMakeLists.txt b/CMakeLists.txt index c15a46fca..d80a23503 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ set_package_properties(KF6Kirigami PROPERTIES TYPE REQUIRED PURPOSE "Kirigami application UI framework" ) -find_package(KF6KirigamiAddons 1.6.0 REQUIRED) +find_package(KF6KirigamiAddons 1.10.0 REQUIRED) if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT NEOCHAT_FLATPAK AND NOT NEOCHAT_APPIMAGE) find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Purpose) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index a5d513d2c..77b204839 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -205,6 +205,7 @@ target_link_libraries(neochat PUBLIC KF6::IconThemes KF6::ItemModels KF6::I18nQml + KirigamiApp QuotientQt6 Login Rooms diff --git a/src/app/main.cpp b/src/app/main.cpp index 6e4043296..ae71dd366 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -33,13 +33,10 @@ #include #endif -#if __has_include("KCrash") -#include -#endif - #include #include #include +#include #include "neochat-version.h" @@ -104,7 +101,6 @@ Q_DECL_EXPORT #endif int main(int argc, char *argv[]) { - KIconTheme::initTheme(); QNetworkProxyFactory::setUseSystemConfiguration(true); #ifdef HAVE_WEBVIEW @@ -113,24 +109,10 @@ int main(int argc, char *argv[]) QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi); #endif -#ifdef Q_OS_ANDROID - QGuiApplication app(argc, argv); - QQuickStyle::setStyle(u"org.kde.breeze"_s); -#else - QIcon::setFallbackThemeName("breeze"_L1); - QApplication app(argc, argv); - // Default to org.kde.desktop style unless the user forces another style - if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { - QQuickStyle::setStyle(u"org.kde.desktop"_s); - } -#endif + KirigamiApp::App app(argc, argv); + KirigamiApp kirigamiApp; #ifdef Q_OS_WINDOWS - if (AttachConsole(ATTACH_PARENT_PROCESS)) { - freopen("CONOUT$", "w", stdout); - freopen("CONOUT$", "w", stderr); - } - QApplication::setStyle(u"breeze"_s); QFont font(u"Segoe UI Emoji"_s); font.setPointSize(10); @@ -177,10 +159,6 @@ int main(int argc, char *argv[]) KAboutData::setApplicationData(about); QGuiApplication::setWindowIcon(QIcon::fromTheme(u"org.kde.neochat"_s)); -#if __has_include("KCrash") - KCrash::initialize(); -#endif - Connection::setEncryptionDefault(true); Connection::setDirectChatEncryptionDefault(true); @@ -300,7 +278,9 @@ int main(int argc, char *argv[]) engine.addImageProvider(u"blurhash"_s, new BlurhashImageProvider); - engine.loadFromModule("org.kde.neochat", "Main"); + if (!kirigamiApp.start("org.kde.neochat", "Main", &engine)) { + return -1; + } if (!parser.positionalArguments().isEmpty() && !parser.isSet("share"_L1)) { RoomManager::instance().setUrlArgument(parser.positionalArguments()[0]);