File Use-KCrash.patch of Package kblocks.5217

From: Frederik Schwarzer <schwarzerf@gmail.com>
Date: Wed, 27 Jan 2016 09:35:17 +0000
Subject: Use KCrash.
X-Git-Tag: v16.03.80
X-Git-Url: http://quickgit.kde.org/?p=kblocks.git&a=commitdiff&h=3906da92d977e2a7f11c39fb2275d1c02a562a7b
---
Use KCrash.
---


--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,16 +2,18 @@
 
 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 Svg Network )
-find_package(KF5 REQUIRED COMPONENTS 
+find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg Network)
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
+    Crash
     DocTools
     I18n
     XmlGui
-    )
+)
 
 find_package(KF5KDEGames 4.9.0 REQUIRED)
 find_package(Phonon4Qt5 CONFIG REQUIRED)
@@ -28,8 +30,8 @@
 add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
 
 
-add_subdirectory( themes )
-add_subdirectory( doc )
+add_subdirectory(themes)
+add_subdirectory(doc)
 
 
 ########### next target ###############
@@ -74,7 +76,8 @@
    AI/KBlocksAIPlannerExtend.cpp
    AI/KBlocksAIEvaluation.cpp
    AI/KBlocksAIFeature.cpp
-   AI/KBlocksAILog.cpp   )
+   AI/KBlocksAILog.cpp
+)
 
 kconfig_add_kcfg_files(kblocks_SRCS settings.kcfgc )
 
@@ -83,19 +86,28 @@
 
 add_executable(kblocks ${kblocks_SRCS})
 
-target_link_libraries(kblocks KF5KDEGames KF5KDEGamesPrivate  Phonon::phonon4qt5 Qt5::Network KF5::XmlGui KF5::I18n Qt5::Svg)
+target_link_libraries(kblocks
+    KF5KDEGames
+    KF5KDEGamesPrivate
+    Phonon::phonon4qt5
+    Qt5::Network
+    KF5::Crash
+    KF5::XmlGui
+    KF5::I18n
+    Qt5::Svg
+)
 
 install(TARGETS kblocks  ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
 
 ########### install files ###############
 
-install( PROGRAMS org.kde.kblocks.desktop  DESTINATION  ${KDE_INSTALL_APPDIR} )
-install( FILES kblocks.appdata.xml DESTINATION  ${KDE_INSTALL_METAINFODIR} )
-install( FILES kblocks.kcfg  DESTINATION  ${KDE_INSTALL_KCFGDIR} )
-install( FILES kblocksui.rc  DESTINATION  ${KDE_INSTALL_KXMLGUI5DIR}/kblocks )
-install( FILES kblocks.knsrc  DESTINATION  ${KDE_INSTALL_CONFDIR} )
+install(PROGRAMS org.kde.kblocks.desktop  DESTINATION  ${KDE_INSTALL_APPDIR})
+install(FILES kblocks.appdata.xml DESTINATION  ${KDE_INSTALL_METAINFODIR})
+install(FILES kblocks.kcfg  DESTINATION  ${KDE_INSTALL_KCFGDIR})
+install(FILES kblocksui.rc  DESTINATION  ${KDE_INSTALL_KXMLGUI5DIR}/kblocks)
+install(FILES kblocks.knsrc  DESTINATION  ${KDE_INSTALL_CONFDIR})
 
-ecm_install_icons( ICONS 128-apps-kblocks.png  16-apps-kblocks.png  22-apps-kblocks.png  32-apps-kblocks.png  48-apps-kblocks.png  64-apps-kblocks.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor   )
+ecm_install_icons(ICONS 128-apps-kblocks.png  16-apps-kblocks.png  22-apps-kblocks.png  32-apps-kblocks.png  48-apps-kblocks.png  64-apps-kblocks.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor)
 
 
 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

--- a/main.cpp
+++ b/main.cpp
@@ -13,6 +13,7 @@
 #include <vector>
 
 #include <KAboutData>
+#include <KCrash>
 #include <KLocalizedString>
 
 #include <QString>
@@ -324,6 +325,7 @@
     // Command line argument options
     QCommandLineParser parser;
     KAboutData::setApplicationData(aboutData);
+    KCrash::initialize();
     parser.addVersionOption();
     parser.addHelpOption();
     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("mode"), i18n("Setup kblocks game running mode.\n\t0 = Desktop Mode\t1 = Game Engine Mode\n\t2 = Gui Mode\t3 = Player Mode"), QStringLiteral("game mode"), QStringLiteral("0")));
openSUSE Build Service is sponsored by