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

Port the rest of Akonadi from akDebug to qCDebug

parent 08186db0
......@@ -5,6 +5,7 @@ include_directories(${Akonadi_SOURCE_DIR}/src/akonadicontrol
macro(add_unit_test _source)
set(_test ${_source}
${Akonadi_BINARY_DIR}/src/akonadicontrol/akonadicontrol_debug.cpp
${Akonadi_SOURCE_DIR}/src/akonadicontrol/agenttype.cpp
)
get_filename_component(_name ${_source} NAME_WE)
......
......@@ -58,8 +58,8 @@ public:
try {
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -24,7 +24,6 @@
#include "fakeakonadiserver.h"
#include "fakedatastore.h"
#include <shared/aktest.h>
#include <shared/akdebug.h>
#include "entities.h"
#include "collectionreferencemanager.h"
#include "dbinitializer.h"
......@@ -52,8 +51,8 @@ public:
FakeAkonadiServer::instance()->setPopulateDb(false);
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
initializer.createResource("testresource");
......
......@@ -24,7 +24,6 @@
#include "fakeakonadiserver.h"
#include "dbinitializer.h"
#include "aktest.h"
#include "akdebug.h"
#include "entities.h"
#include <private/scope_p.h>
......@@ -44,8 +43,8 @@ public:
try {
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -17,8 +17,8 @@
02110-1301, USA.
*/
#include "dbinitializer.h"
#include "akonadiserver_debug.h"
#include <shared/akdebug.h>
#include <storage/querybuilder.h>
#include <storage/datastore.h>
......
......@@ -196,11 +196,11 @@
<!-- Call .insert() //-->
if (!<xsl:value-of select="$variable" />.insert()) {
akError() &lt;&lt; "Failed to insert <xsl:value-of select="$variable" /> into database";
akError() &lt;&lt; "DB Error:" &lt;&lt; FakeDataStore::self()->database().lastError().text();
qWarning() &lt;&lt; "Failed to insert <xsl:value-of select="$variable" /> into database";
qWarning() &lt;&lt; "DB Error:" &lt;&lt; FakeDataStore::self()->database().lastError().text();
return false;
}
akDebug() &lt;&lt; "<xsl:value-of select="local-name()" /> '<xsl:choose>
qDebug() &lt;&lt; "<xsl:value-of select="local-name()" /> '<xsl:choose>
<xsl:when test="local-name() = 'PimItem'">
<xsl:value-of select="$table/@remoteId" />
</xsl:when>
......@@ -307,7 +307,6 @@
* Do not edit! All changes made to it will be lost.
*/
#include &lt;shared/akdebug.h&gt;
#include "dbpopulator.h"
#include "entities.h"
#include "fakedatastore.h"
......@@ -377,7 +376,7 @@ bool DbPopulator::run()
</xsl:call-template>
</xsl:for-each>
akDebug() &lt;&lt; "Database successfully populated";
qDebug() &lt;&lt; "Database successfully populated";
return true;
}
......
......@@ -20,7 +20,6 @@
#include "fakeclient.h"
#include "fakeakonadiserver.h"
#include <shared/akdebug.h>
#include <private/protocol_p.h>
#include <QTest>
......@@ -164,7 +163,7 @@ void FakeClient::run()
connect(mSocket, &QIODevice::readyRead, this, &FakeClient::dataAvailable);
connect(mSocket, &QLocalSocket::disconnected, this, &FakeClient::connectionLost);
if (!mSocket->waitForConnected()) {
akFatal() << "Failed to connect to FakeAkonadiServer";
qFatal("Failed to connect to FakeAkonadiServer");
}
mStream.setDevice(mSocket);
......
......@@ -77,7 +77,7 @@ bool FakeDataStore::init()
if (mPopulateDb) {
DbPopulator dbPopulator;
if (!dbPopulator.run()) {
akError() << "Failed to populate database";
qWarning() << "Failed to populate database";
return false;
}
}
......
......@@ -24,7 +24,6 @@
#include "fakeakonadiserver.h"
#include "aktest.h"
#include "akdebug.h"
#include "entities.h"
#include "dbinitializer.h"
......@@ -51,8 +50,8 @@ public:
FakeAkonadiServer::instance()->setPopulateDb(false);
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -23,7 +23,6 @@
#include "fakeakonadiserver.h"
#include <shared/aktest.h>
#include <shared/akdebug.h>
#include "entities.h"
#include <private/scope_p.h>
......@@ -45,8 +44,8 @@ public:
try {
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -26,7 +26,6 @@
#include "fakeakonadiserver.h"
#include "aktest.h"
#include "akdebug.h"
#include "entities.h"
#include "dbinitializer.h"
#include <storage/storagedebugger.h>
......@@ -48,8 +47,8 @@ public:
FakeAkonadiServer::instance()->setPopulateDb(false);
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
{
MimeType mt(QLatin1String("mimetype1"));
......
......@@ -23,7 +23,6 @@
#include "fakeakonadiserver.h"
#include "aktest.h"
#include "akdebug.h"
#include "entities.h"
#include <private/scope_p.h>
......@@ -46,8 +45,8 @@ public:
try {
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -21,7 +21,6 @@
#include "fakeakonadiserver.h"
#include "fakeconnection.h"
#include "akdebug.h"
#include "aktest.h"
#include "entities.h"
......@@ -56,8 +55,8 @@ public:
try {
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -24,7 +24,6 @@
#include "fakeakonadiserver.h"
#include "aktest.h"
#include "akdebug.h"
#include "entities.h"
#include "dbinitializer.h"
......@@ -68,8 +67,8 @@ public:
FakeAkonadiServer::instance()->setPopulateDb(false);
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qDebug() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
RelationType type;
......
......@@ -19,7 +19,6 @@
#include "fakeakonadiserver.h"
#include "handler/searchhelper.h"
#include "akdebug.h"
#include "aktest.h"
#include <entities.h>
......@@ -43,8 +42,8 @@ public:
FakeAkonadiServer::instance()->setPopulateDb(false);
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -24,7 +24,6 @@
#include "fakeakonadiserver.h"
#include "aktest.h"
#include "akdebug.h"
#include "entities.h"
#include "dbinitializer.h"
......@@ -73,8 +72,8 @@ public:
FakeAkonadiServer::instance()->setPopulateDb(false);
FakeAkonadiServer::instance()->init();
} catch (const FakeAkonadiServerException &e) {
akError() << "Server exception: " << e.what();
akFatal() << "Fake Akonadi Server failed to start up, aborting test";
qWarning() << "Server exception: " << e.what();
qFatal("Fake Akonadi Server failed to start up, aborting test");
}
}
......
......@@ -17,6 +17,7 @@
02110-1301, USA.
*/
#include "agentpluginloader.h"
#include "akonadiagentserver_debug.h"
#include <private/xdgbasedirs_p.h>
#include <shared/akdebug.h>
......@@ -37,7 +38,7 @@ QPluginLoader *AgentPluginLoader::load(const QString &pluginName)
{
const QString pluginFile = XdgBaseDirs::findPluginFile(pluginName);
if (pluginFile.isEmpty()) {
akError() << Q_FUNC_INFO << "plugin file:" << pluginName << "not found!";
qCWarning(AKONADIAGENTSERVER_LOG) << "plugin file:" << pluginName << "not found!";
return 0;
}
......@@ -46,7 +47,7 @@ QPluginLoader *AgentPluginLoader::load(const QString &pluginName)
} else {
QPluginLoader *loader = new QPluginLoader(pluginFile);
if (!loader->load()) {
akError() << Q_FUNC_INFO << "Failed to load agent: " << loader->errorString();
qCWarning(AKONADIAGENTSERVER_LOG) << "Failed to load agent: " << loader->errorString();
delete loader;
return 0;
}
......
......@@ -23,7 +23,6 @@
#include <private/xdgbasedirs_p.h>
#include <private/dbus_p.h>
#include <shared/akdebug.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
......@@ -65,7 +64,7 @@ bool AgentServer::started(const QString &identifier) const
void AgentServer::startAgent(const QString &identifier, const QString &typeIdentifier, const QString &fileName)
{
akDebug() << Q_FUNC_INFO << identifier << typeIdentifier << fileName;
qCDebug(AKONADIAGENTSERVER_LOG) << identifier << typeIdentifier << fileName;
//First try to load it staticly
Q_FOREACH (QObject *plugin, QPluginLoader::staticInstances()) {
......
......@@ -21,7 +21,6 @@
#include "akonadiagentserver_debug.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QPluginLoader>
#include <QWidget> // Needed for WId
......
......@@ -18,11 +18,11 @@
*/
#include "agentserver.h"
#include "akonadiagentserver_debug.h"
#include <private/dbus_p.h>
#include <shared/akapplication.h>
#include <shared/akdebug.h>
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusConnectionInterface>
......@@ -37,14 +37,14 @@ int main(int argc, char **argv)
qApp->setQuitOnLastWindowClosed(false);
if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(Akonadi::DBus::serviceName(Akonadi::DBus::ControlLock))) {
akError() << "Akonadi control process not found - aborting.";
akFatal() << "If you started akonadi_agent_server manually, try 'akonadictl start' instead.";
qCCritical(AKONADIAGENTSERVER_LOG) << "Akonadi control process not found - aborting.";
qFatal("If you started akonadi_agent_server manually, try 'akonadictl start' instead.");
}
new Akonadi::AgentServer(&app);
if (!QDBusConnection::sessionBus().registerService(Akonadi::DBus::serviceName(Akonadi::DBus::AgentServer))) {
akFatal() << "Unable to connect to dbus service: " << QDBusConnection::sessionBus().lastError().message();
qFatal("Unable to connect to dbus service: %s", qPrintable(QDBusConnection::sessionBus().lastError().message()));
}
return app.exec();
......
Supports Markdown
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