Commit eb93e673 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile

parent 2540e2e3
......@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8.12)
find_package(ECM 0.0.11 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(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Qml Quick QuickWidgets Svg Test Declarative)
find_package(KF5 REQUIRED COMPONENTS
CoreAddons
Config
......@@ -76,7 +76,7 @@ kconfig_add_kcfg_files(kreversi_SRCS preferences.kcfgc)
add_executable(kreversi ${kreversi_SRCS})
target_link_libraries(kreversi Qt5::Svg Qt5::Declarative KF5::Declarative KF5::XmlGui KF5::TextWidgets KF5KDEGames)
target_link_libraries(kreversi Qt5::Svg Qt5::Declarative KF5::Declarative KF5::XmlGui KF5::TextWidgets KF5KDEGames KF5::Completion KF5::KDELibs4Support)
install(TARGETS kreversi ${INSTALL_TARGETS_DEFAULT_ARGS} )
......
......@@ -79,7 +79,7 @@ void ExtManager::convertLegacy(uint gameType)
if ( gameType!=0 )
return;
KConfigGroup cg(KGlobal::config(), "High Score");
KConfigGroup cg(KSharedConfig::openConfig(), "High Score");
for (uint i = 1; i <= 10; i++) {
QString key = "Pos" + QString::number(i);
......
......@@ -395,4 +395,3 @@ void KReversiGame::kickCurrentPlayer()
emit blackPlayerTurn();
}
#include "kreversigame.moc"
......@@ -25,9 +25,11 @@
#include <QApplication>
#include <KLocalizedString>
#include <KAboutData>
#include <QCommandLineParser>
#include <highscores.h>
#include <mainwindow.h>
#include <QCommandLineOption>
static const char description[] = I18N_NOOP("KDE Reversi Board Game");
......@@ -51,12 +53,21 @@ int main(int argc, char **argv)
KAboutData::setApplicationData(aboutData);
QCommandLineParser parser;
QApplication app(argc, argv);
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("demo"), i18n("Start with demo game playing")));
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
if (application.isSessionRestored()) {
RESTORE(KReversiMainWindow)
} else {
KReversiMainWindow *mainWin = new KReversiMainWindow(0, args->isSet("demo"));
args->clear();
KReversiMainWindow *mainWin = new KReversiMainWindow(0, parser.isSet("demo"));
mainWin->show();
}
......
......@@ -25,7 +25,7 @@
#include <mainwindow.h>
#include <KDebug>
#include <KIcon>
#include <QIcon>
#include <KLocale>
#include <KMessageBox>
#include <KStandardDirs>
......@@ -120,12 +120,12 @@ void KReversiMainWindow::setupActionsInit()
m_hintAct->setEnabled(false);
// Last move
m_showLast = new KToggleAction(KIcon(QLatin1String("lastmoves")), i18n("Show Last Move"), this);
m_showLast = new KToggleAction(QIcon::fromTheme(QLatin1String("lastmoves")), i18n("Show Last Move"), this);
actionCollection()->addAction(QLatin1String("show_last_move"), m_showLast);
connect(m_showLast, SIGNAL(triggered(bool)), m_view, SLOT(setShowLastMove(bool)));
// Legal moves
m_showLegal = new KToggleAction(KIcon(QLatin1String("legalmoves")), i18n("Show Legal Moves"), this);
m_showLegal = new KToggleAction(QIcon::fromTheme(QLatin1String("legalmoves")), i18n("Show Legal Moves"), this);
actionCollection()->addAction(QLatin1String("show_legal_moves"), m_showLegal);
connect(m_showLegal, SIGNAL(triggered(bool)), m_view, SLOT(setShowLegalMoves(bool)));
......@@ -145,7 +145,7 @@ void KReversiMainWindow::setupActionsInit()
// Move history
// NOTE: read/write this from/to config file? Or not necessary?
m_showMovesAct = new KToggleAction(KIcon(QLatin1String("view-history")), i18n("Show Move History"), this);
m_showMovesAct = new KToggleAction(QIcon::fromTheme(QLatin1String("view-history")), i18n("Show Move History"), this);
actionCollection()->addAction(QLatin1String("show_moves"), m_showMovesAct);
connect(m_showMovesAct, SIGNAL(triggered(bool)), SLOT(slotShowMovesHistory(bool)));
}
......@@ -181,7 +181,7 @@ void KReversiMainWindow::slotAnimSpeedChanged(int speed)
{
m_view->setAnimationSpeed(speed);
Preferences::setAnimationSpeed(speed);
Preferences::self()->writeConfig();
Preferences::self()->save();
}
void KReversiMainWindow::slotUseColoredChips(bool toggled)
......@@ -192,7 +192,7 @@ void KReversiMainWindow::slotUseColoredChips(bool toggled)
m_view->setChipsPrefix(chipsPrefix);
m_startDialog->setChipsPrefix(chipsPrefix);
Preferences::setUseColoredChips(toggled);
Preferences::self()->writeConfig();
Preferences::self()->save();
}
void KReversiMainWindow::slotShowMovesHistory(bool toggled)
......
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