Commit a68383e9 authored by Andrius Štikonas's avatar Andrius Štikonas

Merge branch 'frameworks'

parents d332984f ba4fc343
.kdev4/
build/
*.kdev4
project (kubrick) project (kubrick)
if(NOT COMPILING_KDEGAMES) cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
find_package(KDE4 REQUIRED) set (QT_MIN_VERSION "5.7.0")
include(KDE4Defaults) set (KF5_MIN_VERSION "5.23.0")
include(MacroLibrary)
find_package(KDEGames REQUIRED) find_package(ECM 1.7.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(OpenGL REQUIRED)
macro_log_feature(OPENGL_FOUND "OpenGL" "API for developing portable, interactive 2D and 3Dgraphics applications" "http://mesa3d.sourceforge.net" TRUE "" "Kubrick will not be built and KSudoku will not have Roxdoku support without OpenGL.") find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg 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" TRUE "" "Kubrick will not be built and KSudoku will not have Roxdoku support without QtOpenGL.") find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
macro_display_feature_log() Config
ConfigWidgets
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) CoreAddons
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) Crash
include_directories(${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS}) DocTools
endif(NOT COMPILING_KDEGAMES) I18n
KIO
add_subdirectory (src) WidgetsAddons
add_subdirectory (data) XmlGui
add_subdirectory (themes) )
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(OpenGL REQUIRED)
include(FeatureSummary)
include(ECMAddAppIcon)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
add_subdirectory(src)
add_subdirectory(data)
add_subdirectory(themes)
add_subdirectory(doc) add_subdirectory(doc)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
FILE(GLOB datafiles *.kbk) FILE(GLOB datafiles *.kbk)
install( FILES ${datafiles} DESTINATION ${DATA_INSTALL_DIR}/kubrick ) install( FILES ${datafiles} DESTINATION ${KDE_INSTALL_DATADIR}/kubrick )
########### install files ############### ########### install files ###############
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kubrick) kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kubrick)
<?xml version="1.0" ?> <?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [ <!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
<!ENTITY kubrick "<application>Kubrick</application>"> <!ENTITY kubrick "<application>Kubrick</application>">
<!ENTITY kappname "&kubrick;"><!-- Do *not* replace kappname--> <!ENTITY kappname "&kubrick;"><!-- Do *not* replace kappname-->
<!ENTITY package "kdegames"><!-- kdebase, kdeadmin, etc --> <!ENTITY package "kdegames"><!-- kdebase, kdeadmin, etc -->
......
...@@ -4,41 +4,54 @@ ...@@ -4,41 +4,54 @@
include_directories( ${OPENGL_INCLUDE_DIR} ) include_directories( ${OPENGL_INCLUDE_DIR} )
set(kubrick_SRCS set(kubrick_SRCS
main.cpp kubrick_debug.cpp
kubrick.cpp main.cpp
game.cpp kubrick.cpp
cube.cpp game.cpp
movetracker.cpp cube.cpp
quaternion.cpp movetracker.cpp
gamedialog.cpp quaternion.cpp
gameglview.cpp gamedialog.cpp
scenelabel.cpp ) gameglview.cpp
scenelabel.cpp
kde4_add_app_icon(kubrick_SRCS "hi*-app-kubrick.png") )
kde4_add_executable(kubrick ${kubrick_SRCS})
file(GLOB ICONS_SRCS "*-apps-kubrick.png")
ecm_add_app_icon(kubrick_SRCS ICONS ${ICONS_SRCS})
add_executable(kubrick ${kubrick_SRCS})
if(WIN32) if(WIN32)
set(opengl_libs opengl32.lib glu32.lib) set(opengl_libs opengl32.lib glu32.lib)
endif(WIN32) endif(WIN32)
target_link_libraries(kubrick target_link_libraries(kubrick
${QT_QTOPENGL_LIBRARY} Qt5::OpenGL
${KDE4_KDEUI_LIBS} Qt5::Svg
${KDE4_KIO_LIBS} KF5::Crash
kdegames KF5::ConfigCore
${OPENGL_gl_LIBRARY} KF5::KIOCore
${OPENGL_glu_LIBRARY} KF5::XmlGui
KF5KDEGames
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
) )
install(TARGETS kubrick ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS kubrick ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ############### ########### install files ###############
install( FILES kubrickui.rc DESTINATION ${DATA_INSTALL_DIR}/kubrick ) install(FILES kubrickui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kubrick)
install( PROGRAMS org.kde.kubrick.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) install(PROGRAMS org.kde.kubrick.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kubrick.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo/ ) install(FILES org.kde.kubrick.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
kde4_install_icons( ${ICON_INSTALL_DIR} ) ecm_install_icons(ICONS
128-apps-kubrick.png
16-apps-kubrick.png
22-apps-kubrick.png
32-apps-kubrick.png
48-apps-kubrick.png
64-apps-kubrick.png
DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor
)
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include "cube.h" #include "cube.h"
// The RubikCube object uses the sqrt() function. // The RubikCube object uses the sqrt() function.
#include <math.h> #include <cmath>
#include <stdlib.h> #include <cstdlib>
// Local includes // Local includes
#include "gameglview.h" #include "gameglview.h"
...@@ -76,7 +76,7 @@ void Cube::moveSlice (Axis axis, int location, Rotation direction) ...@@ -76,7 +76,7 @@ void Cube::moveSlice (Axis axis, int location, Rotation direction)
} }
// Rotate all cubies that are in the required slice. // Rotate all cubies that are in the required slice.
foreach (Cubie * cubie, cubies) { for (Cubie * cubie : qAsConst(cubies)) {
cubie->rotate (axis, location, direction); cubie->rotate (axis, location, direction);
} }
setBlinkingOff (); setBlinkingOff ();
...@@ -93,7 +93,7 @@ void Cube::addStickers () ...@@ -93,7 +93,7 @@ void Cube::addStickers ()
int location = sign * sizes [n]; int location = sign * sizes [n];
color++; // FaceColor enum 1 --> 6. color++; // FaceColor enum 1 --> 6.
foreach (Cubie * cubie, cubies) { for (Cubie * cubie : qAsConst(cubies)) {
cubie->addSticker ((FaceColor) color, (Axis) n, location, sign); cubie->addSticker ((FaceColor) color, (Axis) n, location, sign);
} }
} }
...@@ -104,7 +104,7 @@ void Cube::addStickers () ...@@ -104,7 +104,7 @@ void Cube::addStickers ()
void Cube::drawCube (GameGLView * gameGLView, float cubieSize) void Cube::drawCube (GameGLView * gameGLView, float cubieSize)
{ {
// For each cubie in the cube ... // For each cubie in the cube ...
foreach (Cubie * cubie, cubies) { for (Cubie * cubie : qAsConst(cubies)) {
if (cubie->hasNoStickers()) { if (cubie->hasNoStickers()) {
// This cubie is deep inside the cube: save time by not drawing it. // This cubie is deep inside the cube: save time by not drawing it.
...@@ -132,7 +132,7 @@ bool Cube::findSticker (double position [], float myCubieSize, ...@@ -132,7 +132,7 @@ bool Cube::findSticker (double position [], float myCubieSize,
// IDW faceCentre [i] = 0; // Return zeroes if no sticker is found. // IDW faceCentre [i] = 0; // Return zeroes if no sticker is found.
} }
foreach (Cubie * cubie, cubies) { for (Cubie * cubie : qAsConst(cubies)) {
d = cubie->findCloserSticker (distance, location, faceCentre); d = cubie->findCloserSticker (distance, location, faceCentre);
if (d < distance) { if (d < distance) {
distance = d; distance = d;
...@@ -160,7 +160,7 @@ void Cube::setMoveAngle (int angle) ...@@ -160,7 +160,7 @@ void Cube::setMoveAngle (int angle)
void Cube::setBlinkingOn (Axis axis, int location) void Cube::setBlinkingOn (Axis axis, int location)
{ {
foreach (Cubie * cubie, cubies) { for (Cubie * cubie : qAsConst(cubies)) {
cubie->setBlinkingOn (axis, location, sizes[axis]); cubie->setBlinkingOn (axis, location, sizes[axis]);
} }
} }
...@@ -168,7 +168,7 @@ void Cube::setBlinkingOn (Axis axis, int location) ...@@ -168,7 +168,7 @@ void Cube::setBlinkingOn (Axis axis, int location)
void Cube::setBlinkingOff () void Cube::setBlinkingOff ()
{ {
foreach (Cubie * cubie, cubies) { for (Cubie * cubie : qAsConst(cubies)) {
cubie->setBlinkingOff (); cubie->setBlinkingOff ();
} }
} }
...@@ -227,7 +227,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction) ...@@ -227,7 +227,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction)
temp = currentCentre [coord1]; temp = currentCentre [coord1];
currentCentre [coord1] = - currentCentre [coord2]; currentCentre [coord1] = - currentCentre [coord2];
currentCentre [coord2] = + temp; currentCentre [coord2] = + temp;
foreach (Sticker * s, stickers) { for (Sticker * s : qAsConst(stickers)) {
temp = s->currentFaceCentre [coord1]; temp = s->currentFaceCentre [coord1];
s->currentFaceCentre [coord1] = - s->currentFaceCentre [coord2]; s->currentFaceCentre [coord1] = - s->currentFaceCentre [coord2];
s->currentFaceCentre [coord2] = + temp; s->currentFaceCentre [coord2] = + temp;
...@@ -237,7 +237,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction) ...@@ -237,7 +237,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction)
temp = currentCentre [coord1]; temp = currentCentre [coord1];
currentCentre [coord1] = + currentCentre [coord2]; currentCentre [coord1] = + currentCentre [coord2];
currentCentre [coord2] = - temp; currentCentre [coord2] = - temp;
foreach (Sticker * s, stickers) { for (Sticker * s : qAsConst(stickers)) {
temp = s->currentFaceCentre [coord1]; temp = s->currentFaceCentre [coord1];
s->currentFaceCentre [coord1] = + s->currentFaceCentre [coord2]; s->currentFaceCentre [coord1] = + s->currentFaceCentre [coord2];
s->currentFaceCentre [coord2] = - temp; s->currentFaceCentre [coord2] = - temp;
...@@ -246,7 +246,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction) ...@@ -246,7 +246,7 @@ void Cubie::rotate (Axis axis, int location, Rotation direction)
case (ONE_EIGHTY): // eg. around the Z-axis, X --> -X and Y --> -Y. case (ONE_EIGHTY): // eg. around the Z-axis, X --> -X and Y --> -Y.
currentCentre [coord1] = - currentCentre [coord1]; currentCentre [coord1] = - currentCentre [coord1];
currentCentre [coord2] = - currentCentre [coord2]; currentCentre [coord2] = - currentCentre [coord2];
foreach (Sticker * s, stickers) { for (Sticker * s : qAsConst(stickers)) {
s->currentFaceCentre [coord1] = - s->currentFaceCentre [coord1]; s->currentFaceCentre [coord1] = - s->currentFaceCentre [coord1];
s->currentFaceCentre [coord2] = - s->currentFaceCentre [coord2]; s->currentFaceCentre [coord2] = - s->currentFaceCentre [coord2];
} }
...@@ -313,8 +313,7 @@ void Cubie::drawCubie (GameGLView * gameGLView, float cubieSize, ...@@ -313,8 +313,7 @@ void Cubie::drawCubie (GameGLView * gameGLView, float cubieSize,
int faceNormal [nAxes]; int faceNormal [nAxes];
// For each sticker on this cubie (there may be 0->3 stickers) ... // For each sticker on this cubie (there may be 0->3 stickers) ...
foreach (Sticker * sticker, stickers) { for (Sticker * sticker : qAsConst(stickers)) {
// Calculate the integer unit-vector normal to this sticker's face // Calculate the integer unit-vector normal to this sticker's face
// and the centre of the face, in floating OpenGL co-ordinates. // and the centre of the face, in floating OpenGL co-ordinates.
LOOP (j, nAxes) { LOOP (j, nAxes) {
...@@ -342,7 +341,7 @@ double Cubie::findCloserSticker (double distance, double location [], ...@@ -342,7 +341,7 @@ double Cubie::findCloserSticker (double distance, double location [],
double dmin = distance; double dmin = distance;
Sticker * foundSticker = 0; Sticker * foundSticker = 0;
foreach (Sticker * sticker, stickers) { for (Sticker * sticker : qAsConst(stickers)) {
double d = 0.0; double d = 0.0;
LOOP (n, nAxes) { LOOP (n, nAxes) {
len = location[n] - sticker->currentFaceCentre[n]; len = location[n] - sticker->currentFaceCentre[n];
...@@ -374,7 +373,7 @@ void Cubie::setBlinkingOn (Axis axis, int location, int cubeBoundary) ...@@ -374,7 +373,7 @@ void Cubie::setBlinkingOn (Axis axis, int location, int cubeBoundary)
// If the sticker is on the outside edges of the slice, make it blink, but // If the sticker is on the outside edges of the slice, make it blink, but
// not if it is perpendicular to the move-axis (ie. on the slice's face). // not if it is perpendicular to the move-axis (ie. on the slice's face).
foreach (Sticker * sticker, stickers) { for (Sticker * sticker : qAsConst(stickers)) {
if (abs(sticker->currentFaceCentre [axis]) != cubeBoundary) { if (abs(sticker->currentFaceCentre [axis]) != cubeBoundary) {
sticker->blinking = true; sticker->blinking = true;
} }
...@@ -384,7 +383,7 @@ void Cubie::setBlinkingOn (Axis axis, int location, int cubeBoundary) ...@@ -384,7 +383,7 @@ void Cubie::setBlinkingOn (Axis axis, int location, int cubeBoundary)
void Cubie::setBlinkingOff () void Cubie::setBlinkingOff ()
{ {
foreach (Sticker * sticker, stickers) { for (Sticker * sticker : qAsConst(stickers)) {
sticker->blinking = false; sticker->blinking = false;
} }
} }
...@@ -400,7 +399,7 @@ void Cubie::printAll () ...@@ -400,7 +399,7 @@ void Cubie::printAll ()
printf ("<NONE>\n"); printf ("<NONE>\n");
} }
else { else {
foreach (Sticker * sticker, stickers) { for (Sticker * sticker : qAsConst(stickers)) {
printf ("<%d> at ", (int) sticker->color); printf ("<%d> at ", (int) sticker->color);
LOOP (n, nAxes) { LOOP (n, nAxes) {
printf ("%2d ", sticker->currentFaceCentre [n]); printf ("%2d ", sticker->currentFaceCentre [n]);
...@@ -423,7 +422,7 @@ void Cubie::printChanges () ...@@ -423,7 +422,7 @@ void Cubie::printChanges ()
// Check if the cubie is back where it was but has been given a twist. // Check if the cubie is back where it was but has been given a twist.
if (! moved) { if (! moved) {
foreach (Sticker * s, stickers) { for (Sticker * s : qAsConst(stickers)) {
LOOP (i, nAxes) { LOOP (i, nAxes) {
if (s->currentFaceCentre [i] != s->originalFaceCentre [i]) if (s->currentFaceCentre [i] != s->originalFaceCentre [i])
moved = true; moved = true;
...@@ -437,4 +436,4 @@ void Cubie::printChanges () ...@@ -437,4 +436,4 @@ void Cubie::printChanges ()
} }
} }
#include "cube.moc"
...@@ -102,8 +102,6 @@ enum FaceColor {INTERNAL, LEFT, RIGHT, BOTTOM, TOP, BACK, FRONT}; ...@@ -102,8 +102,6 @@ enum FaceColor {INTERNAL, LEFT, RIGHT, BOTTOM, TOP, BACK, FRONT};
*/ */
class Cube : public QObject class Cube : public QObject
{ {
Q_OBJECT
public: public:
/** /**
* Constructor for the Cube object * Constructor for the Cube object
...@@ -141,8 +139,6 @@ private: ...@@ -141,8 +139,6 @@ private:
class Cubie : public QObject class Cubie : public QObject
{ {
Q_OBJECT
public: public:
/** /**
* Constructor for the Cubie object * Constructor for the Cubie object
......
...@@ -20,8 +20,18 @@ ...@@ -20,8 +20,18 @@
#include "game.h" #include "game.h"
#include "movetracker.h" #include "movetracker.h"
#include "scenelabel.h" #include "scenelabel.h"
#include "kubrick_debug.h"
#include <KDebug> #include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KMessageBox>
#include <KStandardAction>
#include <QFileDialog>
#include <QStandardPaths>
#include <QTimer>
#include <QUrl>
// Create the main game/document object // Create the main game/document object
Game::Game (Kubrick * parent) Game::Game (Kubrick * parent)
...@@ -53,10 +63,8 @@ Game::Game (Kubrick * parent) ...@@ -53,10 +63,8 @@ Game::Game (Kubrick * parent)
moveTracker = new MoveTracker (myParent); moveTracker = new MoveTracker (myParent);
connect (moveTracker, SIGNAL(newMove(Move*)), connect(moveTracker, &MoveTracker::newMove, this, &Game::addPlayersMove);
this, SLOT(addPlayersMove(Move*))); connect(moveTracker, &MoveTracker::cubeRotated, this, &Game::setCubeNotAligned);
connect (moveTracker, SIGNAL(cubeRotated()),
this, SLOT(setCubeNotAligned()));
blinkStartTime = 300; blinkStartTime = 300;
} }
...@@ -125,7 +133,7 @@ void Game::initGame (GameGLView * glv, Kubrick * mw) ...@@ -125,7 +133,7 @@ void Game::initGame (GameGLView * glv, Kubrick * mw)
// Implement game ticks [SLOT(advance()) does most of the work in Kubrick]. // Implement game ticks [SLOT(advance()) does most of the work in Kubrick].
QTimer* timer = new QTimer (this); QTimer* timer = new QTimer (this);
nTick = 0; nTick = 0;
connect (timer, SIGNAL(timeout()), this, SLOT(advance())); connect(timer, &QTimer::timeout, this, &Game::advance);
timer->start (20); // Tick interval is 20 msec. timer->start (20); // Tick interval is 20 msec.
} }
...@@ -165,8 +173,8 @@ void Game::load () ...@@ -165,8 +173,8 @@ void Game::load ()
else if (tooBusy()) { else if (tooBusy()) {
return; return;
} }
QString loadFilename = KFileDialog::getOpenFileName (KUrl(), QString loadFilename = QFileDialog::getOpenFileName(myParent, i18n("Load Puzzle"),
"*.kbk", myParent, i18n("Load Puzzle")); QString(), i18n("Kubrick Game Files (*.kbk)"));
if (loadFilename.isNull()) { if (loadFilename.isNull()) {
return; return;
} }
...@@ -174,9 +182,8 @@ void Game::load () ...@@ -174,9 +182,8 @@ void Game::load ()
KConfig config (loadFilename, KConfig::SimpleConfig); KConfig config (loadFilename, KConfig::SimpleConfig);
if (! config.hasGroup ("KubrickGame")) { if (! config.hasGroup ("KubrickGame")) {
// IDW 15 Jun 08 - Should be i18n and message box, but the freeze is on. KMessageBox::sorry(mainWindow,
printf ("File '%s' is not a valid Kubrick game-file.\n", i18n("The file '%1' is not a valid Kubrick game-file.", loadFilename));
loadFilename.toLatin1().data());
return; return;
} }
...@@ -407,7 +414,7 @@ void Game::loadDemo (const QString & file) ...@@ -407,7 +414,7 @@ void Game::loadDemo (const QString & file)
{ {
if ((! demoPhase) && tooBusy()) if ((! demoPhase) && tooBusy())
return; return;
QString demoFile = KStandardDirs::locate ("appdata", file); QString demoFile = QStandardPaths::locate(QStandardPaths::AppDataLocation, file);
KConfig config (demoFile, KConfig::SimpleConfig); KConfig config (demoFile, KConfig::SimpleConfig);
if (config.hasGroup ("KubrickGame")) { if (config.hasGroup ("KubrickGame")) {
if (! demoPhase) { if (! demoPhase) {
...@@ -681,7 +688,7 @@ void Game::smWaitingForInput (const SingmasterMove smCode) ...@@ -681,7 +688,7 @@ void Game::smWaitingForInput (const SingmasterMove smCode)
keyboardState = SingmasterFaceIDSeen; // Change the state. keyboardState = SingmasterFaceIDSeen; // Change the state.
break; break;
default: default:
kDebug() << "Unknown Singmaster code" << smCode; qCDebug(KUBRICK_LOG) << "Unknown Singmaster code" << smCode;
break; break;
} }
} }
...@@ -714,7 +721,7 @@ void Game::smSingmasterPrefixSeen (const SingmasterMove smCode) ...@@ -714,7 +721,7 @@ void Game::smSingmasterPrefixSeen (const SingmasterMove smCode)
keyboardState = SingmasterFaceIDSeen; // Change the state. keyboardState = SingmasterFaceIDSeen; // Change the state.
break; break;
default: default:
kDebug() << "Unknown Singmaster code" << smCode; qCDebug(KUBRICK_LOG) << "Unknown Singmaster code" << smCode;
break; break;
} }
} }
...@@ -752,7 +759,7 @@ void Game::smSingmasterFaceIDSeen (const SingmasterMove smCode) ...@@ -752,7 +759,7 @@ void Game::smSingmasterFaceIDSeen (const SingmasterMove smCode)
keyboardState = SingmasterFaceIDSeen; // No change of state. keyboardState = SingmasterFaceIDSeen; // No change of state.
break; break;
default: default:
kDebug() << "Unknown Singmaster code" << smCode; qCDebug(KUBRICK_LOG) << "Unknown Singmaster code" << smCode;
break; break;
} }
} }
...@@ -789,7 +796,7 @@ void Game::saveSingmasterFaceID (const SingmasterMove smCode) ...@@ -789,7 +796,7 @@ void Game::saveSingmasterFaceID (const SingmasterMove smCode)
direction = -1; // Face not visible. direction = -1; // Face not visible.
break; break;
default: default:
kDebug() << "'Impossible' Singmaster code" << smCode; qCDebug(KUBRICK_LOG) << "'Impossible' Singmaster code" << smCode;
return; return;
break; break;
} }
...@@ -848,7 +855,7 @@ void Game::executeSingmasterMove (const SingmasterMove smCode) ...@@ -848,7 +855,7 @@ void Game::executeSingmasterMove (const SingmasterMove smCode)
smTempString.append (SingmasterNotation [SM_SPACER]); smTempString.append (SingmasterNotation [SM_SPACER]);
break; break;
default: default:
kDebug() << "'Impossible' Singmaster code" << smCode; qCDebug(KUBRICK_LOG) << "'Impossible' Singmaster code" << smCode;
return; return;
break; break;
} }
...@@ -924,7 +931,7 @@ void Game::setSceneLabels () ...@@ -924,7 +931,7 @@ void Game::setSceneLabels ()
frontVL->setVisible (false); frontVL->setVisible (false);
backVL->setVisible (false); backVL->setVisible (false);
foreach (CubeView * v, cubeViews) { for (CubeView * v : qAsConst(cubeViews)) {
if ((v->sceneID != currentSceneID) || (v->label == NoLabel)) if ((v->sceneID != currentSceneID) || (v->label == NoLabel))
continue; // Skip unwanted scene IDs and labels. continue; // Skip unwanted scene IDs and labels.
...@@ -953,7 +960,7 @@ void Game::saveState () ...@@ -953,7 +960,7 @@ void Game::saveState ()
if (demoPhase) { if (demoPhase) {
return; // Don't save if quitting during a demo. return; // Don't save if quitting during a demo.
} }
QString sFile = KStandardDirs::locateLocal ("appdata", "kubrick.save"); QString sFile = QStandardPaths