From 3f24ccd39a31edde9e79f8501ef98f7701813d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80lex=20Fiestas?= Date: Mon, 22 Sep 2014 00:20:14 +0200 Subject: [PATCH] Port the kio from kDebug to qCDebug Use custom area for the kio "kdeconnect.kio" --- kio/kiokdeconnect.cpp | 16 +++++++++------- kio/kiokdeconnect.h | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp index e2442a7cb..d803a538f 100644 --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include @@ -35,6 +35,8 @@ #include +Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") + extern "C" int KDE_EXPORT kdemain(int argc, char **argv) { K4AboutData about("kiokdeconnect", "kdeconnect-kio", ki18n("kiokdeconnect"), "1.0"); @@ -75,7 +77,7 @@ bool handleDBusError(QDBusReply& reply, KIO::SlaveBase* slave) { if (!reply.isValid()) { - kDebug(debugArea()) << "Error in DBus request:" << reply.error(); + qCDebug(KDECONNECT_KIO) << "Error in DBus request:" << reply.error(); slave->error(toKioError(reply.error().type()),reply.error().message()); return true; } @@ -130,7 +132,7 @@ void KioKdeconnect::listDevice() { infoMessage(i18n("Accessing device...")); - kDebug(debugArea()) << "ListDevice" << m_currentDevice; + qCDebug(KDECONNECT_KIO) << "ListDevice" << m_currentDevice; SftpDbusInterface interface(m_currentDevice); @@ -185,7 +187,7 @@ void KioKdeconnect::listDevice() void KioKdeconnect::listDir(const QUrl &url) { - kDebug(debugArea()) << "Listing..." << url; + qCDebug(KDECONNECT_KIO) << "Listing..." << url; /// Url is not used here becuase all we could care about the url is the host, and that's already /// handled in @p setHost @@ -207,7 +209,7 @@ void KioKdeconnect::listDir(const QUrl &url) void KioKdeconnect::stat(const QUrl &url) { - kDebug(debugArea()) << "Stat: " << url; + qCDebug(KDECONNECT_KIO) << "Stat: " << url; KIO::UDSEntry entry; entry.insert(KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR); @@ -218,7 +220,7 @@ void KioKdeconnect::stat(const QUrl &url) void KioKdeconnect::get(const QUrl &url) { - kDebug(debugArea()) << "Get: " << url; + qCDebug(KDECONNECT_KIO) << "Get: " << url; mimeType(""); finished(); } @@ -228,7 +230,7 @@ void KioKdeconnect::setHost(const QString &hostName, quint16 port, const QString //This is called before everything else to set the file we want to show - kDebug(debugArea()) << "Setting host: " << hostName; + qCDebug(KDECONNECT_KIO) << "Setting host: " << hostName; // In this kio only the hostname is used Q_UNUSED(port) diff --git a/kio/kiokdeconnect.h b/kio/kiokdeconnect.h index 48c7c7ab7..f655cb226 100644 --- a/kio/kiokdeconnect.h +++ b/kio/kiokdeconnect.h @@ -22,11 +22,14 @@ #define KIOKDECONNECT_H #include +#include #include #include "interfaces/dbusinterfaces.h" +Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_KIO) + class KioKdeconnect : public QObject, public KIO::SlaveBase { Q_OBJECT