Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Games
KGoldrunner
Commits
7e0d4839
Commit
7e0d4839
authored
Dec 05, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it compile
parent
c36cad3d
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
77 additions
and
46 deletions
+77
-46
CMakeLists.txt
CMakeLists.txt
+38
-10
doc/CMakeLists.txt
doc/CMakeLists.txt
+1
-1
src/CMakeLists.txt
src/CMakeLists.txt
+5
-5
src/hi128-apps-kgoldrunner.png
src/hi128-apps-kgoldrunner.png
+0
-0
src/hi16-apps-kgoldrunner.png
src/hi16-apps-kgoldrunner.png
+0
-0
src/hi22-apps-kgoldrunner.png
src/hi22-apps-kgoldrunner.png
+0
-0
src/hi32-apps-kgoldrunner.png
src/hi32-apps-kgoldrunner.png
+0
-0
src/hi48-apps-kgoldrunner.png
src/hi48-apps-kgoldrunner.png
+0
-0
src/hi64-apps-kgoldrunner.png
src/hi64-apps-kgoldrunner.png
+0
-0
src/kgoldrunner.cpp
src/kgoldrunner.cpp
+16
-13
src/kgoldrunner.h
src/kgoldrunner.h
+10
-10
src/kgrgame.cpp
src/kgrgame.cpp
+1
-1
src/kgrselector.cpp
src/kgrselector.cpp
+1
-1
src/main.cpp
src/main.cpp
+5
-5
No files found.
CMakeLists.txt
View file @
7e0d4839
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
)
...
...
doc/CMakeLists.txt
View file @
7e0d4839
########### install files ###############
#
kd
e4
_create_handbook
(
index.docbook INSTALL_DESTINATION
${
HTML_INSTALL_DIR
}
/en SUBDIR kgoldrunner
)
kd
octools
_create_handbook
(
index.docbook INSTALL_DESTINATION
${
HTML_INSTALL_DIR
}
/en SUBDIR kgoldrunner
)
src/CMakeLists.txt
View file @
7e0d4839
...
...
@@ -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*-app
s
-kgoldrunner.png"
)
add_executable
(
kgoldrunner
${
kgoldrunner_SRCS
}
)
target_link_libraries
(
kgoldrunner
${
KDE4_KDEUI_LIBS
}
kdegames kdeg
ames
p
rivate
)
target_link_libraries
(
kgoldrunner
KF5KDEGames KF5KDEG
ames
P
rivate
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
}
)
src/hi128-app-kgoldrunner.png
→
src/hi128-app
s
-kgoldrunner.png
View file @
7e0d4839
File moved
src/hi16-app-kgoldrunner.png
→
src/hi16-app
s
-kgoldrunner.png
View file @
7e0d4839
File moved
src/hi22-app-kgoldrunner.png
→
src/hi22-app
s
-kgoldrunner.png
View file @
7e0d4839
File moved
src/hi32-app-kgoldrunner.png
→
src/hi32-app
s
-kgoldrunner.png
View file @
7e0d4839
File moved
src/hi48-app-kgoldrunner.png
→
src/hi48-app
s
-kgoldrunner.png
View file @
7e0d4839
File moved
src/hi64-app-kgoldrunner.png
→
src/hi64-app
s
-kgoldrunner.png
View file @
7e0d4839
File moved
src/kgoldrunner.cpp
View file @
7e0d4839
...
...
@@ -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 <
ka
ction
.h
>
#include <
QA
ction>
#include <kactioncollection.h>
#include <ktoggleaction.h>
#include <ktogglefullscreenaction.h>
...
...
@@ -202,7 +203,7 @@ void KGoldrunner::setupActions()
// Load Saved Game...
// --------------------------
K
Action
*
a
=
KStandardGameAction
::
gameNew
(
gameMapper
,
SLOT
(
map
()),
this
);
Q
Action
*
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
);
//
K
Action * myPause gets
K
Action::shortcut(), returning 1 OR 2 shortcuts.
#if 0 //QT5
//
Q
Action * myPause gets
Q
Action::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...
// --------------------------
K
Action
*
ed
=
editAction
(
"create_level"
,
CREATE_LEVEL
,
Q
Action
*
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
);
}
K
Action
*
KGoldrunner
::
gameAction
(
const
QString
&
name
,
Q
Action
*
KGoldrunner
::
gameAction
(
const
QString
&
name
,
const
int
code
,
const
QString
&
text
,
const
QString
&
toolTip
,
const
QString
&
whatsThis
,
const
QKeySequence
&
key
)
{
K
Action
*
ga
=
actionCollection
()
->
addAction
(
name
);
Q
Action
*
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
;
}
K
Action
*
KGoldrunner
::
editAction
(
const
QString
&
name
,
Q
Action
*
KGoldrunner
::
editAction
(
const
QString
&
name
,
const
int
code
,
const
QString
&
text
,
const
QString
&
toolTip
,
const
QString
&
whatsThis
)
{
K
Action
*
ed
=
actionCollection
()
->
addAction
(
name
);
Q
Action
*
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
)
{
K
Action
*
a
=
actionCollection
()
->
addAction
(
name
);
Q
Action
*
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
)
{
((
K
Action
*
)
ACTION
(
actionName
))
->
setEnabled
(
onOff
);
((
Q
Action
*
)
ACTION
(
actionName
))
->
setEnabled
(
onOff
);
}
void
KGoldrunner
::
setEditMenu
(
bool
on_off
)
...
...
@@ -946,7 +949,7 @@ void KGoldrunner::setupEditToolbarActions()
game
,
SLOT
(
editToolbarActions
(
int
)));
tempMapper
=
editToolbarMapper
;
K
Action
*
ed
=
editAction
(
"edit_hint"
,
EDIT_HINT
,
Q
Action
*
ed
=
editAction
(
"edit_hint"
,
EDIT_HINT
,
i18n
(
"Edit Name/Hint"
),
i18n
(
"Edit level name or hint"
),
i18n
(
"Edit text for the name or hint "
...
...
src/kgoldrunner.h
View file @
7e0d4839
...
...
@@ -25,7 +25,7 @@
#include <KXmlGuiWindow>
class
QSignalMapper
;
class
K
Action
;
class
Q
Action
;
class
KToggleAction
;
class
KGrGame
;
...
...
@@ -111,11 +111,11 @@ private:
QSignalMapper
*
tempMapper
;
// Temporary pointer.
K
Action
*
gameAction
(
const
QString
&
name
,
const
int
code
,
Q
Action
*
gameAction
(
const
QString
&
name
,
const
int
code
,
const
QString
&
text
,
const
QString
&
toolTip
,
const
QString
&
whatsThis
,
const
QKeySequence
&
key
);
K
Action
*
editAction
(
const
QString
&
name
,
const
int
code
,
Q
Action
*
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.
K
Action
*
saveGame
;
// Save game, level, lives and score.
Q
Action
*
saveGame
;
// Save game, level, lives and score.
// A
K
Action is needed here, to get access to KShortcut::setAlternate().
K
Action
*
myPause
;
// Pause or resume the game.
// A
Q
Action is needed here, to get access to KShortcut::setAlternate().
Q
Action
*
myPause
;
// Pause or resume the game.
K
Action
*
hintAction
;
// Display a hint, if available.
K
Action
*
killHero
;
// Kill hero (disabled during edits).
K
Action
*
highScore
;
// High scores (disabled during edits).
Q
Action
*
hintAction
;
// Display a hint, if available.
Q
Action
*
killHero
;
// Kill hero (disabled during edits).
Q
Action
*
highScore
;
// High scores (disabled during edits).
K
Action
*
saveEdits
;
// Save a level that has been edited.
Q
Action
*
saveEdits
;
// Save a level that has been edited.
KToolBar
*
editToolbar
;
// Toolbar for creating/editing levels.
};
...
...
src/kgrgame.cpp
View file @
7e0d4839
...
...
@@ -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>
...
...
src/kgrselector.cpp
View file @
7e0d4839
...
...
@@ -39,7 +39,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <KGlobal>
#include <KGlobalSettings>
#include <KConfigGroup>
#include <KIntNumInput>
...
...
src/main.cpp
View file @
7e0d4839
...
...
@@ -19,7 +19,7 @@
#include <QDebug>
#include <kapplication.h>
#include <
ka
bout
d
ata
.h
>
#include <
K4A
bout
D
ata>
#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
(
K
4
AboutData
&
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"
),
K
4
AboutData
about
(
"kgoldrunner"
,
0
,
ki18n
(
"KGoldrunner"
),
version
,
ki18n
(
description
),
KAboutData
::
License_GPL
,
K
4
AboutData
::
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
(
K
4
AboutData
&
about
)
{
about
.
addAuthor
(
ki18n
(
"Ian Wadham"
),
ki18n
(
"Current author"
),
"iandw.au@gmail.com"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment