Commit e002db73 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use memberfunction-pointer overloads of KStandardGameAction/KStandardAction

Needs KF5KDEGames 7.3, which also indirectly bumps min KF/Qt deps
parent c26e749a
......@@ -12,8 +12,8 @@ set(KMAHJONGG_VERSION "${KMAHJONGG_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSI
project(kmahjongg VERSION ${KMAHJONGG_VERSION})
set(QT_MIN_VERSION "5.10.0")
set(KF5_MIN_VERSION "5.55.0")
set(QT_MIN_VERSION "5.11.0")
set(KF5_MIN_VERSION "5.64.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
......@@ -46,7 +46,7 @@ include(ECMQtDeclareLoggingCategory)
include(ECMSetupVersion)
find_package(KF5KMahjongglib REQUIRED)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(KF5KDEGames 7.3.0 REQUIRED)
add_definitions(
-DQT_NO_CAST_FROM_ASCII
......@@ -54,6 +54,7 @@ add_definitions(
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_URL_CAST_FROM_STRING
-DQT_USE_QSTRINGBUILDER
-DQT_NO_FOREACH
-DQT_NO_KEYWORDS
-DQT_STRICT_ITERATORS
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
......@@ -62,31 +63,20 @@ add_definitions(
-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x053700
-DKF_DEPRECATED_WARNINGS_SINCE=0x060000
)
if (${KF5Config_VERSION} STRGREATER "5.56.0")
add_definitions(-DQT_NO_FOREACH)
endif()
add_subdirectory(src)
add_subdirectory(icons)
add_subdirectory(layouts)
add_subdirectory(doc)
########### next target ###############
########### install files ###############
install(PROGRAMS org.kde.kmahjongg.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kmahjongg.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
if (${ECM_VERSION} STRGREATER "5.58.0")
install(FILES kmahjongg.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
else()
install(FILES kmahjongg.categories DESTINATION ${KDE_INSTALL_CONFDIR})
endif()
install(FILES kmahjongg.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
ki18n_install(po)
kdoctools_install(po)
########### Display Summary ###############
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -217,7 +217,8 @@ void Editor::setupToolbar()
m_topToolbar->addAction(shiftRight);
m_topToolbar->addSeparator();
QAction * quit = m_actionCollection->addAction(KStandardAction::Quit, QStringLiteral("quit"), this, SLOT(close()));
QAction * quit = m_actionCollection->addAction(KStandardAction::Quit, QStringLiteral("quit"));
connect(quit, &QAction::triggered, this, &Editor::close);
m_topToolbar->addAction(quit);
// status in the toolbar for now (ick)
......
......@@ -136,17 +136,17 @@ KMahjongg::~KMahjongg()
void KMahjongg::setupKAction()
{
KStandardGameAction::gameNew(this, SLOT(startNewGame()), actionCollection());
KStandardGameAction::load(this, SLOT(loadGame()), actionCollection());
KStandardGameAction::save(this, SLOT(saveGame()), actionCollection());
KStandardGameAction::quit(this, SLOT(close()), actionCollection());
KStandardGameAction::restart(this, SLOT(restartGame()), actionCollection());
KStandardGameAction::gameNew(this, &KMahjongg::startNewGame, actionCollection());
KStandardGameAction::load(this, &KMahjongg::loadGame, actionCollection());
KStandardGameAction::save(this, &KMahjongg::saveGame, actionCollection());
KStandardGameAction::quit(this, &KMahjongg::close, actionCollection());
KStandardGameAction::restart(this, &KMahjongg::restartGame, actionCollection());
QAction * newNumGame = actionCollection()->addAction(QStringLiteral("game_new_numeric"));
newNumGame->setText(i18n("New Numbered Game..."));
connect(newNumGame, &QAction::triggered, this, &KMahjongg::startNewNumeric);
QAction * action = KStandardGameAction::hint(m_gameView, SLOT(helpMove()), this);
QAction * action = KStandardGameAction::hint(m_gameView, &GameView::helpMove, this);
actionCollection()->addAction(action->objectName(), action);
QAction * shuffle = actionCollection()->addAction(QStringLiteral("move_shuffle"));
......@@ -170,14 +170,14 @@ void KMahjongg::setupKAction()
this, &KMahjongg::toggleFullscreen, this, actionCollection()
);
m_demoAction = KStandardGameAction::demo(this, SLOT(demoMode()), actionCollection());
m_demoAction = KStandardGameAction::demo(this, &KMahjongg::demoMode, actionCollection());
KStandardGameAction::highscores(this, SLOT(showHighscores()), actionCollection());
m_pauseAction = KStandardGameAction::pause(this, SLOT(pause()), actionCollection());
KStandardGameAction::highscores(this, &KMahjongg::showHighscores, actionCollection());
m_pauseAction = KStandardGameAction::pause(this, &KMahjongg::pause, actionCollection());
// move
m_undoAction = KStandardGameAction::undo(this, SLOT(undo()), actionCollection());
m_redoAction = KStandardGameAction::redo(this, SLOT(redo()), actionCollection());
m_undoAction = KStandardGameAction::undo(this, &KMahjongg::undo, actionCollection());
m_redoAction = KStandardGameAction::redo(this, &KMahjongg::redo, actionCollection());
// edit
QAction * boardEdit = actionCollection()->addAction(QStringLiteral("game_board_editor"));
......@@ -185,7 +185,7 @@ void KMahjongg::setupKAction()
connect(boardEdit, &QAction::triggered, this, &KMahjongg::slotBoardEditor);
// settings
KStandardAction::preferences(this, SLOT(showSettings()), actionCollection());
KStandardAction::preferences(this, &KMahjongg::showSettings, actionCollection());
setupGUI(qApp->primaryScreen()->geometry().size() * 0.7);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment