[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [palapeli/frameworks] /: Use KCrash.
From:       Frederik Schwarzer <schwarzerf () gmail ! com>
Date:       2016-01-27 12:29:03
Message-ID: E1aOPDb-0008RR-4O () scm ! kde ! org
[Download RAW message or body]

Git commit 0e74f6ddd77cb555eac5696e86ae0d2bad4013a4 by Frederik Schwarzer.
Committed on 27/01/2016 at 12:28.
Pushed by schwarzer into branch 'frameworks'.

Use KCrash.

M  +13   -10   CMakeLists.txt
M  +8    -1    src/CMakeLists.txt
M  +13   -12   src/main.cpp

http://commits.kde.org/palapeli/0e74f6ddd77cb555eac5696e86ae0d2bad4013a4

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f56fadf..6a867bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,27 +2,30 @@ project(palapeli)
 
 cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
 set (QT_MIN_VERSION "5.3.0")
+set (KF5_MIN_VERSION "5.15.0")
 
 find_package(ECM 1.7.0 REQUIRED CONFIG)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 
 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Concurrent \
                Svg)
-find_package(KF5 REQUIRED COMPONENTS 
-    CoreAddons
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
     Archive
     Config
+    ConfigWidgets
+    CoreAddons
+    Crash
+    GuiAddons
+    I18n
     ItemModels
+    KDELibs4Support
+    KIO
+    NewStuff
+    NotifyConfig
+    TextWidgets
     WidgetsAddons
     WindowSystem
-    I18n
-    GuiAddons
-    ConfigWidgets
-    TextWidgets
     XmlGui
-    KIO
-    NotifyConfig
-    NewStuff
-    KDELibs4Support)
+)
 
 find_package(KF5KDEGames 4.9.0 REQUIRED)
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ff6c67a..602ede5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -50,7 +50,14 @@ file(GLOB ICONS_SRCS \
"${CMAKE_CURRENT_SOURCE_DIR}/../pics/*-apps-palapeli.png")  \
ecm_add_app_icon(palapeli_SRCS ICONS ${ICONS_SRCS})  
 add_executable(palapeli ${palapeli_SRCS})
-target_link_libraries(palapeli pala KF5::KDELibs4Support KF5::Archive \
Qt5::Concurrent Qt5::Svg) +target_link_libraries(palapeli
+    pala
+    KF5::KDELibs4Support
+    KF5::Archive
+    KF5::Crash
+    Qt5::Concurrent
+    Qt5::Svg
+)
 
 install(TARGETS palapeli ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
 install(FILES palapeliui.rc
diff --git a/src/main.cpp b/src/main.cpp
index 0cf94fb..78c4f1e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -22,7 +22,7 @@
 #include <ctime>
 #include <QTimer>
 #include <KAboutData>
-
+#include <KCrash>
 
 #include <QApplication>
 #include <KLocalizedString>
@@ -31,18 +31,19 @@
 
 int main(int argc, char** argv)
 {
-	qsrand(time(0));
-	KAboutData about("palapeli", i18nc("The application's name", "Palapeli"), "2.0", \
i18n("KDE Jigsaw Puzzle Game"), KAboutLicense::GPL, i18n("Copyright 2009, 2010, \
                Stefan Majewsky"));
-	about.addAuthor(i18n("Stefan Majewsky"), QString(), "majewsky@gmx.net", \
                "http://majewsky.wordpress.com");
-	about.addCredit (i18n ("Johannes Loehnert"),
-			 i18n ("The option to preview the completed puzzle"),
-			 "loehnert.kde@gmx.de");
+    qsrand(time(0));
+    KAboutData about("palapeli", i18nc("The application's name", "Palapeli"), "2.0", \
i18n("KDE Jigsaw Puzzle Game"), KAboutLicense::GPL, i18n("Copyright 2009, 2010, \
Stefan Majewsky")); +    about.addAuthor(i18n("Stefan Majewsky"), QString(), \
"majewsky@gmx.net", "http://majewsky.wordpress.com"); +    about.addCredit (i18n \
("Johannes Loehnert"), +            i18n ("The option to preview the completed \
puzzle"), +            "loehnert.kde@gmx.de");
     QApplication app(argc, argv);
 
     KLocalizedString::setApplicationDomain("palapeli");
 
     QCommandLineParser parser;
     KAboutData::setApplicationData(about);
+    KCrash::initialize();
     parser.addVersionOption();
     parser.addHelpOption();
         parser.addPositionalArgument(QStringLiteral("puzzlefile"), i18n("Path to \
puzzle file (will be opened if -i is not given)")); @@ -54,9 +55,9 @@ int main(int \
argc, char** argv)  about.processCommandLine(&parser);
 
 
-	//NOTE: Syntax errors are reported on stderr, while file errors are presented to \
                the user.
-	if (parser.isSet("import"))
-		//perform import request
+    //NOTE: Syntax errors are reported on stderr, while file errors are presented to \
the user. +    if (parser.isSet("import"))
+        //perform import request
         new Palapeli::ImportHelper(parser.value("import"));
     else {
         const QStringList args = parser.positionalArguments();
@@ -64,9 +65,9 @@ int main(int argc, char** argv)
         if (args.count()>1) {
             path = args.at(1);
         }
-		//no import request, show main window
+        //no import request, show main window
         (new Palapeli::MainWindow(path))->show();
     }
     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("palapeli")));
-	return app.exec();
+    return app.exec();
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic