From c3db90d2e3f8eb4cde76832f525df140161edbf1 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Wed, 17 Apr 2024 18:38:08 +0200 Subject: [PATCH] Make DrKonqi work with NeoChat --- .kde-ci.yml | 1 + CMakeLists.txt | 2 +- src/CMakeLists.txt | 4 ++++ src/main.cpp | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.kde-ci.yml b/.kde-ci.yml index c91c9e503..1e7dd92b5 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -28,6 +28,7 @@ Dependencies: 'frameworks/kio': '@latest-kf6' 'frameworks/kwindowsystem': '@latest-kf6' 'frameworks/kstatusnotifieritem': '@latest-kf6' + 'frameworks/kcrash': '@latest-kf6' - 'on': ['Linux', 'FreeBSD'] 'require': 'frameworks/kdbusaddons': '@latest-kf6' diff --git a/CMakeLists.txt b/CMakeLists.txt index b5516c36e..93a2a9e0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ if(ANDROID) ) else() find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS Widgets) - find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle KIO WindowSystem StatusNotifierItem) + find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle KIO WindowSystem StatusNotifierItem Crash) find_package(KF6SyntaxHighlighting ${KF_MIN_VERSION} REQUIRED) set_package_properties(KF6QQC2DesktopStyle PROPERTIES TYPE RUNTIME diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5f5c15927..382c50554 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -405,6 +405,10 @@ target_link_libraries(neochat PUBLIC QCoro::Network ) +if (TARGET KF6::Crash) + target_link_libraries(neochat PUBLIC KF6::Crash) +endif() + kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc) if(NEOCHAT_FLATPAK) diff --git a/src/main.cpp b/src/main.cpp index 7d9765fad..292c9e20c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,6 +30,11 @@ #ifdef HAVE_WINDOWSYSTEM #include #endif + +#if __has_include("KCrash") +#include +#endif + #include #include @@ -162,6 +167,10 @@ int main(int argc, char *argv[]) KAboutData::setApplicationData(about); QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("org.kde.neochat"))); +#if __has_include("KCrash") + KCrash::initialize(); +#endif + initLogging(); Connection::setEncryptionDefault(true);