Commit 939d25d1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use debug categories

parent 72afc7b5
......@@ -27,6 +27,7 @@ include(FeatureSummary)
include(ECMAddAppIcon)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(ECMQtDeclareLoggingCategory)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
......@@ -48,6 +49,8 @@ set(kmines_SRCS
scene.cpp
main.cpp
)
ecm_qt_declare_logging_category(kmines_SRCS HEADER kmines_debug.h IDENTIFIER KMINES_LOG CATEGORY_NAME org.kde.kdegames.kmines)
qt5_add_resources(kmines_SRCS kmines.qrc)
ki18n_wrap_ui(kmines_SRCS customgame.ui generalopts.ui)
kconfig_add_kcfg_files(kmines_SRCS settings.kcfgc )
......@@ -67,5 +70,6 @@ target_link_libraries(kmines
install(TARGETS kmines ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install(FILES kmines.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
org.kde.kdegames.kmines (kdegames kmines) IDENTIFIER [KMINES_LOG]
......@@ -149,7 +149,7 @@ void KMinesMainWindow::onMinesCountChanged(int count)
void KMinesMainWindow::newGame()
{
qDebug() << "Inside game";
qCDebug(KMINES_LOG) << "Inside game";
m_gameClock->restart();
m_gameClock->pause(); // start only with the 1st click
......
......@@ -18,7 +18,7 @@
*/
#include "minefielditem.h"
#include <QDebug>
#include "kmines_debug.h"
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
......@@ -345,7 +345,7 @@ void MineFieldItem::mousePressEvent( QGraphicsSceneMouseEvent *ev )
CellItem* itemUnderMouse = itemAt(row,col);
if(!itemUnderMouse)
{
qDebug() << "unexpected - no item under mouse";
qCDebug(KMINES_LOG) << "unexpected - no item under mouse";
return;
}
......@@ -559,7 +559,7 @@ void MineFieldItem::onItemRevealed(CellItem* item)
int idx = m_cells.indexOf(item);
if(idx == -1)
{
qDebug() << "really strange - item not found";
qCDebug(KMINES_LOG) << "really strange - item not found";
return;
}
......
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