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

Port++

parent 1162ac3b
project(ksudoku)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames 4.9.0 REQUIRED)
macro_optional_find_package(OpenGL)
macro_log_feature(OPENGL_FOUND "OpenGL" "API for developing portable, interactive 2D and 3Dgraphics applications" "http://mesa3d.sourceforge.net" FALSE "" "Kubrick will not be built and KSudoku will not have Roxdoku support without OpenGL.")
macro_log_feature(QT_QTOPENGL_FOUND "QtOpenGL" "Qt module that make it easy to use OpenGL in Qt apps" "http://doc.trolltech.com/latest/qtopengl.html" FALSE "" "Kubrick will not be built and KSudoku will not have Roxdoku support without QtOpenGL.")
macro_display_feature_log()
if(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
set(OPENGL_SUPPORT true)
endif(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
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)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.3.0")
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 OpenGL)
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(OpenGL)
set_package_properties(OpenGL PROPERTIES DESCRIPTION "API for developing portable, interactive 2D and 3Dgraphics applications" TYPE REQUIRED PURPOSE "Kubrick will not be built and KSudoku will not have Roxdoku support without OpenGL.")
include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
if (OPENGL_FOUND)
set(OPENGL_SUPPORT true)
endif()
##options
#OPTION(DEBUG
......
......@@ -23,17 +23,17 @@ set(ksudoku_SRCS
)
kde4_add_app_icon(ksudoku_SRCS "${KDE4_ICON_INSTALL_DIR}/oxygen/*/apps/ksudoku.png")
kde4_add_executable(ksudoku ${ksudoku_SRCS})
add_executable(ksudoku ${ksudoku_SRCS})
target_link_libraries(ksudoku
ksudoku_gui ksudoku_logic
kdegames kdegamesprivate
${KDE4_KIO_LIBS}
KF5KDEGames kdegamesprivate
KF5::KIOCore
)
if(OPENGL_SUPPORT)
target_link_libraries(ksudoku
${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES} ${CMAKE_DL_LIBS}
Qt5::OpenGL ${OPENGL_LIBRARIES} ${CMAKE_DL_LIBS}
)
endif(OPENGL_SUPPORT)
......@@ -66,6 +66,6 @@ install( PROGRAMS gui/ksudoku.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES gui/ksudokuui.rc DESTINATION ${DATA_INSTALL_DIR}/ksudoku )
install( FILES ksudokurc DESTINATION ${CONFIG_INSTALL_DIR})
kde4_install_icons(${ICON_INSTALL_DIR})
ecm_install_icons(${ICON_INSTALL_DIR})
......@@ -26,26 +26,26 @@ if(OPENGL_SUPPORT)
endif(OPENGL_SUPPORT)
kde4_add_ui_files(ksudoku_SRCS welcomescreen.ui configgame.ui)
ki18n_wrap_ui(ksudoku_SRCS welcomescreen.ui configgame.ui)
kde4_add_kcfg_files(ksudoku_SRCS settings.kcfgc )
kconfig_add_kcfg_files(ksudoku_SRCS settings.kcfgc )
kde4_add_library(ksudoku_gui STATIC ${ksudoku_SRCS} ${ksudoku_views_SRCS})
add_library(ksudoku_gui STATIC ${ksudoku_SRCS} ${ksudoku_views_SRCS})
target_link_libraries(ksudoku_gui
ksudoku_logic
kdegames
${KDE4_KDEUI_LIBS}
${KDE4_KDECORE_LIBS}
${KDE4_KIO_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
KF5KDEGames
KF5::Archive
KF5::KDELibs4Support
KF5::KIOCore
Qt5::Core
Qt5::Gui
)
if(OPENGL_SUPPORT)
target_link_libraries(ksudoku_gui
${OPENGL_LIBRARIES}
${QT_QTOPENGL_LIBRARY})
Qt5::OpenGL)
endif(OPENGL_SUPPORT)
......@@ -55,7 +55,7 @@ set(ksudoku_client_SRCS
ksudoku_client.cpp
)
#kde4_add_executable(ksudoku_client ${ksudoku_client_SRCS})
#add_executable(ksudoku_client ${ksudoku_client_SRCS})
#target_link_libraries(ksudoku_client ${QT_AND_KDECORE_LIBRARIES} kdeui)
......@@ -26,6 +26,7 @@
#include <KLocale>
#include <QPainter>
#include <KIconLoader>
#include <KIcon>
#include <QEvent>
#include "gamevariants.moc"
......
......@@ -42,10 +42,11 @@
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgamethemeselector.h>
#include <KShortcut>
#include <KUrl>
#include <KCmdLineArgs>
#include <KAboutData>
#include <K4AboutData>
#include <KGlobal>
#include <kmessagebox.h>
#include <klocale.h>
#include <kstatusbar.h>
......@@ -391,7 +392,7 @@ void KSudoku::setupActions()
KAction* a = new KAction(this);
actionCollection()->addAction( QLatin1String( "move_dub_puzzle" ), a);
a->setText(i18n("Check"));
a->setIcon(KIcon( QLatin1String( "games-endturn" )));
a->setIcon(QIcon::fromTheme( QLatin1String( "games-endturn" )));
connect(a, SIGNAL(triggered(bool)), SLOT(dubPuzzle()));
addAction(a);
......@@ -399,7 +400,7 @@ void KSudoku::setupActions()
a = new KAction(this);
actionCollection()->addAction( QLatin1String( "home_page" ), a);
a->setText(i18n("Home Page"));
a->setIcon(KIcon( QLatin1String( "internet-web-browser" )));
a->setIcon(QIcon::fromTheme( QLatin1String( "internet-web-browser" )));
connect(a, SIGNAL(triggered(bool)), SLOT(homepage()));
}
......@@ -840,7 +841,7 @@ void KSudoku::optionsPreferences()
dialog->addPage(gameConfig, i18nc("Game Section in Config", "Game"), "games-config-options");
dialog->addPage(new KGameThemeSelector(dialog, Settings::self(), KGameThemeSelector::NewStuffDisableDownload), i18n("Theme"), "games-config-theme");
dialog->setHelp(QString(),"ksudoku");
//QT5 dialog->setHelp(QString(),"ksudoku");
connect(dialog, SIGNAL(settingsChanged(QString)), SLOT(updateSettings()));
dialog->show();
}
......
......@@ -29,7 +29,7 @@
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgamedifficulty.h>
class QPrinter;
class KUrl;
namespace ksudoku {
......
......@@ -20,10 +20,10 @@
#include "gameactions.h"
#include <KLocale>
#include <KAction>
#include <QAction>
#include <KActionCollection>
#include <QSignalMapper>
#include <KShortcut>
namespace ksudoku {
GameActions::GameActions(KActionCollection* collection) {
......@@ -40,17 +40,17 @@ void GameActions::init() {
connect(m_markValueMapper, SIGNAL(mapped(int)), SIGNAL(markValue(int)));
KAction* a;
QAction * a;
KShortcut shortcut;
for(int i = 0; i < 25; ++i) {
a = new KAction(this);
a = new QAction(this);
m_collection->addAction(QString("val-select%1").arg(i+1,2,10,QChar('0')), a);
a->setText(i18n("Select %1 (%2)", QChar('a'+i), i+1));
m_selectValueMapper->setMapping(a, i+1);
connect(a, SIGNAL(triggered(bool)), m_selectValueMapper, SLOT(map()));
m_actions << a;
a = new KAction(this);
a = new QAction(this);
m_collection->addAction(QString("val-enter%1").arg(i+1,2,10,QChar('0')), a);
a->setText(i18n("Enter %1 (%2)", QChar('a'+i), i+1));
shortcut = a->shortcut();
......@@ -63,7 +63,7 @@ void GameActions::init() {
connect(a, SIGNAL(triggered(bool)), m_enterValueMapper, SLOT(map()));
m_actions << a;
a = new KAction(this);
a = new QAction(this);
m_collection->addAction(QString("val-mark%1").arg(i+1,2,10,QChar('0')), a);
a->setText(i18n("Mark %1 (%2)", QChar('a'+i), i+1));
shortcut = a->shortcut();
......@@ -77,35 +77,35 @@ void GameActions::init() {
m_actions << a;
}
a = new KAction(this);
a = new QAction(this);
m_collection->addAction("move_up", a);
a->setText(i18n("Move Up"));
a->setShortcut(Qt::Key_Up);
connect(a, SIGNAL(triggered(bool)), SLOT(moveUp()));
m_actions << a;
a = new KAction(this);
a = new QAction(this);
m_collection->addAction("move_down", a);
a->setText(i18n("Move Down"));
a->setShortcut(Qt::Key_Down);
connect(a, SIGNAL(triggered(bool)), SLOT(moveDown()));
m_actions << a;
a = new KAction(this);
a = new QAction(this);
m_collection->addAction("move_left", a);
a->setText(i18n("Move Left"));
a->setShortcut(Qt::Key_Left);
connect(a, SIGNAL(triggered(bool)), SLOT(moveLeft()));
m_actions << a;
a = new KAction(this);
a = new QAction(this);
m_collection->addAction("move_right", a);
a->setText(i18n("Move Right"));
a->setShortcut(Qt::Key_Right);
connect(a, SIGNAL(triggered(bool)), SLOT(moveRight()));
m_actions << a;
a = new KAction(this);
a = new QAction(this);
m_collection->addAction("move_clear_cell", a);
a->setText(i18n("Clear Cell"));
shortcut = a->shortcut();
......@@ -117,7 +117,7 @@ void GameActions::init() {
}
void GameActions::associateWidget(QWidget* widget) {
QVector<KAction*>::iterator it;
QVector<QAction *>::iterator it;
for(it = m_actions.begin(); it != m_actions.end(); ++it) {
widget->addAction(*it);
}
......
......@@ -23,7 +23,7 @@
#include <QVector>
#include <QObject>
class KAction;
class QAction;
class KActionCollection;
class QSignalMapper;
......@@ -51,7 +51,7 @@ private:
QSignalMapper* m_selectValueMapper;
QSignalMapper* m_enterValueMapper;
QSignalMapper* m_markValueMapper;
QVector<KAction*> m_actions;
QVector<QAction *> m_actions;
};
}
......
......@@ -19,7 +19,8 @@
#include "welcomescreen.h"
#include <KMessageBox>
#include <KConfigGroup>
#include <KGlobal>
#include <QDebug>
#include "ksudokugame.h"
......
......@@ -3,5 +3,5 @@ set(ksudoku_logic_SRCS
puzzle.cpp
)
kde4_add_library(ksudoku_logic STATIC ${ksudoku_logic_SRCS})
target_link_libraries(ksudoku_logic ${QT_QTCORE_LIBRARY})
add_library(ksudoku_logic STATIC ${ksudoku_logic_SRCS})
target_link_libraries(ksudoku_logic Qt5::Core)
......@@ -17,4 +17,4 @@ install( FILES
DESTINATION ${DATA_INSTALL_DIR}/ksudoku
)
kde4_install_icons(${DATA_INSTALL_DIR}/ksudoku/icons)
ecm_install_icons(${DATA_INSTALL_DIR}/ksudoku/icons)
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