Commit 46727cc3 authored by Laurent Montel's avatar Laurent Montel 😁

MAke it compile

parent e03a1595
project(ktron)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames 4.9.0 REQUIRED)
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)
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_directories(BEFORE ${PHONON_INCLUDES})
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="ktron")
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)
add_subdirectory(pics)
add_subdirectory(themes)
......@@ -30,15 +59,15 @@ set(ktron_SRCS
ktron.cpp
main.cpp)
kde4_add_ui_files(ktron_SRCS general.ui)
ki18n_wrap_ui(ktron_SRCS general.ui)
kde4_add_kcfg_files(ktron_SRCS settings.kcfgc)
kconfig_add_kcfg_files(ktron_SRCS settings.kcfgc)
kde4_add_app_icon(ktron_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/hi*-app-ktron.png")
kde4_add_executable(ktron ${ktron_SRCS})
add_executable(ktron ${ktron_SRCS})
target_link_libraries(ktron kdegames kdegamesprivate ${KDE4_KDEUI_LIBS} ${KDE4_KNOTIFYCONFIG_LIBS})
target_link_libraries(ktron KF5KDEGames KF5KDEGamesPrivate KF5::NotifyConfig KF5::KDELibs4Support Qt5::Svg)
install(TARGETS ktron ${INSTALL_TARGETS_DEFAULT_ARGS})
......
########### install files ###############
#
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR ktron)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR ktron)
......@@ -29,7 +29,7 @@
#include <KConfigDialog>
#include <KLocale>
#include <KMessageBox>
#include <KAction>
#include <QAction>
#include <KActionCollection>
#include <KStandardGameAction>
#include <KScoreDialog>
......@@ -65,8 +65,8 @@ KTron::KTron(QWidget *parent) : KXmlGuiWindow(parent, KDE_DEFAULT_WINDOWFLAGS) {
setCentralWidget(m_tron);
// create statusbar
statusBar()->insertItem(QLatin1String( "abcdefghijklmnopqrst: 0 " ),ID_STATUS_BASE + 1);
statusBar()->insertItem(QLatin1String( "abcdefghijklmnopqrst: 0 " ),ID_STATUS_BASE + 2);
//QT5 statusBar()->insertItem(QLatin1String( "abcdefghijklmnopqrst: 0 " ),ID_STATUS_BASE + 1);
//QT5 statusBar()->insertItem(QLatin1String( "abcdefghijklmnopqrst: 0 " ),ID_STATUS_BASE + 2);
// We match up keyboard events ourselves in Tron::keyPressEvent()
// We must disable the actions, otherwise we don't get the keyPressEvent's
......@@ -199,8 +199,8 @@ void KTron::updateStatusbar() {
if (Settings::gameType() == Settings::EnumGameType::Snake)
{
QString string = QString::fromLatin1( "%1: %2").arg(m_tron->getPlayer(0)->getName()).arg(m_tron->getPlayer(0)->getScore());
statusBar()->changeItem(string, ID_STATUS_BASE + 1);
statusBar()->changeItem(QString(), ID_STATUS_BASE + 2);
//QT5 statusBar()->changeItem(string, ID_STATUS_BASE + 1);
//QT5 statusBar()->changeItem(QString(), ID_STATUS_BASE + 2);
}
else
{
......@@ -209,7 +209,7 @@ void KTron::updateStatusbar() {
int score = m_tron->getPlayer(1 - i)->getScore();
QString string = QString::fromLatin1( "%1: %2").arg(name).arg(score);
statusBar()->changeItem(string, ID_STATUS_BASE + i + 1);
//QT5 statusBar()->changeItem(string, ID_STATUS_BASE + i + 1);
}
}
}
......
......@@ -24,7 +24,7 @@
#ifndef KTRON_H
#define KTRON_H
#include <KAction>
#include <QAction>
#include <KXmlGuiWindow>
#include <QKeyEvent>
......@@ -83,17 +83,17 @@ class KTron : public KXmlGuiWindow {
private:
Tron *m_tron;
KAction *m_player0Up;
KAction *m_player0Down;
KAction *m_player0Left;
KAction *m_player0Right;
KAction *m_player0Accelerate;
KAction *m_player1Up;
KAction *m_player1Down;
KAction *m_player1Left;
KAction *m_player1Right;
KAction *m_player1Accelerate;
KAction *m_pauseButton;
QAction *m_player0Up;
QAction *m_player0Down;
QAction *m_player0Left;
QAction *m_player0Right;
QAction *m_player0Accelerate;
QAction *m_player1Up;
QAction *m_player1Down;
QAction *m_player1Left;
QAction *m_player1Right;
QAction *m_player1Accelerate;
QAction *m_pauseButton;
General *m_generalConfigDialog;
};
......
......@@ -22,7 +22,7 @@
*******************************************************************************/
#include <KApplication>
#include <KCmdLineArgs>
#include <KAboutData>
#include <K4AboutData>
#include <KStandardDirs>
#include "ktron.h"
......@@ -41,8 +41,8 @@ static KLocalizedString notice = ki18n("(c) 1998-2000, Matthias Kiefer\n"
int main(int argc, char* argv[])
{
KAboutData aboutData( "ktron", 0, ki18n("KSnakeDuel"),
KTRON_VERSION, description, KAboutData::License_GPL, notice);
K4AboutData aboutData( "ktron", 0, ki18n("KSnakeDuel"),
KTRON_VERSION, description, K4AboutData::License_GPL, notice);
aboutData.addAuthor(ki18n("Matthias Kiefer"), ki18n("Original author"), "matthias.kiefer@gmx.de");
aboutData.addAuthor(ki18n("Benjamin Meyer"), ki18n("Various improvements"), "ben+ktron@meyerhome.net");
aboutData.addAuthor(ki18n("Stas Verberkt"), ki18n("KDE 4 Port, interface revision and KSnake mode"), "legolas@legolasweb.nl");
......@@ -54,7 +54,6 @@ int main(int argc, char* argv[])
KCmdLineArgs::addCmdLineOptions(options);
KApplication a;
KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
KStandardDirs::locateLocal("appdata", QLatin1String( "themes/" ));
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
......
kde4_install_icons(${ICON_INSTALL_DIR})
ecm_install_icons(${ICON_INSTALL_DIR})
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