Commit b63582be authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to qdebug categories

parent 4ff3ca64
......@@ -39,7 +39,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMAddTests)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
......@@ -69,6 +69,7 @@ set(killbots_SRCS
sprite.cpp
view.cpp
)
ecm_qt_declare_logging_category(killbots_SRCS HEADER killbots_debug.h IDENTIFIER KILLBOTS_LOG CATEGORY_NAME org.kde.kdegames.killbots)
qt5_add_resources(killbots_SRCS killbots.qrc)
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KILLBOTS VERSION_HEADER killbots_version.h)
......@@ -93,5 +94,5 @@ install(TARGETS killbots ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.killbots.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.killbots.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES killbots.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install( FILES killbots.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} )
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -23,7 +23,7 @@
#include "settings.h"
#include "sprite.h"
#include <QDebug>
#include "killbots_debug.h"
#include <KRandom>
uint qHash(const QPoint &point)
......@@ -487,20 +487,20 @@ bool Killbots::Engine::moveIsValid(const QPoint &cell, HeroAction direction) con
if ( !canPushJunkheap( m_spriteMap.value( cell ), direction ) )
{
result = false;
//qDebug() << "Move is invalid. Cannot push junkheap.";
//qCDebug(KILLBOTS_LOG) << "Move is invalid. Cannot push junkheap.";
}
}
else
{
result = false;
//qDebug() << "Move is invalid. Cell is occupied by an unpushable object.";
//qCDebug(KILLBOTS_LOG) << "Move is invalid. Cell is occupied by an unpushable object.";
}
}
}
else
{
result = false;
//qDebug() << "Move is invalid. Cell is lies outside grid.";
//qCDebug(KILLBOTS_LOG) << "Move is invalid. Cell is lies outside grid.";
}
return result;
......
org.kde.kdegames.killbots killbots (kdegames) IDENTIFIER [KILLBOTS_LOG]
......@@ -42,7 +42,7 @@
#include <KStandardAction>
#include <QIcon>
#include <QDebug>
#include "killbots_debug.h"
#include <QTimer>
Killbots::MainWindow::MainWindow(QWidget *parent)
......@@ -129,7 +129,7 @@ void Killbots::MainWindow::onSettingsChanged()
m_coordinator->setAnimationSpeed(Settings::animationSpeed());
if (m_engine->ruleset()->fileName() != Settings::ruleset()) {
qDebug() << "Detected a changed in ruleset. From" << m_engine->ruleset()->fileName() << "to" << Settings::ruleset();
qCDebug(KILLBOTS_LOG) << "Detected a changed in ruleset. From" << m_engine->ruleset()->fileName() << "to" << Settings::ruleset();
// We don't act on the changed ruleset here because the config dialog
// is still visible. We want the game in progress to be visible when
......
......@@ -20,7 +20,7 @@
#include "ruleset.h"
#include <KConfigGroup>
#include <QDebug>
#include "killbots_debug.h"
#include <QFileInfo>
......@@ -39,7 +39,7 @@ const Killbots::Ruleset *Killbots::Ruleset::load(const QString &fileName)
}
}
if (!result) {
qDebug() << "Failed to load " << fileName;
qCDebug(KILLBOTS_LOG) << "Failed to load " << fileName;
}
return result;
......
......@@ -25,7 +25,7 @@
#include <KGamePopupItem>
#include <QDebug>
#include "killbots_debug.h"
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
......@@ -150,7 +150,7 @@ void Killbots::Scene::doLayout()
return;
}
//qDebug() << "Laying out scene at" << size;
//qCDebug(KILLBOTS_LOG) << "Laying out scene at" << size;
// Make certain layout properties proportional to the scene height,
// but clamp them between reasonable values. There's probably room for more
......
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