Commit c9e1a23c authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Use QLoggingCategory in AgentBase, Core and Widgets

parent 48e5d275
......@@ -2,3 +2,4 @@ log_akonadiagentserver akonadi (Akonadi Agent Server)
log_akonadiserver akonadi (Akonadi Server)
log_akonadiagentbase akonadi (Akonadi AgentBase Library)
log_akonadiwidgets akonadi (Akonadi Widget Library)
log_akonadiprivate akonadi (Akonadi Private Library)
......@@ -34,7 +34,7 @@ add_subdirectory(testsearchplugin)
# convenience macro to add akonadi qtestlib unit-tests
macro(add_akonadi_test _source)
set(_test ${_source})
set(_test ${_source} ${CMAKE_BINARY_DIR}/src/core/akonadicore_debug.cpp)
get_filename_component(_name ${_source} NAME_WE)
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
......@@ -45,7 +45,11 @@ endmacro()
# convenience macro to add akonadi qtestlib unit-tests
macro(add_akonadi_test_widgets _source)
set(_test ${_source})
set(_test
${_source}
${CMAKE_BINARY_DIR}/src/widgets/akonadiwidgets_debug.cpp
${CMAKE_BINARY_DIR}/src/core/akonadicore_debug.cpp
)
get_filename_component(_name ${_source} NAME_WE)
add_executable( ${_name} ${_test} )
add_test( ${_name} ${_name} )
......@@ -78,7 +82,11 @@ generate_export_header(akonaditestfake BASE_NAME akonaditestfake)
target_link_libraries(akonaditestfake Qt5::DBus KF5::AkonadiCore Qt5::Test Qt5::Widgets KF5::DBusAddons KF5::AkonadiPrivate)
add_executable( akonadi-firstrun ../../src/core/firstrun.cpp firstrunner.cpp )
add_executable(akonadi-firstrun
../../src/core/firstrun.cpp
firstrunner.cpp
${CMAKE_BINARY_DIR}/src/core/akonadicore_debug.cpp
)
target_link_libraries( akonadi-firstrun Qt5::Test Qt5::Core KF5::AkonadiCore KF5::DBusAddons KF5::ConfigCore Qt5::Widgets)
# qtestlib unit tests
......@@ -133,7 +141,7 @@ add_akonadi_isolated_test(itemcopytest.cpp)
add_akonadi_isolated_test(itemmovetest.cpp)
add_akonadi_isolated_test(collectioncopytest.cpp)
add_akonadi_isolated_test(collectionmovetest.cpp)
add_akonadi_isolated_test_advanced(collectionsynctest.cpp "" "KF5::I18n")
add_akonadi_isolated_test_advanced(collectionsynctest.cpp "${CMAKE_BINARY_DIR}/src/core/akonadicore_debug.cpp" "KF5::I18n")
add_akonadi_isolated_test(itemsynctest.cpp)
add_akonadi_isolated_test(linktest.cpp)
add_akonadi_isolated_test(cachetest.cpp)
......
......@@ -455,7 +455,8 @@ void AgentBasePrivate::delayedInit()
const QString serviceId = ServerManager::agentServiceName(ServerManager::Agent, mId);
if (!KDBusConnectionPool::threadConnection().registerService(serviceId)) {
qCritical() << "Unable to register service" << serviceId << "at dbus:" << KDBusConnectionPool::threadConnection().lastError().message();
qCCritical(AKONADIAGENTBASE_LOG) << "Unable to register service" << serviceId << "at dbus:"
<< KDBusConnectionPool::threadConnection().lastError().message();
}
q->setOnlineInternal(mDesiredOnlineState);
......
......@@ -78,7 +78,7 @@ void AgentSearchInterfacePrivate::collectionReceived(KJob *job)
{
CollectionFetchJob *fetchJob = qobject_cast<CollectionFetchJob *>(job);
if (fetchJob->error()) {
qCritical() << fetchJob->errorString();
qCCritical(AKONADIAGENTBASE_LOG) << fetchJob->errorString();
new SearchResultJob(fetchJob->property("searchId").toByteArray(), Collection(mCollectionId), this);
return;
}
......
......@@ -47,7 +47,8 @@ PreprocessorBasePrivate::PreprocessorBasePrivate(PreprocessorBase *parent)
void PreprocessorBasePrivate::delayedInit()
{
if (!KDBusConnectionPool::threadConnection().registerService(ServerManager::agentServiceName(ServerManager::Preprocessor, mId))) {
qCritical() << "Unable to register service at D-Bus: " << KDBusConnectionPool::threadConnection().lastError().message();
qCCritical(AKONADIAGENTBASE_LOG) << "Unable to register service at D-Bus: "
<< KDBusConnectionPool::threadConnection().lastError().message();
}
AgentBasePrivate::delayedInit();
}
......
......@@ -52,7 +52,6 @@
#include "akonadiagentbase_debug.h"
#include <KLocalizedString>
#include <QtCore/QDebug>
#include <QtCore/QDir>
#include <QtCore/QHash>
#include <QtCore/QSettings>
......@@ -109,7 +108,7 @@ public:
if (reason.isEmpty()) {
reason = QStringLiteral("this service is probably running already.");
}
qCritical() << "Unable to register service" << serviceId << "at D-Bus:" << reason;
qCCritical(AKONADIAGENTBASE_LOG) << "Unable to register service" << serviceId << "at D-Bus:" << reason;
if (QThread::currentThread() == QCoreApplication::instance()->thread()) {
QCoreApplication::instance()->exit(1);
......
......@@ -398,12 +398,12 @@ void ResourceScheduler::executeNext()
}
if (!success) {
qCritical() << "Could not invoke slot" << mCurrentTask.methodName << "on" << mCurrentTask.receiver << "with argument" << mCurrentTask.argument;
qCCritical(AKONADIAGENTBASE_LOG) << "Could not invoke slot" << mCurrentTask.methodName << "on" << mCurrentTask.receiver << "with argument" << mCurrentTask.argument;
}
break;
}
default: {
qCritical() << "Unhandled task type" << mCurrentTask.type;
qCCritical(AKONADIAGENTBASE_LOG) << "Unhandled task type" << mCurrentTask.type;
dump();
Q_ASSERT(false);
}
......@@ -497,7 +497,7 @@ void ResourceScheduler::Task::sendDBusReplies(const QString &errorMsg)
} else if (methodName.isEmpty()) {
continue; // unittest calls scheduleItemFetch with empty QDBusMessage
} else {
qCritical() << "Got unexpected member:" << methodName;
qCCritical(AKONADIAGENTBASE_LOG) << "Got unexpected member:" << methodName;
}
KDBusConnectionPool::threadConnection().send(reply);
}
......
......@@ -283,6 +283,8 @@ set(akonadicore_SRCS
${akonadicore_dbus_SRCS}
)
ecm_qt_declare_logging_category(akonadicore_SRCS HEADER akonadicore_debug.h IDENTIFIER AKONADICORE_LOG CATEGORY_NAME akonadicore_log)
add_library(KF5AkonadiCore ${akonadicore_SRCS})
generate_export_header(KF5AkonadiCore BASE_NAME akonadicore)
......
......@@ -24,7 +24,7 @@
#include "agentmanager_p.h"
#include "servermanager.h"
#include <QDebug>
#include "akonadicore_debug.h"
using namespace Akonadi;
......@@ -139,10 +139,10 @@ void AgentInstance::abortCurrentTask() const
if (iface.isValid()) {
QDBusReply<void> reply = iface.call(QStringLiteral("abort"));
if (!reply.isValid()) {
qWarning() << "Failed to place D-Bus call.";
qCWarning(AKONADICORE_LOG) << "Failed to place D-Bus call.";
}
} else {
qWarning() << "Unable to obtain agent interface";
qCWarning(AKONADICORE_LOG) << "Unable to obtain agent interface";
}
}
......@@ -154,10 +154,10 @@ void AgentInstance::reconfigure() const
if (iface.isValid()) {
QDBusReply<void> reply = iface.call(QStringLiteral("reconfigure"));
if (!reply.isValid()) {
qWarning() << "Failed to place D-Bus call.";
qCWarning(AKONADICORE_LOG) << "Failed to place D-Bus call.";
}
} else {
qWarning() << "Unable to obtain agent interface";
qCWarning(AKONADICORE_LOG) << "Unable to obtain agent interface";
}
}
......@@ -169,9 +169,9 @@ void Akonadi::AgentInstance::restart() const
if (iface.isValid()) {
QDBusReply<void> reply = iface.call(QStringLiteral("restartAgentInstance"), identifier());
if (!reply.isValid()) {
qWarning() << "Failed to place D-Bus call.";
qCWarning(AKONADICORE_LOG) << "Failed to place D-Bus call.";
}
} else {
qWarning() << "Unable to obtain control interface" << iface.lastError().message();
qCWarning(AKONADICORE_LOG) << "Unable to obtain control interface" << iface.lastError().message();
}
}
......@@ -19,6 +19,7 @@
#include "asyncselectionhandler_p.h"
#include "models/entitytreemodel.h"
#include "akonadicore_debug.h"
using namespace Akonadi;
......@@ -57,7 +58,7 @@ bool AsyncSelectionHandler::scanSubTree(const QModelIndex &index, bool searchFor
const QModelIndex childIndex = mModel->index(row, 0, index);
//This should not normally happen, but if it does we end up in an endless loop
if (!childIndex.isValid()) {
qWarning() << "Invalid child detected: " << index.data().toString();
qCWarning(AKONADICORE_LOG) << "Invalid child detected: " << index.data().toString();
Q_ASSERT(false);
return false;
}
......
......@@ -25,6 +25,7 @@
#include "notificationmanagerinterface.h"
#include "changemediator_p.h"
#include "servermanager.h"
#include "akonadicore_debug.h"
#include <KRandom>
#include <qdbusextratypes.h>
......@@ -56,7 +57,7 @@ NotificationSource *ChangeNotificationDependenciesFactory::createNotificationSou
QDBusObjectPath p = manager->subscribe(name, false);
const bool validError = manager->lastError().isValid();
if (validError) {
qWarning() << manager->lastError().name() << manager->lastError().message();
qCWarning(AKONADICORE_LOG) << manager->lastError().name() << manager->lastError().message();
// :TODO: What to do?
delete manager;
return 0;
......
......@@ -18,6 +18,7 @@
*/
#include "changerecorder_p.h"
#include "akonadicore_debug.h"
#include <QtCore/QFile>
#include <QtCore/QDir>
......@@ -383,14 +384,14 @@ void ChangeRecorderPrivate::writeStartOffset()
QFile file(notificationsFileName());
if (!file.open(QIODevice::ReadWrite)) {
qWarning() << "Could not update notifications in file" << file.fileName();
qCWarning(AKONADICORE_LOG) << "Could not update notifications in file" << file.fileName();
return;
}
// Skip "countAndVersion"
file.seek(8);
//qDebug() << "Writing start offset=" << m_startOffset;
//qCDebug(AKONADICORE_LOG) << "Writing start offset=" << m_startOffset;
QDataStream stream(&file);
stream.setVersion(QDataStream::Qt_4_6);
......@@ -412,7 +413,7 @@ void ChangeRecorderPrivate::saveNotifications()
dir.mkpath(info.absolutePath());
}
if (!file.open(QIODevice::WriteOnly)) {
qWarning() << "Could not save notifications to file" << file.fileName();
qCWarning(AKONADICORE_LOG) << "Could not save notifications to file" << file.fileName();
return;
}
saveTo(&file);
......@@ -433,7 +434,7 @@ void ChangeRecorderPrivate::saveTo(QIODevice *device)
stream << countAndVersion;
stream << quint64(0); // no start offset
//qDebug() << "Saving" << pendingNotifications.count() << "notifications (full save)";
//qCDebug(AKONADICORE_LOG) << "Saving" << pendingNotifications.count() << "notifications (full save)";
for (int i = 0; i < pendingNotifications.count(); ++i) {
const Protocol::ChangeNotification msg = pendingNotifications.at(i);
......@@ -447,7 +448,7 @@ void ChangeRecorderPrivate::notificationsEnqueued(int count)
if (enableChangeRecording) {
m_lastKnownNotificationsCount += count;
if (m_lastKnownNotificationsCount != pendingNotifications.count()) {
qWarning() << this << "The number of pending notifications changed without telling us! Expected"
qCWarning(AKONADICORE_LOG) << this << "The number of pending notifications changed without telling us! Expected"
<< m_lastKnownNotificationsCount << "but got" << pendingNotifications.count()
<< "Caller just added" << count;
Q_ASSERT(pendingNotifications.count() == m_lastKnownNotificationsCount);
......
......@@ -22,6 +22,8 @@
#include "collectionfetchjob.h"
#include "job_p.h"
#include "akonadicore_debug.h"
#include <KLocalizedString>
#include <QtCore/QStringList>
......@@ -123,7 +125,7 @@ void CollectionPathResolverPrivate::jobResult(KJob *job)
}
}
if (!found) {
qWarning() << "No such collection" << currentPart << "with parent" << mCurrentNode.id();
qCWarning(AKONADICORE_LOG) << "No such collection" << currentPart << "with parent" << mCurrentNode.id();
mColId = -1;
q->setError(CollectionPathResolver::Unknown);
q->setErrorText(i18n("No such collection."));
......
......@@ -19,7 +19,7 @@
#include "collectionsync_p.h"
#include "collection.h"
#include "akonadicore_debug.h"
#include "collectioncreatejob.h"
#include "collectiondeletejob.h"
#include "collectionfetchjob.h"
......@@ -29,7 +29,6 @@
#include "cachepolicy.h"
#include <qdebug.h>
#include <KLocalizedString>
#include <QtCore/QVariant>
#include <QTime>
......@@ -498,7 +497,7 @@ public:
currentTransaction->rollback();
q->setError(Unknown);
q->setErrorText(i18n("Found unresolved orphan collections"));
qWarning() << "found unresolved orphan collection";
qCWarning(AKONADICORE_LOG) << "found unresolved orphan collection";
emitResult();
return;
}
......@@ -677,7 +676,7 @@ public:
*/
void execute()
{
qDebug() << "localListDone: " << localListDone << " deliveryDone: " << deliveryDone;
qCDebug(AKONADICORE_LOG) << "localListDone: " << localListDone << " deliveryDone: " << deliveryDone;
if (!localListDone && !deliveryDone) {
return;
}
......@@ -699,7 +698,7 @@ public:
if (!currentTransaction) {
// There's nothing to do after local listing -> we are done!
if (remoteCollectionsToCreate.isEmpty() && remoteCollectionsToUpdate.isEmpty() && localCollectionsToRemove.isEmpty()) {
qDebug() << "Nothing to do";
qCDebug(AKONADICORE_LOG) << "Nothing to do";
emitResult();
return;
}
......
......@@ -20,6 +20,7 @@
#include "connectionthread_p.h"
#include "session_p.h"
#include "servermanager_p.h"
#include "akonadicore_debug.h"
#include <QtCore/QDataStream>
#include <QtCore/QFile>
......@@ -55,7 +56,7 @@ ConnectionThread::ConnectionThread(const QByteArray &sessionId, QObject *parent)
.arg(QString::number(QApplication::applicationPid()))
.arg(QString::fromLatin1(mSessionId.replace('/', '_'))));
if (!mLogFile->open(QIODevice::WriteOnly | QIODevice::Truncate)) {
qWarning() << "Failed to open Akonadi Session log file" << mLogFile->fileName();
qCWarning(AKONADICORE_LOG) << "Failed to open Akonadi Session log file" << mLogFile->fileName();
delete mLogFile;
mLogFile = Q_NULLPTR;
}
......@@ -118,7 +119,7 @@ void ConnectionThread::doReconnect()
}
options.insert(pair.first(), pair.last());
}
qDebug() << protocol << options;
qCDebug(AKONADICORE_LOG) << protocol << options;
if (protocol == "unix") {
serverAddress = options.value(QStringLiteral("path"));
......@@ -132,10 +133,10 @@ void ConnectionThread::doReconnect()
const QString connectionConfigFile = SessionPrivate::connectionFile();
const QFileInfo fileInfo(connectionConfigFile);
if (!fileInfo.exists()) {
qDebug() << "Akonadi Client Session: connection config file '"
"akonadi/akonadiconnectionrc' can not be found in"
<< XdgBaseDirs::homePath("config") << "nor in any of"
<< XdgBaseDirs::systemPathList("config");
qCDebug(AKONADICORE_LOG) << "Akonadi Client Session: connection config file '"
"akonadi/akonadiconnectionrc' can not be found in"
<< XdgBaseDirs::homePath("config") << "nor in any of"
<< XdgBaseDirs::systemPathList("config");
}
const QSettings connectionSettings(connectionConfigFile, QSettings::IniFormat);
......@@ -157,7 +158,7 @@ void ConnectionThread::doReconnect()
}
// actually do connect
qDebug() << "connectToServer" << serverAddress;
qCDebug(AKONADICORE_LOG) << "connectToServer" << serverAddress;
mSocket->connectToServer(serverAddress);
Q_EMIT reconnected();
......@@ -220,7 +221,7 @@ void ConnectionThread::dataReceived()
// cmd's type will be Invalid by default.
}
if (cmd.type() == Protocol::Command::Invalid) {
qWarning() << "Invalid command, the world is going to end!";
qCWarning(AKONADICORE_LOG) << "Invalid command, the world is going to end!";
mSocket->close();
mSocket->readAll();
reconnect();
......@@ -284,7 +285,7 @@ void ConnectionThread::doSendCommand(qint64 tag, const Protocol::Command &cmd)
try {
Protocol::serialize(mSocket, cmd);
} catch (const Akonadi::ProtocolException &e) {
qWarning() << "Protocol Exception:" << QString::fromUtf8(e.what());
qCWarning(AKONADICORE_LOG) << "Protocol Exception:" << QString::fromUtf8(e.what());
mSocket->close();
mSocket->readAll();
reconnect();
......
......@@ -19,8 +19,7 @@
#include "control.h"
#include "servermanager.h"
#include <qdebug.h>
#include "akonadicore_debug.h"
#include <QtCore/QEventLoop>
#include <QtCore/QCoreApplication>
......@@ -83,14 +82,14 @@ public:
bool Control::Private::exec()
{
qDebug() << "Starting/Stopping Akonadi (using an event loop).";
qCDebug(AKONADICORE_LOG) << "Starting/Stopping Akonadi (using an event loop).";
mEventLoop = new QEventLoop(mParent);
mEventLoop->exec();
mEventLoop->deleteLater();
mEventLoop = 0;
if (!mSuccess) {
qWarning() << "Could not start/stop Akonadi!";
qCWarning(AKONADICORE_LOG) << "Could not start/stop Akonadi!";
}
mStarting = false;
......@@ -103,7 +102,7 @@ bool Control::Private::exec()
void Control::Private::serverStateChanged(ServerManager::State state)
{
qDebug() << state;
qCDebug(AKONADICORE_LOG) << state;
if (mEventLoop && mEventLoop->isRunning()) {
// ignore transient states going into the right direction
if ((mStarting && (state == ServerManager::Starting || state == ServerManager::Upgrading)) ||
......@@ -135,16 +134,16 @@ Control::~Control()
bool Control::start()
{
if (ServerManager::state() == ServerManager::Stopping) {
qDebug() << "Server is currently being stopped, wont try to start it now";
qCDebug(AKONADICORE_LOG) << "Server is currently being stopped, wont try to start it now";
return false;
}
if (ServerManager::isRunning() || s_instance->d->mEventLoop) {
qDebug() << "Server is already running";
qCDebug(AKONADICORE_LOG) << "Server is already running";
return true;
}
s_instance->d->mStarting = true;
if (!ServerManager::start()) {
qDebug() << "ServerManager::start failed -> return false";
qCDebug(AKONADICORE_LOG) << "ServerManager::start failed -> return false";
return false;
}
return s_instance->d->exec();
......
......@@ -21,6 +21,8 @@
#include "private/imapparser_p.h"
#include "akonadicore_debug.h"
#include <QtCore/QByteArray>
#include <QtCore/QString>
......@@ -50,12 +52,12 @@ void EntityDeletedAttribute::setRestoreCollection(const Akonadi::Collection &col
{
Q_D(EntityDeletedAttribute);
if (!collection.isValid()) {
qWarning() << "invalid collection" << collection;
qCWarning(AKONADICORE_LOG) << "invalid collection" << collection;
}
Q_ASSERT(collection.isValid());
d->restoreCollection = collection;
if (collection.resource().isEmpty()) {
qWarning() << "no resource set";
qCWarning(AKONADICORE_LOG) << "no resource set";
}
d->restoreResource = collection.resource();
}
......@@ -107,7 +109,7 @@ void EntityDeletedAttribute::deserialize(const QByteArray &data)
QList<QByteArray> l;
ImapParser::parseParenthesizedList(data, l);
if (l.size() != 2) {
qWarning() << "invalid size";
qCWarning(AKONADICORE_LOG) << "invalid size";
return;
}
d->restoreResource = QString::fromUtf8(l[0]);
......
......@@ -26,9 +26,10 @@
#include "agentmanager.h"
#include "agenttype.h"
#include "akonadicore_debug.h"
#include <KConfig>
#include <KConfigGroup>
#include <QDebug>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusInterface>
......@@ -55,13 +56,13 @@ Firstrun::Firstrun(QObject *parent)
deleteLater();
return;
}
qDebug();
qCDebug(AKONADICORE_LOG);
if (KDBusConnectionPool::threadConnection().registerService(QLatin1String(FIRSTRUN_DBUSLOCK))) {
findPendingDefaults();
qDebug() << mPendingDefaults;
qCDebug(AKONADICORE_LOG) << mPendingDefaults;
setupNext();
} else {
qDebug() << "D-Bus lock found, so someone else does the work for us already.";
qCDebug(AKONADICORE_LOG) << "D-Bus lock found, so someone else does the work for us already.";
deleteLater();
}
}
......@@ -72,7 +73,7 @@ Firstrun::~Firstrun()
KDBusConnectionPool::threadConnection().unregisterService(QLatin1String(FIRSTRUN_DBUSLOCK));
}
delete mConfig;
qDebug() << "done";
qCDebug(AKONADICORE_LOG) << "done";
}
void Firstrun::findPendingDefaults()
......@@ -86,7 +87,7 @@ void Firstrun::findPendingDefaults()
KConfig c(fullName);
const QString id = KConfigGroup(&c, "Agent").readEntry("Id", QString());
if (id.isEmpty()) {
qWarning() << "Found invalid default configuration in " << fullName;
qCWarning(AKONADICORE_LOG) << "Found invalid default configuration in " << fullName;
continue;
}
if (cfg.hasKey(id)) {
......@@ -113,7 +114,7 @@ void Firstrun::setupNext()
AgentType type = AgentManager::self()->type(agentCfg.readEntry("Type", QString()));
if (!type.isValid()) {
qCritical() << "Unable to obtain agent type for default resource agent configuration " << mCurrentDefault->name();
qCCritical(AKONADICORE_LOG) << "Unable to obtain agent type for default resource agent configuration " << mCurrentDefault->name();
setupNext();
return;
}
......@@ -140,7 +141,7 @@ void Firstrun::instanceCreated(KJob *job)
Q_ASSERT(mCurrentDefault);
if (job->error()) {
qCritical() << "Creating agent instance failed for " << mCurrentDefault->name();
qCCritical(AKONADICORE_LOG) << "Creating agent instance failed for " << mCurrentDefault->name();
setupNext();
return;
}
......@@ -157,7 +158,7 @@ void Firstrun::instanceCreated(KJob *job)
QStringLiteral("/Settings"), QString(),
KDBusConnectionPool::threadConnection(), this);
if (!iface->isValid()) {
qCritical() << "Unable to obtain the KConfigXT D-Bus interface of " << instance.identifier();
qCCritical(AKONADICORE_LOG) << "Unable to obtain the KConfigXT D-Bus interface of " << instance.identifier();
setupNext();
delete iface;
return;
......@@ -166,11 +167,11 @@ void Firstrun::instanceCreated(KJob *job)
const KConfigGroup settings = KConfigGroup(mCurrentDefault, "Settings");
foreach (const QString &setting, settings.keyList()) {
qDebug() << "Setting up " << setting << " for agent " << instance.identifier();
qCDebug(AKONADICORE_LOG) << "Setting up " << setting << " for agent " << instance.identifier();
const QString methodName = QStringLiteral("set%1").arg(setting);
const QVariant::Type argType = argumentType(iface->metaObject(), methodName);
if (argType == QVariant::Invalid) {
qCritical() << "Setting " << setting << " not found in agent configuration interface of " << instance.identifier();
qCCritical(AKONADICORE_LOG) << "Setting " << setting << " not found in agent configuration interface of " << instance.identifier();
continue;
}
......@@ -185,7 +186,7 @@ void Firstrun::instanceCreated(KJob *job)
const QDBusReply<void> reply = iface->call(methodName, arg);
if (!reply.isValid()) {
qCritical() << "Setting " << setting << " failed for agent " << instance.identifier();
qCCritical(AKONADICORE_LOG) << "Setting " << setting << " failed for agent " << instance.identifier();
}
}
......
......@@ -19,12 +19,11 @@
#include "item.h"
#include "item_p.h"
#include "akonadicore_debug.h"
#include "itemserializer_p.h"
#include "private/protocol_p.h"
#include <QUrl>
#include <qdebug.h>
#include <QUrlQuery>
#include <QtCore/QStringList>
......@@ -610,10 +609,10 @@ bool Item::ensureMetaTypeId(int mtid) const
Item converted = ItemSerializer::convert(*this, mtid);
return d_ptr->movePayloadFrom(converted.d_ptr, mtid);
} catch (const std::exception &e) {
qDebug() << "conversion threw:" << e.what();
qCDebug(AKONADICORE_LOG) << "conversion threw:" << e.what();
return false;
} catch (...) {
qDebug() << "conversion threw something not derived from std::exception: fix the program!";
qCDebug(AKONADICORE_LOG) << "conversion threw something not derived from std::exception: fix the program!";
return false;
}