From 24a60c4650ea18bb6aa8329531f90c1f7eefd015 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 11:34:35 +0100 Subject: [PATCH 1/9] Make KCrash an optional dependency (option: WITH_KF5Crash). --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75ffe7ffa..c0bcfcea9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,18 @@ find_package( Qt5 ${QT_VERSION} CONFIG REQUIRED Core Gui Widgets LinguistTools S find_package( YamlCpp 0.5.1 REQUIRED ) find_package( PolkitQt5-1 REQUIRED ) +option( WITH_KF5Crash "Enable crash reporting with KCrash." ON ) + +macro_optional_find_package( KF5Crash 5.18 ) +macro_log_feature( + KF5Crash_FOUND + "KCrash" + "Helper library for submitting crash reports with DrKonqi by KDE." + "http://api.kde.org/frameworks-api/frameworks5-apidocs/kcrash/html/namespaceKCrash.html" + FALSE "5.18" + "KCrash is used if a crash happens when running in a Plasma session." +) + option( WITH_PYTHON "Enable Python modules support." ON ) macro_optional_find_package( PythonLibs 3.3 ) From e1326e397c1b20952ff9e23b8666c10630ac4239 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 11:35:03 +0100 Subject: [PATCH 2/9] Link against KCrash. --- src/calamares/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calamares/CMakeLists.txt b/src/calamares/CMakeLists.txt index f02815af9..6f2f87988 100644 --- a/src/calamares/CMakeLists.txt +++ b/src/calamares/CMakeLists.txt @@ -51,6 +51,11 @@ SET_TARGET_PROPERTIES(calamares_bin RUNTIME_OUTPUT_NAME calamares ) +if( WITH_KF5Crash ) + set( LINK_LIBRARIES + KF5::Crash + ) +endif() qt5_use_modules( calamares_bin Core Widgets ) target_link_libraries( calamares_bin From 99281241958f7a3500313275f49332e6576bb557 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Tue, 15 Mar 2016 11:15:09 +0100 Subject: [PATCH 3/9] Added toolbox page to Debug interface, with deliberate crash feature. --- src/libcalamaresui/utils/DebugWindow.cpp | 8 ++++++- src/libcalamaresui/utils/DebugWindow.ui | 27 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/libcalamaresui/utils/DebugWindow.cpp b/src/libcalamaresui/utils/DebugWindow.cpp index 168aec02a..504a56b6e 100644 --- a/src/libcalamaresui/utils/DebugWindow.cpp +++ b/src/libcalamaresui/utils/DebugWindow.cpp @@ -1,6 +1,6 @@ /* === This file is part of Calamares - === * - * Copyright 2015, Teo Mrnjavac + * Copyright 2015-2016, Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,7 @@ */ #include "DebugWindow.h" +#include "utils/CalamaresUtils.h" #include "utils/Retranslator.h" #include "utils/qjsonmodel.h" #include "JobQueue.h" @@ -91,6 +92,11 @@ DebugWindow::DebugWindow() } } ); + connect( crashButton, &QPushButton::clicked, + this, [] { + CalamaresUtils::crash(); + } ); + CALAMARES_RETRANSLATE( retranslateUi( this ); setWindowTitle( tr( "Debug information" ) ); diff --git a/src/libcalamaresui/utils/DebugWindow.ui b/src/libcalamaresui/utils/DebugWindow.ui index a445e8ad1..fa6b28acf 100644 --- a/src/libcalamaresui/utils/DebugWindow.ui +++ b/src/libcalamaresui/utils/DebugWindow.ui @@ -52,6 +52,33 @@ + + + Tools + + + + + + Crash now + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + From 1eba4b2d7740c058c106758162846eef7d0c4c54 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 12:18:05 +0100 Subject: [PATCH 4/9] Add Translators team credit. --- src/modules/welcome/WelcomePage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index e4a081186..7b1db01d1 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -74,8 +74,10 @@ WelcomePage::WelcomePage( RequirementsChecker* requirementsChecker, QWidget* par "%2
" "for %3


" "Copyright 2014-2015 Teo Mrnjavac <teo@kde.org>
" - "Thanks to: Anke Boersma, Aurélien Gâteau, Kevin Kofler, Philip Müller, " - "Pier Luigi Fiorini and Rohan Garg.

" + "Thanks to: Anke Boersma, Aurélien Gâteau, Kevin Kofler, " + "Philip Müller, Pier Luigi Fiorini, Rohan Garg and " + "" + "the Calamares translators team.

" "Calamares " "development is sponsored by
" "Blue Systems - " From 2a5b22f584eba18171bcbb509f3f3ca85cfa853e Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 12:18:35 +0100 Subject: [PATCH 5/9] If building with KCrash, require KCoreAddons. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0bcfcea9..198ed2a2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,10 @@ macro_log_feature( "KCrash is used if a crash happens when running in a Plasma session." ) +if ( KF5Crash_FOUND ) + find_package( KF5CoreAddons 5.18 REQUIRED ) +endif() + option( WITH_PYTHON "Enable Python modules support." ON ) macro_optional_find_package( PythonLibs 3.3 ) From e737c917965a95aad2fb64aab4cbf2211650797f Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 12:18:51 +0100 Subject: [PATCH 6/9] And link against KCoreAddons. --- src/calamares/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calamares/CMakeLists.txt b/src/calamares/CMakeLists.txt index 6f2f87988..bd7dcbdd7 100644 --- a/src/calamares/CMakeLists.txt +++ b/src/calamares/CMakeLists.txt @@ -53,6 +53,7 @@ SET_TARGET_PROPERTIES(calamares_bin if( WITH_KF5Crash ) set( LINK_LIBRARIES + KF5::CoreAddons KF5::Crash ) endif() From fe1e1cb3c00ec1935454c54b47bf1b6b6a2653d7 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 12:19:19 +0100 Subject: [PATCH 7/9] Export WITH_KCRASH in CalamaresConfig.h.in. --- src/libcalamares/CalamaresConfig.h.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcalamares/CalamaresConfig.h.in b/src/libcalamares/CalamaresConfig.h.in index 31cbc926d..7b909e520 100644 --- a/src/libcalamares/CalamaresConfig.h.in +++ b/src/libcalamares/CalamaresConfig.h.in @@ -10,5 +10,10 @@ //cmakedefines for CMake variables (e.g. for optdepends) go here #cmakedefine WITH_PYTHON +#cmakedefine WITH_KF5Crash + +#ifdef WITH_KF5Crash +#define WITH_KCRASH +#endif #endif // CALAMARESCONFIG_H From 8f86b197f2f9b0dc37528dab70123798c01c9e51 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 13:20:39 +0100 Subject: [PATCH 8/9] Initialize crash handler. --- src/calamares/main.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp index bc27688f3..7cd2728d2 100644 --- a/src/calamares/main.cpp +++ b/src/calamares/main.cpp @@ -19,10 +19,16 @@ #include "CalamaresApplication.h" +#include "CalamaresConfig.h" #include "kdsingleapplicationguard/kdsingleapplicationguard.h" #include "utils/CalamaresUtils.h" #include "utils/Logger.h" +#ifdef WITH_KCRASH +#include +#include +#endif + #include #include #include @@ -32,6 +38,22 @@ main( int argc, char* argv[] ) { CalamaresApplication a( argc, argv ); +#ifdef WITH_KCRASH + KAboutData aboutData( "calamares", + "Calamares", + a.applicationVersion(), + "The universal system installer", + KAboutLicense::GPL_V3, + QString(), + QString(), + "https://calamares.io", + "teo@kde.org" ); + KAboutData::setApplicationData( aboutData ); + KCrash::initialize(); + KCrash::setCrashHandler(); + // TODO: umount anything in /tmp/calamares-... as an emergency save function +#endif + QCommandLineParser parser; parser.setApplicationDescription( "Distribution-independent installer framework" ); parser.addHelpOption(); From d3d79448281213a6cb8351f20913112106780cc8 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 16 Mar 2016 13:33:42 +0100 Subject: [PATCH 9/9] Try with an URL. --- src/calamares/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp index 7cd2728d2..01dfbb9e0 100644 --- a/src/calamares/main.cpp +++ b/src/calamares/main.cpp @@ -47,7 +47,7 @@ main( int argc, char* argv[] ) QString(), QString(), "https://calamares.io", - "teo@kde.org" ); + "https://calamares.io/bugs" ); KAboutData::setApplicationData( aboutData ); KCrash::initialize(); KCrash::setCrashHandler();