[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [ksnakeduel/frameworks] /: Use KCrash.
From: Frederik Schwarzer <schwarzerf () gmail ! com>
Date: 2016-01-27 11:54:44
Message-ID: E1aOOgO-0001Zh-HK () scm ! kde ! org
[Download RAW message or body]
Git commit d60063baadc163084bdf49266be3eca1c8f586b5 by Frederik Schwarzer.
Committed on 27/01/2016 at 11:54.
Pushed by schwarzer into branch 'frameworks'.
Use KCrash.
M +36 -25 CMakeLists.txt
M +22 -20 main.cpp
http://commits.kde.org/ksnakeduel/d60063baadc163084bdf49266be3eca1c8f586b5
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 500a33f..89505d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,28 +2,29 @@ project(ksnakeduel)
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 Qml Quick \
QuickWidgets Svg Test)
-find_package(KF5 REQUIRED COMPONENTS
- CoreAddons
- Config
- ItemModels
- WidgetsAddons
- WindowSystem
+find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
+ ConfigWidgets
+ CoreAddons
+ Crash
DBusAddons
I18n
- ConfigWidgets
- TextWidgets
- XmlGui
+ ItemModels
+ KDELibs4Support
KIO
- NotifyConfig
NewStuff
- KDELibs4Support
- )
+ NotifyConfig
+ TextWidgets
+ WidgetsAddons
+ WindowSystem
+ XmlGui
+)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)
@@ -46,18 +47,19 @@ add_subdirectory(doc)
########### next target ###############
set(ksnakeduel_SRCS
- ksnakeduel_debug.cpp
- renderer.cpp
- object.cpp
- snakepart.cpp
- item.cpp
- obstacle.cpp
- playfield.cpp
- player.cpp
- intelligence.cpp
- tron.cpp
- ktron.cpp
- main.cpp)
+ ksnakeduel_debug.cpp
+ renderer.cpp
+ object.cpp
+ snakepart.cpp
+ item.cpp
+ obstacle.cpp
+ playfield.cpp
+ player.cpp
+ intelligence.cpp
+ tron.cpp
+ ktron.cpp
+ main.cpp
+)
ki18n_wrap_ui(ksnakeduel_SRCS general.ui)
@@ -68,7 +70,16 @@ ecm_add_app_icon(ksnakeduel_SRCS ICONS ${ICONS_SRCS})
add_executable(ksnakeduel ${ksnakeduel_SRCS})
-target_link_libraries(ksnakeduel KF5KDEGames KF5KDEGamesPrivate KF5::NotifyConfig \
KF5::I18n Qt5::Svg KF5::GuiAddons KF5::KDELibs4Support) \
+target_link_libraries(ksnakeduel + Qt5::Svg
+ KF5::Crash
+ KF5::GuiAddons
+ KF5::I18n
+ KF5::KDELibs4Support
+ KF5::NotifyConfig
+ KF5KDEGames
+ KF5KDEGamesPrivate
+)
install(TARGETS ksnakeduel ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
diff --git a/main.cpp b/main.cpp
index fd9e700..d675c73 100644
--- a/main.cpp
+++ b/main.cpp
@@ -24,6 +24,7 @@
#include <KLocalizedString>
#include <KAboutData>
+#include <KCrash>
#include <Kdelibs4ConfigMigrator>
#include <QCommandLineParser>
#include <QCommandLineOption>
@@ -54,41 +55,42 @@ int main(int argc, char* argv[])
migrate.setUiFiles(QStringList() << QStringLiteral("ksnakeduelui.rc"));
migrate.migrate();
- KAboutData aboutData( QStringLiteral("ksnakeduel"), i18n("KSnakeDuel"),
- KTRON_VERSION, description, KAboutLicense::GPL, notice);
- aboutData.addAuthor(i18n("Matthias Kiefer"), i18n("Original author"), \
QStringLiteral("matthias.kiefer@gmx.de"));
- aboutData.addAuthor(i18n("Benjamin Meyer"), i18n("Various improvements"), \
QStringLiteral("ben+ktron@meyerhome.net"));
- aboutData.addAuthor(i18n("Stas Verberkt"), i18n("KDE 4 Port, interface revision \
and KSnake mode"), QStringLiteral("legolas@legolasweb.nl")); + KAboutData \
aboutData( QStringLiteral("ksnakeduel"), i18n("KSnakeDuel"), + \
KTRON_VERSION, description, KAboutLicense::GPL, notice); + \
aboutData.addAuthor(i18n("Matthias Kiefer"), i18n("Original author"), \
QStringLiteral("matthias.kiefer@gmx.de")); + aboutData.addAuthor(i18n("Benjamin \
Meyer"), i18n("Various improvements"), QStringLiteral("ben+ktron@meyerhome.net")); + \
aboutData.addAuthor(i18n("Stas Verberkt"), i18n("KDE 4 Port, interface revision and \
KSnake mode"), QStringLiteral("legolas@legolasweb.nl"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
+ KCrash::initialize();
parser.addVersionOption();
parser.addHelpOption();
- parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("snake"), \
i18n("Start in KSnake mode"))); + \
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("snake"), \
i18n("Start in KSnake mode")));
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
- //KStandardDirs::locateLocal("appdata", QLatin1String( "themes/" ));
+ //KStandardDirs::locateLocal("appdata", QLatin1String( "themes/" ));
- if (parser.isSet(QStringLiteral("snake")))
- {
- Settings::setGameType(Settings::EnumGameType::Snake);
- }
- else if (Settings::gameType() == Settings::EnumGameType::Snake)
- {
- Settings::setGameType(Settings::EnumGameType::PlayerVSComputer);
- }
+ if (parser.isSet(QStringLiteral("snake")))
+ {
+ Settings::setGameType(Settings::EnumGameType::Snake);
+ }
+ else if (Settings::gameType() == Settings::EnumGameType::Snake)
+ {
+ Settings::setGameType(Settings::EnumGameType::PlayerVSComputer);
+ }
- Renderer::self(); // Creates Renderer
+ Renderer::self(); // Creates Renderer
- KTron *ktron = new KTron();
- ktron->show();
+ KTron *ktron = new KTron();
+ ktron->show();
- app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksnakeduel")));
+ app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksnakeduel")));
- 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