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

Port to QCDebug

parent 07331a53
########### next target ###############
set(kgoldrunner_SRCS
set(kgoldrunner_SRCS
kgoldrunner_debug.cpp
kgrview.cpp
kgrscene.cpp
kgrsprite.cpp
......
......@@ -34,8 +34,8 @@
#include <kconfig.h>
#include <kconfiggroup.h>
#include <QDebug>
#include <QDebug>
#include "kgoldrunner_debug.h"
#include "kgoldrunner_debug.h"
#include <ktoolbar.h>
#include <kmenubar.h>
......@@ -166,20 +166,20 @@ KGoldrunner::KGoldrunner()
// Do NOT paint main widget yet (title bar, menu, blank playfield).
// Instead, queue a call to the "KGoldrunner_2" constructor extension.
QMetaObject::invokeMethod (this, "KGoldrunner_2", Qt::QueuedConnection);
//qDebug() << "QMetaObject::invokeMethod (this, \"KGoldrunner_2\") done ... ";
//qDebug() << "1st scan of event-queue ...";
//qCDebug(KGOLDRUNNER_LOG) << "QMetaObject::invokeMethod (this, \"KGoldrunner_2\") done ... ";
//qCDebug(KGOLDRUNNER_LOG) << "1st scan of event-queue ...";
}
void KGoldrunner::KGoldrunner_2()
{
//qDebug() << "Entered constructor extension ...";
//qCDebug(KGOLDRUNNER_LOG) << "Entered constructor extension ...";
// Queue a call to the "initGame" method. This renders and paints the
// initial graphics, but only AFTER the initial main-window resize events
// have been seen and the final SVG scale is known.
QMetaObject::invokeMethod (game, "initGame", Qt::QueuedConnection);
//qDebug() << "QMetaObject::invokeMethod (game, \"initGame\") done ... ";
//qDebug() << "2nd scan of event-queue ...";
//qCDebug(KGOLDRUNNER_LOG) << "QMetaObject::invokeMethod (game, \"initGame\") done ... ";
//qCDebug(KGOLDRUNNER_LOG) << "2nd scan of event-queue ...";
}
KGoldrunner::~KGoldrunner()
......@@ -778,7 +778,7 @@ void KGoldrunner::setEditMenu (bool on_off)
if (on_off){
// Set the editToolbar icons to the current tile-size.
//qDebug() << "ToolBar icon size:" << scene->tileSize ();
//qCDebug(KGOLDRUNNER_LOG) << "ToolBar icon size:" << scene->tileSize ();
toolBar ("editToolbar")->setIconSize (scene->tileSize ());
// Set the editToolbar icons up with pixmaps of the current theme.
......@@ -830,7 +830,7 @@ void KGoldrunner::saveProperties (KConfigGroup & /* config - unused */)
// config file. Anything you write here will be available
// later when this app is restored.
//qDebug() << "I am in KGoldrunner::saveProperties.";
//qCDebug(KGOLDRUNNER_LOG) << "I am in KGoldrunner::saveProperties.";
}
void KGoldrunner::readProperties (const KConfigGroup & /* config - unused */)
......@@ -840,7 +840,7 @@ void KGoldrunner::readProperties (const KConfigGroup & /* config - unused */)
// the app is being restored. Read in here whatever you wrote
// in 'saveProperties'
//qDebug() << "I am in KGoldrunner::readProperties.";
//qCDebug(KGOLDRUNNER_LOG) << "I am in KGoldrunner::readProperties.";
}
void KGoldrunner::optionsConfigureKeys()
......
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kgoldrunner_debug.h"
Q_LOGGING_CATEGORY(KGOLDRUNNER_LOG, "log_kgoldrunner")
/* This file is part of the KDE project
Copyright (C) 2014 Laurent Montel <montel@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KGOLDRUNNER_DEBUG_H
#define KGOLDRUNNER_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KGOLDRUNNER_LOG)
#endif
......@@ -19,11 +19,11 @@
#define KGRDEBUG_H
static int dbgLevel = 0; // Local to file where kgrdebug.h is included.
#include <KDebug>
#define dbk kDebug()
#define dbk1 if(dbgLevel>=1)kDebug()
#define dbk2 if(dbgLevel>=2)kDebug()
#define dbk3 if(dbgLevel>=3)kDebug()
#include "kgoldrunner_debug.h"
#define dbk qCDebug(KGOLDRUNNER_LOG)
#define dbk1 if(dbgLevel>=1)qCDebug(KGOLDRUNNER_LOG)
#define dbk2 if(dbgLevel>=2)qCDebug(KGOLDRUNNER_LOG)
#define dbk3 if(dbgLevel>=3)qCDebug(KGOLDRUNNER_LOG)
#define dbo printf(
#define dbo1 if(dbgLevel>=1)printf(
......
......@@ -27,7 +27,7 @@
#include <ctype.h>
#include <QTimer>
#include <KDebug>
#include "kgoldrunner_debug.h"
KGrEditor::KGrEditor (KGrView * theView,
const QString & theSystemDir,
......@@ -138,7 +138,7 @@ bool KGrEditor::updateLevel (int pGameIndex, int level)
if (level < 0)
level = 0;
int selectedLevel = selectLevel (SL_UPDATE, level, gameIndex);
kDebug() << "Selected" << gameList.at(gameIndex)->name
qCDebug(KGOLDRUNNER_LOG) << "Selected" << gameList.at(gameIndex)->name
<< "level" << selectedLevel;
if (selectedLevel == 0) {
mouseDisabled = false;
......@@ -162,7 +162,7 @@ void KGrEditor::loadEditLevel (int lev)
{
KGrLevelData d;
kDebug() << "gameIndex" << gameIndex;
qCDebug(KGOLDRUNNER_LOG) << "gameIndex" << gameIndex;
// If system game or ENDE screen, choose system dir, else choose user dir.
const QString dir = ((gameList.at(gameIndex)->owner == SYSTEM) ||
(lev == 0)) ? systemDataDir : userDataDir;
......@@ -888,7 +888,7 @@ void KGrEditor::doEdit (int button)
// Mouse button down: start making changes.
int i, j;
emit getMousePos (i, j);
kDebug() << "Button" << button << "at" << i << j;
qCDebug(KGOLDRUNNER_LOG) << "Button" << button << "at" << i << j;
switch (button) {
case Qt::LeftButton:
......
......@@ -50,7 +50,7 @@
#include <KStandardGuiItem>
#include <KStandardDirs>
#include <KApplication>
#include <KDebug>
#include "kgoldrunner_debug.h"
// TODO - Can we change over to KScoreDialog?
......@@ -116,7 +116,7 @@ KGrGame::KGrGame (KGrView * theView,
// Initialise random number generator.
randomGen = new KRandomSequence (time (0));
kDebug() << "RANDOM NUMBER GENERATOR INITIALISED";
qCDebug(KGOLDRUNNER_LOG) << "RANDOM NUMBER GENERATOR INITIALISED";
scene->setReplayMessage (i18n("Click anywhere to begin live play"));
}
......@@ -197,7 +197,7 @@ void KGrGame::gameActions (const int action)
return;
}
level++;
kDebug() << "Game" << gameList.at(gameIndex)->name << "level" << level;
qCDebug(KGOLDRUNNER_LOG) << "Game" << gameList.at(gameIndex)->name << "level" << level;
newGame (level, gameIndex);
showTutorialMessages (level);
break;
......@@ -329,7 +329,7 @@ void KGrGame::editActions (const int action)
prefix = gameList.at (gameIndex)->prefix;
level = lev;
kDebug() << "Saving to KConfigGroup";
qCDebug(KGOLDRUNNER_LOG) << "Saving to KConfigGroup";
KConfigGroup gameGroup (KSharedConfig::openConfig(), "KDEGame");
gameGroup.writeEntry ("GamePrefix", prefix);
gameGroup.writeEntry ("Level_" + prefix, level);
......@@ -426,7 +426,7 @@ void KGrGame::initGame()
"SndFile libraries were present when it was compiled and built."),
"WarningNoSound");
#endif
kDebug() << "Entered, draw the initial graphics now ...";
qCDebug(KGOLDRUNNER_LOG) << "Entered, draw the initial graphics now ...";
// Get the most recent collection and level that was played by this user.
// If he/she has never played before, set it to Tutorial, level 1.
......@@ -434,7 +434,7 @@ void KGrGame::initGame()
QString prevGamePrefix = gameGroup.readEntry ("GamePrefix", "tute");
int prevLevel = gameGroup.readEntry ("Level_" + prevGamePrefix, 1);
kDebug()<< "Config() Game and Level" << prevGamePrefix << prevLevel;
qCDebug(KGOLDRUNNER_LOG)<< "Config() Game and Level" << prevGamePrefix << prevLevel;
// Use that game and level, if it is among the current games.
// Otherwise, use the first game in the list and level 1.
......@@ -473,7 +473,7 @@ void KGrGame::initGame()
#ifdef KGAUDIO_BACKEND_OPENAL
// Set up sounds, if required in config.
soundOn = gameGroup.readEntry ("Sound", false);
kDebug() << "Sound" << soundOn;
qCDebug(KGOLDRUNNER_LOG) << "Sound" << soundOn;
if (soundOn) {
loadSounds();
effects->setMuted (false);
......@@ -481,7 +481,7 @@ void KGrGame::initGame()
emit setToggle ("options_sounds", soundOn);
stepsOn = gameGroup.readEntry ("StepSounds", false);
kDebug() << "StepSounds" << stepsOn;
qCDebug(KGOLDRUNNER_LOG) << "StepSounds" << stepsOn;
emit setToggle ("options_steps", stepsOn);
#endif
......@@ -522,7 +522,7 @@ bool KGrGame::startDemo (const Owner demoOwner, const QString & pPrefix,
dbk1 << "DEMO looking for" << s << "found at" << index;
if (index <= 0) {
setPlayback (false);
kDebug() << "DEMO not found in" << filepath << s << pPrefix << levelNo;
qCDebug(KGOLDRUNNER_LOG) << "DEMO not found in" << filepath << s << pPrefix << levelNo;
return false;
}
......@@ -538,12 +538,12 @@ bool KGrGame::startDemo (const Owner demoOwner, const QString & pPrefix,
if (levelPlayer) {
levelPlayer->prepareToPlay();
}
kDebug() << "DEMO started ..." << filepath << pPrefix << levelNo;
qCDebug(KGOLDRUNNER_LOG) << "DEMO started ..." << filepath << pPrefix << levelNo;
return true;
}
else {
setPlayback (false);
kDebug() << "DEMO failed ..." << filepath << pPrefix << levelNo;
qCDebug(KGOLDRUNNER_LOG) << "DEMO failed ..." << filepath << pPrefix << levelNo;
return false;
}
}
......@@ -559,7 +559,7 @@ void KGrGame::runNextDemoLevel()
if (levelPlayer) {
levelPlayer->prepareToPlay();
}
kDebug() << "DEMO continued ..." << playbackPrefix << playbackIndex;
qCDebug(KGOLDRUNNER_LOG) << "DEMO continued ..." << playbackPrefix << playbackIndex;
return;
}
}
......@@ -583,7 +583,7 @@ void KGrGame::finishDemo()
void KGrGame::interruptDemo()
{
kDebug() << "DEMO interrupted ...";
qCDebug(KGOLDRUNNER_LOG) << "DEMO interrupted ...";
if ((demoType == INSTANT_REPLAY) || (demoType == REPLAY_LAST)) {
setPlayback (false);
levelMax = gameList.at (gameIndex)->nLevels;
......@@ -765,9 +765,9 @@ bool KGrGame::selectGame (const SelectAction slAction,
bool selected = sl->selectLevel (selectedGame, selectedLevel);
delete sl;
kDebug() << "After dialog - programFreeze" << programFreeze;
kDebug() << "selected" << selected << "gameFrozen" << gameFrozen;
kDebug() << "selectedGame" << selectedGame
qCDebug(KGOLDRUNNER_LOG) << "After dialog - programFreeze" << programFreeze;
qCDebug(KGOLDRUNNER_LOG) << "selected" << selected << "gameFrozen" << gameFrozen;
qCDebug(KGOLDRUNNER_LOG) << "selectedGame" << selectedGame
<< "prefix" << gameList.at(selectedGame)->prefix
<< "selectedLevel" << selectedLevel;
// Unfreeze the game, but only if it was previously unfrozen.
......@@ -1137,7 +1137,7 @@ void KGrGame::setTimeScale (const int action)
if (levelPlayer && (! playback)) {
// Change speed during play, but not during a demo or replay.
kDebug() << "setTimeScale" << (timeScale);
qCDebug(KGOLDRUNNER_LOG) << "setTimeScale" << (timeScale);
levelPlayer->setTimeScale (timeScale);
}
}
......@@ -1174,8 +1174,8 @@ void KGrGame::toggleSoundsOnOff (const int action)
void KGrGame::freeze (const bool userAction, const bool on_off)
{
QString type = userAction ? "UserAction" : "ProgramAction";
kDebug() << "PAUSE:" << type << on_off;
kDebug() << "gameFrozen" << gameFrozen << "programFreeze" << programFreeze;
qCDebug(KGOLDRUNNER_LOG) << "PAUSE:" << type << on_off;
qCDebug(KGOLDRUNNER_LOG) << "gameFrozen" << gameFrozen << "programFreeze" << programFreeze;
#ifdef KGAUDIO_BACKEND_OPENAL
if (on_off && effects) { // If pausing and sounds are loaded, cut
......@@ -1188,10 +1188,10 @@ void KGrGame::freeze (const bool userAction, const bool on_off)
if (on_off) {
if (gameFrozen) {
if (programFreeze) {
kDebug() << "P: The program has already frozen the game.";
qCDebug(KGOLDRUNNER_LOG) << "P: The program has already frozen the game.";
}
else {
kDebug() << "P: The user has already frozen the game.";
qCDebug(KGOLDRUNNER_LOG) << "P: The user has already frozen the game.";
}
return; // The game is already frozen.
}
......@@ -1199,10 +1199,10 @@ void KGrGame::freeze (const bool userAction, const bool on_off)
}
else if (! programFreeze) {
if (gameFrozen) {
kDebug() << "P: The user will keep the game frozen.";
qCDebug(KGOLDRUNNER_LOG) << "P: The user will keep the game frozen.";
}
else {
kDebug() << "P: The game is NOT frozen.";
qCDebug(KGOLDRUNNER_LOG) << "P: The game is NOT frozen.";
}
return; // The user will keep the game frozen.
}
......@@ -1211,7 +1211,7 @@ void KGrGame::freeze (const bool userAction, const bool on_off)
}
else if (programFreeze) {
// If the user breaks through a program freeze somehow, take no action.
kDebug() << "U: THE USER HAS BROKEN THROUGH SOMEHOW.";
qCDebug(KGOLDRUNNER_LOG) << "U: THE USER HAS BROKEN THROUGH SOMEHOW.";
return;
}
else {
......@@ -1223,7 +1223,7 @@ void KGrGame::freeze (const bool userAction, const bool on_off)
if (levelPlayer) {
levelPlayer->pause (on_off);
}
kDebug() << "RESULT: gameFrozen" << gameFrozen
qCDebug(KGOLDRUNNER_LOG) << "RESULT: gameFrozen" << gameFrozen
<< "programFreeze" << programFreeze;
}
......@@ -1903,7 +1903,7 @@ void KGrGame::dbgControl (const int code)
levelPlayer->interruptPlayback(); // Will emit interruptDemo().
return;
}
// kDebug() << "Debug code =" << code;
// qCDebug(KGOLDRUNNER_LOG) << "Debug code =" << code;
if (levelPlayer && gameFrozen) {
levelPlayer->dbgControl (code);
}
......@@ -1978,7 +1978,7 @@ bool KGrGame::initRecordingData (const Owner fileOwner, const QString & prefix,
const QString dir = ((fileOwner == SYSTEM) || (levelNo == 0)) ?
systemDataDir : userDataDir;
if (playback) {
kDebug() << "loadRecording" << dir << prefix << levelNo;
qCDebug(KGOLDRUNNER_LOG) << "loadRecording" << dir << prefix << levelNo;
if (! loadRecording (dir, prefix, levelNo)) {
return false;
}
......@@ -1995,7 +1995,7 @@ bool KGrGame::initRecordingData (const Owner fileOwner, const QString & prefix,
recording->dateTime = QDateTime::currentDateTime()
.toUTC()
.toString (Qt::ISODate);
kDebug() << "Recording at" << recording->dateTime;
qCDebug(KGOLDRUNNER_LOG) << "Recording at" << recording->dateTime;
KGrGameData * gameData = gameList.at (gameIndex);
recording->owner = gameData->owner;
......@@ -2028,7 +2028,7 @@ void KGrGame::saveRecording()
{
QString filename = userDataDir + "rec_" + prefix + ".txt";
QString groupName = prefix + QString::number(level).rightJustified(3,'0');
kDebug() << filename << groupName;
qCDebug(KGOLDRUNNER_LOG) << filename << groupName;
KConfig config (filename, KConfig::SimpleConfig);
KConfigGroup configGroup = config.group (groupName);
......@@ -2083,14 +2083,14 @@ void KGrGame::saveRecording()
bool KGrGame::loadRecording (const QString & dir, const QString & prefix,
const int levelNo)
{
kDebug() << prefix << levelNo;
qCDebug(KGOLDRUNNER_LOG) << prefix << levelNo;
QString filename = dir + "rec_" + prefix + ".txt";
QString groupName = prefix + QString::number(levelNo).rightJustified(3,'0');
kDebug() << filename << groupName;
qCDebug(KGOLDRUNNER_LOG) << filename << groupName;
KConfig config (filename, KConfig::SimpleConfig);
if (! config.hasGroup (groupName)) {
kDebug() << "Group" << groupName << "NOT FOUND";
qCDebug(KGOLDRUNNER_LOG) << "Group" << groupName << "NOT FOUND";
return false;
}
......
......@@ -22,7 +22,7 @@
#include <QDir>
#include <KLocalizedString>
#include <QDebug>
#include "kgoldrunner_debug.h"
KGrGameIO::KGrGameIO (QWidget * pView)
:
......@@ -55,7 +55,7 @@ IOStatus KGrGameIO::fetchGameListData
filePath = dir + filename;
KGrGameData * g = initGameData (o);
gameList.append (g);
// //qDebug()<< "GAME PATH:" << filePath;
// //qCDebug(KGOLDRUNNER_LOG)<< "GAME PATH:" << filePath;
openFile.setFileName (filePath);
......@@ -95,7 +95,7 @@ IOStatus KGrGameIO::fetchGameListData
g->nLevels = fields.at (0).toInt();
g->rules = fields.at (1).at (0);
g->prefix = fields.at (2);
// //qDebug() << "Levels:" << g->nLevels << "Rules:" << g->rules <<
// //qCDebug(KGOLDRUNNER_LOG) << "Levels:" << g->nLevels << "Rules:" << g->rules <<
// "Prefix:" << g->prefix;
if (kgr3Format) {
......@@ -117,7 +117,7 @@ IOStatus KGrGameIO::fetchGameListData
gameName = removeNewline (textLine.right (textLine.size() - n));
g->name = i18n (gameName.constData());
}
// //qDebug() << "Skill:" << g->skill << "Name:" << g->name;
// //qCDebug(KGOLDRUNNER_LOG) << "Skill:" << g->skill << "Name:" << g->name;
// Loop to accumulate lines of about-data. If kgr3Format, exit on
// EOF or 'L' line. If not kgr3Format, exit on EOF or numeric line.
......@@ -132,7 +132,7 @@ IOStatus KGrGameIO::fetchGameListData
g->about.append (textLine);
}
g->about = removeNewline (g->about); // Remove final '\n'.
// //qDebug() << "Info about: [" + g->about + "]";
// //qCDebug(KGOLDRUNNER_LOG) << "Info about: [" + g->about + "]";
if ((! kgr3Format) && (c != '\0')) {
filePath = dir + filename;
......@@ -152,7 +152,7 @@ bool KGrGameIO::readLevelData (const QString & dir,
const QString & prefix,
const int levelNo, KGrLevelData & d)
{
//qDebug() << "dir" << dir << "Level" << prefix << levelNo;
//qCDebug(KGOLDRUNNER_LOG) << "dir" << dir << "Level" << prefix << levelNo;
QString filePath;
IOStatus stat = fetchLevelData
(dir, prefix, levelNo, d, filePath);
......@@ -190,7 +190,7 @@ IOStatus KGrGameIO::fetchLevelData
d.name = ""; // Level name (optional).
d.hint = ""; // Level hint (optional).
// //qDebug()<< "LEVEL PATH:" << filePath;
// //qCDebug(KGOLDRUNNER_LOG)<< "LEVEL PATH:" << filePath;
openFile.setFileName (filePath);
// Check that the level-file exists.
......@@ -240,9 +240,9 @@ IOStatus KGrGameIO::fetchLevelData
}
}
// //qDebug() << "Level:" << level << "Layout length:" << d.layout.size();
// //qDebug() << "Name:" << "[" + d.name + "]";
// //qDebug() << "Hint:" << "[" + d.hint + "]";
// //qCDebug(KGOLDRUNNER_LOG) << "Level:" << level << "Layout length:" << d.layout.size();
// //qCDebug(KGOLDRUNNER_LOG) << "Name:" << "[" + d.name + "]";
// //qCDebug(KGOLDRUNNER_LOG) << "Hint:" << "[" + d.hint + "]";
openFile.close();
return (result);
......@@ -284,7 +284,7 @@ char KGrGameIO::getALine (const bool kgr3, QByteArray & line)
}
}
// //qDebug() << "Raw line:" << line;
// //qCDebug(KGOLDRUNNER_LOG) << "Raw line:" << line;
if (line.size() <= 0) {
// Return a '\0' byte if end-of-file.
return ('\0');
......@@ -293,7 +293,7 @@ char KGrGameIO::getALine (const bool kgr3, QByteArray & line)
// In KGr 3 format, strip off leading and trailing syntax.
if (line.startsWith ("// ")) {
line = line.right (line.size() - 3);
// //qDebug() << "Stripped comment is:" << line;
// //qCDebug(KGOLDRUNNER_LOG) << "Stripped comment is:" << line;
}
else {
if (line.startsWith (" i18n(\"")) {
......@@ -314,7 +314,7 @@ char KGrGameIO::getALine (const bool kgr3, QByteArray & line)
else if (line.endsWith ("\"\n")) {
line = line.left (line.size() - 2);
}
// //qDebug() << "Stripped syntax is:" << line;
// //qCDebug(KGOLDRUNNER_LOG) << "Stripped syntax is:" << line;
}
// In Kgr 3 format, return the first byte if not end-of-file.
c = line.at (0);
......
......@@ -31,7 +31,7 @@
#include "kgrlevelgrid.h"
#include "kgrrunner.h"
#include <QDebug>
#include "kgoldrunner_debug.h"
#include <KMessageBox> // TODO - Remove.
#include <KRandomSequence>
......@@ -71,7 +71,7 @@ KGrLevelPlayer::~KGrLevelPlayer()
{
qDeleteAll(dugBricks);
dugBricks.clear(); //TODO: necessary?
//qDebug() << "LEVEL PLAYER BEING DELETED.";
//qCDebug(KGOLDRUNNER_LOG) << "LEVEL PLAYER BEING DELETED.";
playerCount--;
// TODO - Remove this debugging code.
......@@ -806,7 +806,7 @@ void KGrLevelPlayer::tick (bool missed, int scaledTime)
// Queued connection ensures KGrGame slot runs AFTER return from here.
emit endLevel (status);
//qDebug() << "END OF LEVEL";
//qCDebug(KGOLDRUNNER_LOG) << "END OF LEVEL";
return;
}
......@@ -1158,7 +1158,7 @@ void KGrLevelPlayer::killHero()
record (1, ACTION_CODE + KILL_HERO);
emit endLevel (DEAD);
//qDebug() << "END OF LEVEL";
//qCDebug(KGOLDRUNNER_LOG) << "END OF LEVEL";
}
}
......
......@@ -300,7 +300,7 @@ public:
* is paused and the KConfig file contains group Debugging with setting
* DebuggingShortcuts=true. The main actions are to do timer steps one at
* a time, activate/deactivate a bug-fix or new-feature patch dynamically,
* activate/deactivate logging output from fprintf or kDebug() dynamically,
* activate/deactivate logging output from fprintf or qCDebug(KGOLDRUNNER_LOG) dynamically,
* print the status of a cell pointed to by the mouse and print the status
* of the hero or an enemy. See the code in file kgoldrunner.cpp, at the
* end of KGoldrunner::setupActions() for details of codes and keystrokes.
......
......@@ -24,7 +24,7 @@
#include <KgThemeSelector>
#include <KLocalizedString>
#include <QDebug>
#include "kgoldrunner_debug.h"
#include <QString>
#include "kgrglobals.h"
......@@ -98,7 +98,7 @@ void KGrRenderer::matchThemes (const KgTheme * currentSetTheme)
void KGrRenderer::currentThemeChanged (const KgTheme* currentSetTheme)
{
qDebug() << "KGrRenderer::currentThemeChanged()" << currentSetTheme->name();
qCDebug(KGOLDRUNNER_LOG) << "KGrRenderer::currentThemeChanged()" << currentSetTheme->name();
matchThemes (currentSetTheme);
m_scene->changeTheme();
......@@ -274,7 +274,7 @@ QString KGrRenderer::getBackgroundKey (const int level)
}
}
qDebug() << "BACKGROUND pixmap key" << pixmapKey;
qCDebug(KGOLDRUNNER_LOG) << "BACKGROUND pixmap key" << pixmapKey;
return pixmapKey;
}
......
......@@ -23,7 +23,7 @@
#include <QObject>
#include <QList>
#include <KDebug>
#include "kgoldrunner_debug.h"
class KGrLevelGrid;
......
......@@ -22,7 +22,7 @@
#include "kgrrulebook.h"
#include "kgrlevelplayer.h"
#include <KDebug>
#include "kgoldrunner_debug.h"
KGrRunner::KGrRunner (KGrLevelPlayer * pLevelPlayer, KGrLevelGrid * pGrid,
int i, int j, const int pSpriteId,
......@@ -74,7 +74,7 @@ void KGrRunner::getRules()
pointsPerCell = rules->pointsPerCell();
turnAnywhere = rules->turnAnywhere();
if (spriteId < 1) {
kDebug() << "pointsPerCell" << pointsPerCell
qCDebug(KGOLDRUNNER_LOG) << "pointsPerCell" << pointsPerCell
<< "turnAnywhere" << turnAnywhere;
}
}
......@@ -201,9 +201,9 @@ KGrHero::KGrHero (KGrLevelPlayer * pLevelPlayer, KGrLevelGrid * pGrid,
KGrRunner (pLevelPlayer, pGrid, i, j, pSpriteId, pRules, 0),
nuggets (0) // KGrLevelPlayer object will call hero->setNuggets().
{
kDebug() << "THE HERO IS BORN at" << i << j << "sprite ID" << pSpriteId;
qCDebug(KGOLDRUNNER_LOG) << "THE HERO IS BORN at" << i << j << "sprite ID" << pSpriteId;
rules->getHeroTimes (runTime, fallTime, enemyFallTime, trapTime);
kDebug() << "Hero run time" << runTime << "fall time" << fallTime;
qCDebug(KGOLDRUNNER_LOG) << "Hero run time" << runTime << "fall time" << fallTime;
interval = runTime;
}
......@@ -305,7 +305,7 @@ HeroStatus KGrHero::run (const int scaledTime)
bool KGrHero::dig (const Direction diggingDirection, int & i, int & j)
{
QString text = (diggingDirection == DIG_LEFT) ? "LEFT" : "RIGHT";
// kDebug() << "Start digging" << text;
// qCDebug(KGOLDRUNNER_LOG) << "Start digging" << text;
Flags moves = grid->heroMoves (gridI, gridJ);
bool result = false;
......@@ -324,7 +324,7 @@ bool KGrHero::dig (const Direction diggingDirection, int & i, int & j)
// The place to dig must be clear and there must be a brick under it.
char aboveBrick = grid->cellType (gridI + relativeI, gridJ);
// kDebug() << "aboveBrick =" << aboveBrick;
// qCDebug(KGOLDRUNNER_LOG) << "aboveBrick =" << aboveBrick;
if ((grid->cellType (gridI + relativeI, gridJ + 1) == BRICK) &&
((aboveBrick == FREE) || (aboveBrick == HOLE))) {
......@@ -363,10 +363,10 @@ KGrEnemy::KGrEnemy (KGrLevelPlayer * pLevelPlayer, KGrLevelGrid * pGrid,
rulesType = rules->getEnemyTimes (runTime, fallTime, trapTime);
enemyFallTime = fallTime;
interval = runTime;
kDebug() << "ENEMY" << pSpriteId << "IS BORN at" << i << j;
qCDebug(KGOLDRUNNER_LOG) << "ENEMY" << pSpriteId << "IS BORN at" << i << j;
if (pSpriteId < 2) {
kDebug() << "Enemy run time " << runTime << "fall time" << fallTime;
kDebug() << "Enemy trap time" << trapTime << "Rules type" << rulesType;
qCDebug(KGOLDRUNNER_LOG) << "Enemy run time " << runTime << "fall time" << fallTime;
qCDebug(KGOLDRUNNER_LOG) << "Enemy trap time" << trapTime << "Rules type" << rulesType;
}
t.start(); // IDW
}
......
......@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
****************************************************************************/
#include <QDebug>