diff --git a/CMakeLists.txt b/CMakeLists.txt index 88d7b5a..07f2413 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,112 +1,113 @@ project(kreversi) cmake_minimum_required (VERSION 3.5 FATAL_ERROR) set (QT_MIN_VERSION "5.7.0") set (KF5_MIN_VERSION "5.30.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(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 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Config ConfigWidgets CoreAddons Crash DBusAddons Declarative I18n IconThemes KIO XmlGui WidgetsAddons ) find_package(KF5DocTools ${KF5_MIN_VERSION}) find_package(KF5KDEGames 4.9.0 REQUIRED) include(FeatureSummary) include(ECMAddAppIcon) include(ECMInstallIcons) include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) add_definitions( -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII # -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER ) if (${KF5Config_VERSION} STRGREATER "5.56.0") add_definitions(-DQT_NO_FOREACH) MESSAGE(STATUS "compile without foreach") endif() if (EXISTS "${CMAKE_SOURCE_DIR}/.git") add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) + add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000) endif() add_subdirectory(pics) add_subdirectory(sounds) add_subdirectory(icons) if (KF5DocTools_FOUND) add_subdirectory(doc) endif() ########### next target ############## set(kreversi_SRCS commondefs.cpp colorscheme.cpp kreversigame.cpp kreversiview.cpp kreversiplayer.cpp kreversihumanplayer.cpp kreversicomputerplayer.cpp startgamedialog.cpp Engine.cpp highscores.cpp kexthighscore.cpp kexthighscore_gui.cpp kexthighscore_internal.cpp kexthighscore_item.cpp kexthighscore_tab.cpp mainwindow.cpp main.cpp ) qt5_add_resources(kreversi_SRCS kreversi.qrc) ki18n_wrap_ui(kreversi_SRCS startgamedialog.ui) kconfig_add_kcfg_files(kreversi_SRCS preferences.kcfgc) file(GLOB ICON_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/hicolor/*-apps-kreversi.png") ecm_add_app_icon(kreversi_SRCS ICONS ${ICON_SRCS}) add_executable(kreversi ${kreversi_SRCS}) target_link_libraries(kreversi Qt5::Svg KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons KF5::Crash KF5::DBusAddons KF5::Declarative KF5::IconThemes KF5::KIOCore KF5::KIOFileWidgets KF5::WidgetsAddons KF5::XmlGui KF5KDEGames ) install(TARGETS kreversi ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) ########### install files ############### install(PROGRAMS org.kde.kreversi.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(DIRECTORY qml DESTINATION ${KDE_INSTALL_DATADIR}/kreversi) install(FILES org.kde.kreversi.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/main.cpp b/main.cpp index af84208..f201897 100644 --- a/main.cpp +++ b/main.cpp @@ -1,86 +1,86 @@ /******************************************************************* * * Copyright 2006 Dmitry Suzdalev * * This file is part of the KDE project "KReversi" * * KReversi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * KReversi is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with KReversi; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * ******************************************************************* */ #include #include #include #include #include #include #include #include #include "highscores.h" #include "mainwindow.h" static const char description[] = I18N_NOOP("KDE Reversi Board Game"); int main(int argc, char **argv) { QApplication application(argc, argv); Kdelibs4ConfigMigrator migrate(QStringLiteral("kreversi")); migrate.setConfigFiles(QStringList() << QStringLiteral("kreversirc")); migrate.setUiFiles(QStringList() << QStringLiteral("kreversiui.rc")); migrate.migrate(); KLocalizedString::setApplicationDomain("kreversi"); KAboutData aboutData(QStringLiteral("kreversi"), i18n("KReversi"), QStringLiteral("2.1"), i18n(description), KAboutLicense::GPL, i18n("(c) 1997-2000, Mario Weilguni\n(c) 2004-2006, Inge Wallin\n(c) 2006, Dmitry Suzdalev"), QString(), i18n("http://games.kde.org/kreversi")); aboutData.addAuthor(i18n("Mario Weilguni"), i18n("Original author"), QStringLiteral("mweilguni@sime.com")); aboutData.addAuthor(i18n("Inge Wallin"), i18n("Original author"), QStringLiteral("inge@lysator.liu.se")); aboutData.addAuthor(i18n("Dmitry Suzdalev"), i18n("Game rewrite for KDE4. Current maintainer."), QStringLiteral("dimsuz@gmail.com")); aboutData.addCredit(i18n("Simon Hürlimann"), i18n("Action refactoring")); aboutData.addCredit(i18n("Mats Luthman"), i18n("Game engine, ported from his JAVA applet.")); aboutData.addCredit(i18n("Arne Klaassen"), i18n("Original raytraced chips.")); aboutData.addCredit(i18n("Mauricio Piacentini"), i18n("Vector chips and background for KDE4.")); aboutData.addCredit(i18n("Brian Croom"), i18n("Port rendering code to KGameRenderer"), QStringLiteral("brian.s.croom@gmail.com")); aboutData.addCredit(i18n("Denis Kuplyakov"), i18n("Port rendering code to QML, redesign and a lot of improvements"), QStringLiteral("dener.kup@gmail.com")); KAboutData::setApplicationData(aboutData); QCommandLineParser parser; KCrash::initialize(); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("demo"), i18n("Start with demo game playing"))); aboutData.setupCommandLine(&parser); parser.process(application); aboutData.processCommandLine(&parser); KDBusService service; if (application.isSessionRestored()) { - RESTORE(KReversiMainWindow) + kRestoreMainWindows(); } else { KReversiMainWindow *mainWin = new KReversiMainWindow(0, parser.isSet(QStringLiteral("demo"))); mainWin->show(); } KExtHighscore::ExtManager highscoresManager; application.setWindowIcon(QIcon::fromTheme(QStringLiteral("kreversi"))); return application.exec(); }