Commit 7e0d4839 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile

parent c36cad3d
project(kgoldrunner)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames 4.9.0 REQUIRED)
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)
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="kgoldrunner")
add_subdirectory( src )
add_subdirectory( gamedata )
......
########### install files ###############
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kgoldrunner)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kgoldrunner)
......@@ -21,16 +21,16 @@ set(kgoldrunner_SRCS
kgrsounds.cpp
kgrdialog.cpp )
kde4_add_app_icon(kgoldrunner_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-app-kgoldrunner.png")
kde4_add_executable(kgoldrunner ${kgoldrunner_SRCS})
kde4_add_app_icon(kgoldrunner_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-apps-kgoldrunner.png")
add_executable(kgoldrunner ${kgoldrunner_SRCS})
target_link_libraries(kgoldrunner ${KDE4_KDEUI_LIBS} kdegames kdegamesprivate)
target_link_libraries(kgoldrunner KF5KDEGames KF5KDEGamesPrivate KF5::KDELibs4Support)
install(TARGETS kgoldrunner ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### install files ###############
install( PROGRAMS KGoldrunner.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES kgoldrunnerui.rc DESTINATION ${DATA_INSTALL_DIR}/kgoldrunner )
install( FILES kgoldrunnerui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kgoldrunner )
kde4_install_icons( ${ICON_INSTALL_DIR} )
ecm_install_icons( ICONS hi128-apps-kgoldrunner.png hi16-apps-kgoldrunner.png hi22-apps-kgoldrunner.png hi32-apps-kgoldrunner.png hi48-apps-kgoldrunner.png hi64-apps-kgoldrunner.png DESTINATION ${ICON_INSTALL_DIR} )
......@@ -26,6 +26,7 @@
#include <QKeySequence>
#include <QKeyEvent>
#include <KShortcut>
#include <kglobal.h>
#include <kshortcutsdialog.h>
#include <KStandardDirs>
......@@ -39,7 +40,7 @@
#include <ktoolbar.h>
#include <kmenubar.h>
#include <kaction.h>
#include <QAction>
#include <kactioncollection.h>
#include <ktoggleaction.h>
#include <ktogglefullscreenaction.h>
......@@ -202,7 +203,7 @@ void KGoldrunner::setupActions()
// Load Saved Game...
// --------------------------
KAction * a = KStandardGameAction::gameNew (gameMapper, SLOT(map()), this);
QAction * a = KStandardGameAction::gameNew (gameMapper, SLOT(map()), this);
actionCollection()->addAction (a->objectName(), a);
gameMapper->setMapping (a, NEW);
a->setText (i18n ("&New Game..."));
......@@ -238,12 +239,12 @@ void KGoldrunner::setupActions()
myPause = KStandardGameAction::pause (gameMapper, SLOT(map()), this);
actionCollection()->addAction (myPause->objectName(), myPause);
gameMapper->setMapping (myPause, PAUSE);
// KAction * myPause gets KAction::shortcut(), returning 1 OR 2 shortcuts.
#if 0 //QT5
// QAction * myPause gets QAction::shortcut(), returning 1 OR 2 shortcuts.
KShortcut pauseShortcut = myPause->shortcut();
pauseShortcut.setAlternate (Qt::Key_Escape); // Add "Esc" shortcut.
myPause->setShortcut (pauseShortcut);
#endif
highScore = KStandardGameAction::highscores (gameMapper, SLOT(map()), this);
actionCollection()->addAction (highScore->objectName(), highScore);
gameMapper->setMapping (highScore, HIGH_SCORE);
......@@ -310,7 +311,7 @@ void KGoldrunner::setupActions()
// Edit a Level...
// --------------------------
KAction * ed = editAction ("create_level", CREATE_LEVEL,
QAction * ed = editAction ("create_level", CREATE_LEVEL,
i18n ("&Create Level"),
i18n ("Create level."),
i18n ("Create a completely new level."));
......@@ -579,14 +580,14 @@ void KGoldrunner::setupActions()
keyControl ("show_enemy_6", i18n ("Show Enemy") + '6', Qt::Key_6, ENEMY_6);
}
KAction * KGoldrunner::gameAction (const QString & name,
QAction * KGoldrunner::gameAction (const QString & name,
const int code,
const QString & text,
const QString & toolTip,
const QString & whatsThis,
const QKeySequence & key)
{
KAction * ga = actionCollection()->addAction (name);
QAction * ga = actionCollection()->addAction (name);
ga->setText (text);
ga->setToolTip (toolTip);
ga->setWhatsThis (whatsThis);
......@@ -598,13 +599,13 @@ KAction * KGoldrunner::gameAction (const QString & name,
return ga;
}
KAction * KGoldrunner::editAction (const QString & name,
QAction * KGoldrunner::editAction (const QString & name,
const int code,
const QString & text,
const QString & toolTip,
const QString & whatsThis)
{
KAction * ed = actionCollection()->addAction (name);
QAction * ed = actionCollection()->addAction (name);
ed->setText (text);
ed->setToolTip (toolTip);
ed->setWhatsThis (whatsThis);
......@@ -650,7 +651,7 @@ void KGoldrunner::keyControl (const QString & name, const QString & text,
const QKeySequence & shortcut, const int code,
const bool mover)
{
KAction * a = actionCollection()->addAction (name);
QAction * a = actionCollection()->addAction (name);
a->setText (text);
a->setShortcut (shortcut);
......@@ -720,9 +721,11 @@ void KGoldrunner::gameFreeze (bool on_off)
myPause->setChecked (on_off);
frozen = on_off; // Remember the state (for the configure-keys case).
QStringList pauseKeys;
#if 0 //QT5
foreach (const QKeySequence &s, myPause->shortcut().toList()) {
pauseKeys.append(s.toString(QKeySequence::NativeText));
}
#endif
QString msg;
if (on_off) {
if (pauseKeys.size() == 0) {
......@@ -762,7 +765,7 @@ void KGoldrunner::setToggle (const char * actionName, const bool onOff)
void KGoldrunner::setAvail (const char * actionName, const bool onOff)
{
((KAction *) ACTION (actionName))->setEnabled (onOff);
((QAction *) ACTION (actionName))->setEnabled (onOff);
}
void KGoldrunner::setEditMenu (bool on_off)
......@@ -946,7 +949,7 @@ void KGoldrunner::setupEditToolbarActions()
game, SLOT (editToolbarActions(int)));
tempMapper = editToolbarMapper;
KAction * ed = editAction ("edit_hint", EDIT_HINT,
QAction * ed = editAction ("edit_hint", EDIT_HINT,
i18n ("Edit Name/Hint"),
i18n ("Edit level name or hint"),
i18n ("Edit text for the name or hint "
......
......@@ -25,7 +25,7 @@
#include <KXmlGuiWindow>
class QSignalMapper;
class KAction;
class QAction;
class KToggleAction;
class KGrGame;
......@@ -111,11 +111,11 @@ private:
QSignalMapper * tempMapper; // Temporary pointer.
KAction * gameAction (const QString & name, const int code,
QAction * gameAction (const QString & name, const int code,
const QString & text, const QString & toolTip,
const QString & whatsThis, const QKeySequence & key);
KAction * editAction (const QString & name, const int code,
QAction * editAction (const QString & name, const int code,
const QString & text, const QString & toolTip,
const QString & whatsThis);
......@@ -149,16 +149,16 @@ private:
QString systemDataDir; // Where the system levels are stored.
QString userDataDir; // Where the user levels are stored.
KAction * saveGame; // Save game, level, lives and score.
QAction * saveGame; // Save game, level, lives and score.
// A KAction is needed here, to get access to KShortcut::setAlternate().
KAction * myPause; // Pause or resume the game.
// A QAction is needed here, to get access to KShortcut::setAlternate().
QAction * myPause; // Pause or resume the game.
KAction * hintAction; // Display a hint, if available.
KAction * killHero; // Kill hero (disabled during edits).
KAction * highScore; // High scores (disabled during edits).
QAction * hintAction; // Display a hint, if available.
QAction * killHero; // Kill hero (disabled during edits).
QAction * highScore; // High scores (disabled during edits).
KAction * saveEdits; // Save a level that has been edited.
QAction * saveEdits; // Save a level that has been edited.
KToolBar * editToolbar; // Toolbar for creating/editing levels.
};
......
......@@ -24,7 +24,7 @@
#include "kgrview.h"
#include "kgrscene.h"
#include "kgrselector.h"
#include <KGlobal>
// KGoldrunner loads and plays .ogg files and requires OpenAL + SndFile > v0.21.
// Fallback to Phonon by the KgSound library does not give good results.
#include <libkdegames_capabilities.h>
......
......@@ -39,7 +39,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <KGlobal>
#include <KGlobalSettings>
#include <KConfigGroup>
#include <KIntNumInput>
......
......@@ -19,7 +19,7 @@
#include <QDebug>
#include <kapplication.h>
#include <kaboutdata.h>
#include <K4AboutData>
#include <kcmdlineargs.h>
#include <klocale.h>
#include "kgoldrunner.h"
......@@ -31,7 +31,7 @@ static const char description[] =
static const char version[] = "4.10";
static bool gameDataOK();
static void addCredits (KAboutData & about);
static void addCredits (K4AboutData & about);
int main (int argc, char **argv)
{
......@@ -41,9 +41,9 @@ int main (int argc, char **argv)
return 2;
}
KAboutData about ("kgoldrunner", 0, ki18n ("KGoldrunner"),
K4AboutData about ("kgoldrunner", 0, ki18n ("KGoldrunner"),
version, ki18n (description),
KAboutData::License_GPL,
K4AboutData::License_GPL,
ki18n ("(C) 2003 Ian Wadham and Marco Krüger"),
KLocalizedString(), "http://games.kde.org/kgoldrunner" );
addCredits (about);
......@@ -67,7 +67,7 @@ int main (int argc, char **argv)
return app.exec();
}
void addCredits (KAboutData & about)
void addCredits (K4AboutData & about)
{
about.addAuthor (ki18n ("Ian Wadham"), ki18n ("Current author"),
"iandw.au@gmail.com");
......
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