diff --git a/CMakeLists.txt b/CMakeLists.txt index b522235..35f8494 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,70 +1,71 @@ project(kmines) 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 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) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Config ConfigWidgets CoreAddons Crash DBusAddons DocTools I18n TextWidgets WidgetsAddons XmlGui ) find_package(KF5KDEGames 4.9.0 REQUIRED) include(FeatureSummary) include(ECMAddAppIcon) include(ECMInstallIcons) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) 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(data) add_subdirectory(themes) add_subdirectory(doc) ########### next target ############### set(kmines_SRCS mainwindow.cpp cellitem.cpp borderitem.cpp minefielditem.cpp scene.cpp main.cpp ) qt5_add_resources(kmines_SRCS kmines.qrc) ki18n_wrap_ui(kmines_SRCS customgame.ui generalopts.ui) kconfig_add_kcfg_files(kmines_SRCS settings.kcfgc ) file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/data/*-apps-kmines.png") ecm_add_app_icon(kmines_SRCS ICONS ${ICONS_SRCS}) add_executable(kmines ${kmines_SRCS}) target_link_libraries(kmines KF5::TextWidgets KF5::WidgetsAddons KF5::DBusAddons KF5::Crash KF5::XmlGui KF5KDEGames ) install(TARGETS kmines ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) ########### install files ############### feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/main.cpp b/main.cpp index 368bcd9..fb9706a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,84 +1,84 @@ /* * Copyright (c) 1996-2004 Nicolas HADACEK * * This program 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 of the License, or * (at your option) any later version. * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include "version.h" #include "mainwindow.h" static const char *DESCRIPTION = I18N_NOOP("KMines is a classic minesweeper game"); int main(int argc, char **argv) { QApplication app(argc, argv); Kdelibs4ConfigMigrator migrate(QStringLiteral("kmines")); migrate.setConfigFiles(QStringList() << QStringLiteral("kminesrc")); migrate.setUiFiles(QStringList() << QStringLiteral("kminesui.rc")); if(migrate.migrate()) { // update the configuration cache KSharedConfig::openConfig()->reparseConfiguration(); } KLocalizedString::setApplicationDomain("kmines"); KAboutData aboutData(QStringLiteral("kmines"), i18n("KMines"), QStringLiteral(LONG_VERSION), i18n(DESCRIPTION), KAboutLicense::GPL, i18n(COPYLEFT), QString(), QStringLiteral(HOMEPAGE)); aboutData.addAuthor(i18n("Nicolas Hadacek"), i18n("Original author"), QStringLiteral("hadacek@kde.org")); aboutData.addAuthor(i18n("Mauricio Piacentini"), i18n("Code refactoring and SVG support. Current maintainer"), QStringLiteral("mauricio@tabuleiro.com")); aboutData.addAuthor(i18n("Dmitry Suzdalev"), i18n("Rewrite to use QGraphicsView framework. Current maintainer"), QStringLiteral("dimsuz@gmail.com")); aboutData.addCredit(i18n("Andreas Zehender"), i18n("Smiley pixmaps")); aboutData.addCredit(i18n("Mikhail Kourinny"), i18n("Solver/Adviser")); aboutData.addCredit(i18n("Thomas Capricelli"), i18n("Magic reveal mode")); aboutData.addCredit(i18n("Brian Croom"), i18n("Port to use KGameRenderer")); aboutData.setOrganizationDomain(QByteArray("kde.org")); aboutData.setProductName(QByteArray("kmines")); app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kmines"))); KAboutData::setApplicationData(aboutData); KCrash::initialize(); QCommandLineParser parser; aboutData.setupCommandLine(&parser); parser.process(app); aboutData.processCommandLine(&parser); KDBusService service; if ( app.isSessionRestored() ) - RESTORE(KMinesMainWindow) + kRestoreMainWindows(); else { KMinesMainWindow *mw = new KMinesMainWindow; mw->show(); } return app.exec(); }