aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-10-29 15:19:43 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-10-29 15:19:43 (GMT)
commit29fcd2d8f20e8855ee145414a70c1f9e3446865e (patch)
tree493876166b68dfd9faeba0ca83dee5d053ca0a8a
parent9b6defee312155be79ad88190f90ce2afc0653e6 (diff)
Knut: use qCDebug
-rw-r--r--autotests/libs/testresource/CMakeLists.txt3
-rw-r--r--autotests/libs/testresource/knutresource.cpp13
2 files changed, 10 insertions, 6 deletions
diff --git a/autotests/libs/testresource/CMakeLists.txt b/autotests/libs/testresource/CMakeLists.txt
index ebbc66c..6ac1f5f 100644
--- a/autotests/libs/testresource/CMakeLists.txt
+++ b/autotests/libs/testresource/CMakeLists.txt
@@ -30,6 +30,9 @@ endmacro()
set( knutresource_SRCS knutresource.cpp)
+ecm_qt_declare_logging_category(knutresource_SRCS HEADER knutresource_debug.h IDENTIFIER KNUTRESOURCE_LOG CATEGORY_NAME org.kde.pim.knut)
+
+
kconfig_add_kcfg_files(knutresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/knutresource.kcfg org.kde.Akonadi.Knut.Settings)
diff --git a/autotests/libs/testresource/knutresource.cpp b/autotests/libs/testresource/knutresource.cpp
index bb4896a..7afb9c2 100644
--- a/autotests/libs/testresource/knutresource.cpp
+++ b/autotests/libs/testresource/knutresource.cpp
@@ -19,6 +19,7 @@
*/
#include "knutresource.h"
+#include "knutresource_debug.h"
#include "settings.h"
#include "settingsadaptor.h"
#include "xmlwriter.h"
@@ -234,7 +235,7 @@ void KnutResource::collectionChanged(const Akonadi::Collection &collection)
const int numberOfChildren = children.count();
for (int i = 0; i < numberOfChildren; ++i) {
const QDomElement child = children.at(i).toElement();
- qDebug() << "reparenting " << child.tagName() << child.attribute(QStringLiteral("rid"));
+ qCDebug(KNUTRESOURCE_LOG) << "reparenting " << child.tagName() << child.attribute(QStringLiteral("rid"));
if (child.isNull()) {
continue;
}
@@ -318,7 +319,7 @@ void KnutResource::itemMoved(const Item &item, const Collection &collectionSourc
{
const QDomElement oldElem = mDocument.itemElementByRemoteId(item.remoteId());
if (oldElem.isNull()) {
- qWarning() << "Moved item not found in DOM tree";
+ qCWarning(KNUTRESOURCE_LOG) << "Moved item not found in DOM tree";
changeProcessed();
return;
}
@@ -368,8 +369,8 @@ void KnutResource::search(const QString &query, const Collection &collection)
{
Q_UNUSED(collection);
const QVector<qint64> result = parseQuery(query).toList().toVector();
- qDebug() << "KNUT QUERY:" << query;
- qDebug() << "KNUT RESOURCE:" << result;
+ qCDebug(KNUTRESOURCE_LOG) << "KNUT QUERY:" << query;
+ qCDebug(KNUTRESOURCE_LOG) << "KNUT RESOURCE:" << result;
searchFinished(result, Akonadi::AgentSearchInterface::Uid);
}
@@ -378,13 +379,13 @@ void KnutResource::addSearch(const QString &query, const QString &queryLanguage,
Q_UNUSED(query);
Q_UNUSED(queryLanguage);
Q_UNUSED(resultCollection);
- qDebug();
+ qCDebug(KNUTRESOURCE_LOG);
}
void KnutResource::removeSearch(const Collection &resultCollection)
{
Q_UNUSED(resultCollection);
- qDebug();
+ qCDebug(KNUTRESOURCE_LOG);
}
AKONADI_RESOURCE_MAIN(KnutResource)