summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2014-12-03 13:28:57 +0100
committerMontel Laurent <[email protected]>2014-12-03 13:28:57 +0100
commitf2f183bfe4b3a148c4cf64be57e4d76d61f8accd (patch)
tree36a540213f1bf769b2b7bdb18e3685d57e2fd7f5
parent5841a42990011f87327a861abe1d692b9f012139 (diff)
Port to KF5
-rw-r--r--CMakeLists.txt44
-rw-r--r--data/icons/CMakeLists.txt2
-rw-r--r--data/icons/hi128-apps-kigo.png (renamed from data/icons/hi128-app-kigo.png)bin10962 -> 10962 bytes
-rw-r--r--data/icons/hi16-apps-kigo.png (renamed from data/icons/hi16-app-kigo.png)bin859 -> 859 bytes
-rw-r--r--data/icons/hi22-apps-kigo.png (renamed from data/icons/hi22-app-kigo.png)bin3919 -> 3919 bytes
-rw-r--r--data/icons/hi32-apps-kigo.png (renamed from data/icons/hi32-app-kigo.png)bin2248 -> 2248 bytes
-rw-r--r--data/icons/hi48-apps-kigo.png (renamed from data/icons/hi48-app-kigo.png)bin3411 -> 3411 bytes
-rw-r--r--data/icons/hi64-apps-kigo.png (renamed from data/icons/hi64-app-kigo.png)bin4515 -> 4515 bytes
-rw-r--r--doc/CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt9
-rw-r--r--src/gui/config/generalconfig.cpp2
-rw-r--r--src/gui/graphicsview/gamescene.cpp2
-rw-r--r--src/gui/mainwindow.cpp13
-rw-r--r--src/gui/mainwindow.h22
-rw-r--r--src/gui/widgets/gamewidget.cpp2
-rw-r--r--src/gui/widgets/setupwidget.cpp2
-rw-r--r--src/main.cpp7
17 files changed, 66 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bea560b..29d5b52 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,15 +1,41 @@
project(kigo)
-if(NOT COMPILING_KDEGAMES)
- find_package(KDE4 REQUIRED)
- include(KDE4Defaults)
- include(MacroLibrary)
- find_package(KDEGames REQUIRED)
+cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
+set (QT_MIN_VERSION "5.3.0")
- add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
- add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
- include_directories(${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS})
-endif(NOT COMPILING_KDEGAMES)
+find_package(ECM 1.3.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
+ Config
+ DBusAddons
+ I18n
+ ConfigWidgets
+ TextWidgets
+ XmlGui
+ KIO
+ NotifyConfig
+ NewStuff
+ KDELibs4Support)
+
+find_package(KF5KDEGames 4.9.0 REQUIRED)
+find_package(Phonon4Qt5 CONFIG REQUIRED)
+
+include(FeatureSummary)
+include(ECMInstallIcons)
+include(KDEInstallDirs)
+include(KDECompilerSettings)
+include(KDECMakeSettings)
+
+add_definitions(${QT_DEFINITIONS})
+add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
+add_definitions(-DTRANSLATION_DOMAIN="kigo")
add_subdirectory(src)
add_subdirectory(data)
diff --git a/data/icons/CMakeLists.txt b/data/icons/CMakeLists.txt
index 02e3c9e..b5448ad 100644
--- a/data/icons/CMakeLists.txt
+++ b/data/icons/CMakeLists.txt
@@ -1 +1 @@
-kde4_install_icons(${ICON_INSTALL_DIR})
+ecm_install_icons(ICONS hi128-apps-kigo.png hi16-apps-kigo.png hi22-apps-kigo.png hi32-apps-kigo.png hi48-apps-kigo.png hi64-apps-kigo.png DESTINATION ${ICON_INSTALL_DIR})
diff --git a/data/icons/hi128-app-kigo.png b/data/icons/hi128-apps-kigo.png
index 2fe70e9..2fe70e9 100644
--- a/data/icons/hi128-app-kigo.png
+++ b/data/icons/hi128-apps-kigo.png
Binary files differ
diff --git a/data/icons/hi16-app-kigo.png b/data/icons/hi16-apps-kigo.png
index 4839fa2..4839fa2 100644
--- a/data/icons/hi16-app-kigo.png
+++ b/data/icons/hi16-apps-kigo.png
Binary files differ
diff --git a/data/icons/hi22-app-kigo.png b/data/icons/hi22-apps-kigo.png
index 271430e..271430e 100644
--- a/data/icons/hi22-app-kigo.png
+++ b/data/icons/hi22-apps-kigo.png
Binary files differ
diff --git a/data/icons/hi32-app-kigo.png b/data/icons/hi32-apps-kigo.png
index deb7f42..deb7f42 100644
--- a/data/icons/hi32-app-kigo.png
+++ b/data/icons/hi32-apps-kigo.png
Binary files differ
diff --git a/data/icons/hi48-app-kigo.png b/data/icons/hi48-apps-kigo.png
index 049aad4..049aad4 100644
--- a/data/icons/hi48-app-kigo.png
+++ b/data/icons/hi48-apps-kigo.png
Binary files differ
diff --git a/data/icons/hi64-app-kigo.png b/data/icons/hi64-apps-kigo.png
index 2e00e92..2e00e92 100644
--- a/data/icons/hi64-app-kigo.png
+++ b/data/icons/hi64-apps-kigo.png
Binary files differ
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 45f0474..80b1844 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1 +1 @@
-kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kigo)
+kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kigo)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 333611f..95dab29 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,3 @@
-include_directories(${KDE4_INCLUDES} ${KDEGAMES_INCLUDE_DIR})
set(kigo_SRCS
game/game.cpp
@@ -17,17 +16,17 @@ set(kigo_SRCS
main.cpp
)
-kde4_add_ui_files(kigo_SRCS
+ki18n_wrap_ui(kigo_SRCS
gui/config/generalconfig.ui
gui/widgets/errorwidget.ui
gui/widgets/gamewidget.ui
gui/widgets/setupwidget.ui
)
-kde4_add_kcfg_files(kigo_SRCS preferences.kcfgc)
+kconfig_add_kcfg_files(kigo_SRCS preferences.kcfgc)
kde4_add_app_icon(kigo_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../data/icons/hi*-app-kigo.png")
-kde4_add_executable(kigo ${kigo_SRCS})
+add_executable(kigo ${kigo_SRCS})
-target_link_libraries(kigo ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} kdegames kdegamesprivate ${KDE4_KNEWSTUFF3_LIBS})
+target_link_libraries(kigo KF5::KIOCore KF5KDEGames KF5KDEGamesPrivate KF5::NewStuff Qt5::Svg)
install(TARGETS kigo ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES kigo.kcfg DESTINATION ${KCFG_INSTALL_DIR})
diff --git a/src/gui/config/generalconfig.cpp b/src/gui/config/generalconfig.cpp
index 8a3dcc9..8b10946 100644
--- a/src/gui/config/generalconfig.cpp
+++ b/src/gui/config/generalconfig.cpp
@@ -21,7 +21,7 @@
#include "generalconfig.h"
#include "preferences.h"
#include "game/game.h"
-
+#include <KUrl>
namespace Kigo {
GeneralConfig::GeneralConfig(QWidget *parent)
diff --git a/src/gui/graphicsview/gamescene.cpp b/src/gui/graphicsview/gamescene.cpp
index fb1ecfc..fe02a02 100644
--- a/src/gui/graphicsview/gamescene.cpp
+++ b/src/gui/graphicsview/gamescene.cpp
@@ -224,7 +224,7 @@ void GameScene::updateTerritoryItems()
if (m_showTerritory) {
QPixmap stonePixmap;
int halfCellSize = m_cellSize / 2;
- kDebug() << "Fetching territory from engine ...";
+ //qDebug() << "Fetching territory from engine ...";
stonePixmap = ThemeRenderer::self()->renderElement(ThemeRenderer::WhiteTerritory, QSize(m_cellSize, m_cellSize));
foreach (const Stone &stone, m_game->finalStates(Game::FinalWhiteTerritory)) {
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp
index 794b6ae..52aa5b9 100644
--- a/src/gui/mainwindow.cpp
+++ b/src/gui/mainwindow.cpp
@@ -30,7 +30,7 @@
#include "gui/widgets/setupwidget.h"
#include "preferences.h"
-#include <KAction>
+#include <QAction>
#include <KActionCollection>
#include <KConfigDialog>
#include <KFileDialog>
@@ -38,7 +38,8 @@
#include <KStandardDirs>
#include <KStandardGameAction>
#include <KToggleAction>
-
+#include <KUrl>
+#include <KIcon>
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgamethemeselector.h>
@@ -324,7 +325,7 @@ void MainWindow::showPreferences()
KConfigDialog *dialog = new KConfigDialog(this, "settings", Preferences::self());
dialog->addPage(new GeneralConfig(), i18n("General"), "preferences-other");
dialog->addPage(new KGameThemeSelector(dialog, Preferences::self(), KGameThemeSelector::NewStuffDisableDownload), i18n("Themes"), "games-config-theme");
- dialog->setHelp(QString(), "Kigo");
+ //QT5 dialog->setHelp(QString(), "Kigo");
connect(dialog, SIGNAL(settingsChanged(QString)), this, SLOT(applyPreferences()));
dialog->show();
}
@@ -402,7 +403,7 @@ void MainWindow::setupActions()
// Game menu
m_newGameAction = KStandardGameAction::gameNew(this, SLOT(newGame()), actionCollection());
m_loadGameAction = KStandardGameAction::load(this, SLOT(loadGame()), actionCollection());
- m_getMoreGamesAction = new KAction(KIcon( QLatin1String( "get-hot-new-stuff") ), i18nc("@action", "Get More Games..." ), this);
+ m_getMoreGamesAction = new QAction(KIcon( QLatin1String( "get-hot-new-stuff") ), i18nc("@action", "Get More Games..." ), this);
m_getMoreGamesAction->setShortcut(Qt::CTRL + Qt::Key_G);
m_getMoreGamesAction->setToolTip(i18nc("@action", "Get More Games..."));
connect(m_getMoreGamesAction, SIGNAL(triggered(bool)), this, SLOT(getMoreGames()));
@@ -410,13 +411,13 @@ void MainWindow::setupActions()
m_saveAction = KStandardGameAction::save(this, SLOT(saveGame()), actionCollection());
KStandardGameAction::quit(this, SLOT(close()), actionCollection());
- m_startGameAction = new KAction(KIcon( QLatin1String( "media-playback-start") ), i18nc("@action", "Start Game" ), this);
+ m_startGameAction = new QAction(KIcon( QLatin1String( "media-playback-start") ), i18nc("@action", "Start Game" ), this);
m_startGameAction->setShortcut(Qt::Key_S);
m_startGameAction->setToolTip(i18nc("@action", "Start Game"));
connect(m_startGameAction, SIGNAL(triggered(bool)), this, SLOT(startGame()));
actionCollection()->addAction( QLatin1String( "game_start" ), m_startGameAction);
- m_finishGameAction = new KAction(KIcon( QLatin1String( "media-playback-stop") ), i18nc("@action", "Finish Game" ), this);
+ m_finishGameAction = new QAction(KIcon( QLatin1String( "media-playback-stop") ), i18nc("@action", "Finish Game" ), this);
m_finishGameAction->setShortcut(Qt::Key_F);
m_finishGameAction->setToolTip(i18nc("@action", "Finish Game"));
connect(m_finishGameAction, SIGNAL(triggered(bool)), this, SLOT(finishGame()));
diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h
index d301502..3f7ef6d 100644
--- a/src/gui/mainwindow.h
+++ b/src/gui/mainwindow.h
@@ -23,7 +23,7 @@
#include <KXmlGuiWindow>
-class KAction;
+class QAction;
class KToggleAction;
class QDockWidget;
class QUndoView;
@@ -89,16 +89,16 @@ private:
QDockWidget *m_movesDock; ///< Move history dock widget
QDockWidget *m_errorDock; ///< Dock shown when errors occur
- KAction *m_newGameAction;
- KAction *m_loadGameAction;
- KAction *m_getMoreGamesAction;
- KAction *m_saveAction; ///< Action to save the current game
- KAction *m_undoMoveAction; ///< Action to jump to the last move
- KAction *m_redoMoveAction; ///< Action to jump to the next move
- KAction *m_passMoveAction; ///< Action to pass current move
- KAction *m_hintAction;
- KAction *m_startGameAction;
- KAction *m_finishGameAction;
+ QAction *m_newGameAction;
+ QAction *m_loadGameAction;
+ QAction *m_getMoreGamesAction;
+ QAction *m_saveAction; ///< Action to save the current game
+ QAction *m_undoMoveAction; ///< Action to jump to the last move
+ QAction *m_redoMoveAction; ///< Action to jump to the next move
+ QAction *m_passMoveAction; ///< Action to pass current move
+ QAction *m_hintAction;
+ QAction *m_startGameAction;
+ QAction *m_finishGameAction;
KToggleAction *m_moveNumbersAction;
};
diff --git a/src/gui/widgets/gamewidget.cpp b/src/gui/widgets/gamewidget.cpp
index b95eb1c..9222d6b 100644
--- a/src/gui/widgets/gamewidget.cpp
+++ b/src/gui/widgets/gamewidget.cpp
@@ -26,7 +26,7 @@
#include "gui/graphicsview/themerenderer.h"
#include <KDebug>
-
+#include <KIcon>
namespace Kigo {
GameWidget::GameWidget(Game *game, QWidget *parent)
diff --git a/src/gui/widgets/setupwidget.cpp b/src/gui/widgets/setupwidget.cpp
index 77b1d8c..d2ce58d 100644
--- a/src/gui/widgets/setupwidget.cpp
+++ b/src/gui/widgets/setupwidget.cpp
@@ -24,7 +24,7 @@
#include "gui/graphicsview/themerenderer.h"
#include <QFile>
-
+#include <KIcon>
namespace Kigo {
SetupWidget::SetupWidget(Game *game, QWidget *parent)
diff --git a/src/main.cpp b/src/main.cpp
index afe4098..ac686da 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,7 +20,7 @@
#include "gui/mainwindow.h"
-#include <KAboutData>
+#include <K4AboutData>
#include <KCmdLineArgs>
#include <KLocale>
#include <KApplication>
@@ -38,8 +38,8 @@ namespace Kigo { /* This is only a Doxygen stub */ }
*/
int main(int argc, char *argv[])
{
- KAboutData aboutData("kigo", 0, ki18n("Kigo"), "0.5.6",
- ki18n("KDE Go Board Game"), KAboutData::License_GPL_V2,
+ K4AboutData aboutData("kigo", 0, ki18n("Kigo"), "0.5.6",
+ ki18n("KDE Go Board Game"), K4AboutData::License_GPL_V2,
ki18n("Copyright (c) 2008-2010 Sascha Peilicke"));
aboutData.addAuthor(ki18n("Sascha Peilicke (saschpe)"), ki18n("Original author"),
"[email protected]", "http://saschpe.wordpress.com");
@@ -58,7 +58,6 @@ int main(int argc, char *argv[])
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
- KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
if (app.isSessionRestored()) {
RESTORE(Kigo::MainWindow)