Commit 8d9b806a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to qdebug categories

parent 84faff4c
...@@ -30,7 +30,7 @@ include(FeatureSummary) ...@@ -30,7 +30,7 @@ include(FeatureSummary)
include(ECMAddAppIcon) include(ECMAddAppIcon)
include(ECMInstallIcons) include(ECMInstallIcons)
include(ECMAddTests) include(ECMAddTests)
include(ECMQtDeclareLoggingCategory)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git") if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
...@@ -46,7 +46,7 @@ add_subdirectory(test) ...@@ -46,7 +46,7 @@ add_subdirectory(test)
install(FILES ${CMAKE_SOURCE_DIR}/org.kde.picmi.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES ${CMAKE_SOURCE_DIR}/org.kde.picmi.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES ${CMAKE_SOURCE_DIR}/org.kde.picmi.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install(FILES ${CMAKE_SOURCE_DIR}/org.kde.picmi.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES ${CMAKE_SOURCE_DIR}/picmiui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/picmi) install(FILES ${CMAKE_SOURCE_DIR}/picmiui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/picmi)
install(FILES picmi.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
# vim:set ts=4 sw=4 et: # vim:set ts=4 sw=4 et:
org.kde.kdegames.picmi picmi (kdegames) IDENTIFIER [PICMIC_LOG]
...@@ -36,7 +36,7 @@ set(picmi_SRCS ...@@ -36,7 +36,7 @@ set(picmi_SRCS
settings.cpp settings.cpp
systemexception.cpp systemexception.cpp
) )
ecm_qt_declare_logging_category(picmi_SRCS HEADER picmi_debug.h IDENTIFIER PICMIC_LOG CATEGORY_NAME org.kde.kdegames.picmi)
file(GLOB ICONS_SRCS "${CMAKE_SOURCE_DIR}/icons/*-apps-picmi.png") file(GLOB ICONS_SRCS "${CMAKE_SOURCE_DIR}/icons/*-apps-picmi.png")
ecm_add_app_icon(picmi_SRCS ICONS ${ICONS_SRCS}) ecm_add_app_icon(picmi_SRCS ICONS ${ICONS_SRCS})
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "levelloader.h" #include "levelloader.h"
#include <KLocalizedString> #include <KLocalizedString>
#include <QDebug> #include "picmi_debug.h"
#include <QDir> #include <QDir>
#include <QDomDocument> #include <QDomDocument>
#include <QFile> #include <QFile>
...@@ -182,7 +182,7 @@ void LevelLoader::setLevelset(const QString& filename) ...@@ -182,7 +182,7 @@ void LevelLoader::setLevelset(const QString& filename)
file.close(); file.close();
if (!success) { if (!success) {
qDebug() << QStringLiteral("Can't read levelset from %1 \nError: %2 in Line %3, Column %4") qCDebug(PICMIC_LOG) << QStringLiteral("Can't read levelset from %1 \nError: %2 in Line %3, Column %4")
.arg(filename, errorString).arg(errorLine).arg(errorColumn); .arg(filename, errorString).arg(errorLine).arg(errorColumn);
m_valid = false; m_valid = false;
} }
...@@ -197,7 +197,7 @@ QList<QSharedPointer<Level> > LevelLoader::loadLevels() { ...@@ -197,7 +197,7 @@ QList<QSharedPointer<Level> > LevelLoader::loadLevels() {
QDomElement levels = m_levelset->documentElement(); QDomElement levels = m_levelset->documentElement();
if (!levels.hasAttribute(QStringLiteral("name"))) { if (!levels.hasAttribute(QStringLiteral("name"))) {
qDebug() << "Loading level failed: no levelset name specified"; qCDebug(PICMIC_LOG) << "Loading level failed: no levelset name specified";
return l; return l;
} }
m_levelsetname = levels.attribute(QStringLiteral("name")); m_levelsetname = levels.attribute(QStringLiteral("name"));
...@@ -207,7 +207,7 @@ QList<QSharedPointer<Level> > LevelLoader::loadLevels() { ...@@ -207,7 +207,7 @@ QList<QSharedPointer<Level> > LevelLoader::loadLevels() {
try { try {
l.append(loadLevel(childNodes.at(i).toElement())); l.append(loadLevel(childNodes.at(i).toElement()));
} catch (const SystemException &e) { } catch (const SystemException &e) {
qDebug() << "Loading level failed: " << e.what(); qCDebug(PICMIC_LOG) << "Loading level failed: " << e.what();
} }
} }
return l; return l;
......
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