From d971269bd5ff8fea80619c3f21caeca4b245d923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80lex=20Fiestas?= Date: Mon, 22 Sep 2014 00:59:34 +0200 Subject: [PATCH] Remove kdebugnamespace completely and replace by core_debug In those places that belong to "core" we use core_debug, in any other place we have added custom logging categories so we use those instead. --- core/backends/lan/landevicelink.cpp | 1 + core/backends/lan/lanlinkprovider.cpp | 3 +-- core/backends/lan/uploadjob.cpp | 2 +- core/backends/loopback/loopbacklinkprovider.cpp | 2 +- core/{kdebugnamespace.h => core_debug.h} | 17 +++-------------- core/daemon.cpp | 3 ++- core/device.cpp | 2 +- core/filetransferjob.cpp | 6 +++--- core/kdeconnectplugin.cpp | 1 + core/networkpackage.cpp | 2 ++ core/networkpackage.h | 1 - core/pluginloader.cpp | 2 +- kio/kiokdeconnect.cpp | 2 -- plugins/battery/batterydbusinterface.cpp | 1 - plugins/ping/pingplugin.h | 2 +- plugins/share/autoclosingqfile.h | 2 -- plugins/share/share_config.cpp | 2 -- 17 files changed, 18 insertions(+), 33 deletions(-) rename core/{kdebugnamespace.h => core_debug.h} (74%) diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp index c2c908323..bdedbeabe 100644 --- a/core/backends/lan/landevicelink.cpp +++ b/core/backends/lan/landevicelink.cpp @@ -19,6 +19,7 @@ */ #include "landevicelink.h" +#include "core_debug.h" #include #include diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index a9644b2df..f352aeaf1 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -19,6 +19,7 @@ */ #include "lanlinkprovider.h" +#include "core_debug.h" #include #include @@ -29,7 +30,6 @@ #include #include -#include "../../kdebugnamespace.h" #include "landevicelink.h" void LanLinkProvider::configureSocket(QTcpSocket* socket) @@ -151,7 +151,6 @@ void LanLinkProvider::connectError() disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); disconnect(socket, SIGNAL(connected()), this, SLOT(connected())); - qCDebug(KDECONNECT_CORE) << "Fallback (1), try reverse connection"; NetworkPackage np(""); NetworkPackage::createIdentityPackage(&np); np.set("tcpPort", mTcpPort); diff --git a/core/backends/lan/uploadjob.cpp b/core/backends/lan/uploadjob.cpp index d5d3f089a..8df673d0e 100644 --- a/core/backends/lan/uploadjob.cpp +++ b/core/backends/lan/uploadjob.cpp @@ -20,8 +20,8 @@ #include -#include "kdebugnamespace.h" #include "uploadjob.h" +#include "core_debug.h" UploadJob::UploadJob(const QSharedPointer& source): KJob() { diff --git a/core/backends/loopback/loopbacklinkprovider.cpp b/core/backends/loopback/loopbacklinkprovider.cpp index df793a6dd..cbfc6c6d6 100644 --- a/core/backends/loopback/loopbacklinkprovider.cpp +++ b/core/backends/loopback/loopbacklinkprovider.cpp @@ -20,7 +20,7 @@ #include "loopbacklinkprovider.h" -#include "kdebugnamespace.h" +#include "core_debug.h" LoopbackLinkProvider::LoopbackLinkProvider() : identityPackage(PACKAGE_TYPE_IDENTITY) diff --git a/core/kdebugnamespace.h b/core/core_debug.h similarity index 74% rename from core/kdebugnamespace.h rename to core/core_debug.h index 09ab700bd..33504de03 100644 --- a/core/kdebugnamespace.h +++ b/core/core_debug.h @@ -1,6 +1,5 @@ /** * Copyright 2013 Albert Vaca - * Copyright 2014 Alejandro Fiestas Olivares * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -19,21 +18,11 @@ * along with this program. If not, see . */ -#ifndef QDEBUG_KDECONNECT_CORE_H -#define QDEBUG_KDECONNECT_CORE_H +#ifndef CORE_DEBUG_H +#define CORE_DEBUG_H #include Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_CORE) -//Just until we port everything to qCDebug -#include -#include - -inline int debugArea() -{ - static int theArea = KDebug::registerArea("kdeconnect"); - return theArea; -}; -#endif - +#endif //CORE_DEBUG_H \ No newline at end of file diff --git a/core/daemon.cpp b/core/daemon.cpp index e1d753eca..614107d08 100644 --- a/core/daemon.cpp +++ b/core/daemon.cpp @@ -32,7 +32,7 @@ #include #include -#include "kdebugnamespace.h" +#include "core_debug.h" #include "networkpackage.h" #include "backends/lan/lanlinkprovider.h" #include "backends/loopback/loopbacklinkprovider.h" @@ -41,6 +41,7 @@ #include "backends/devicelink.h" #include "backends/linkprovider.h" +#include struct DaemonPrivate { //Different ways to find devices and connect to them diff --git a/core/device.cpp b/core/device.cpp index d33720e69..f427a9ced 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -37,7 +37,7 @@ #include #include -#include "kdebugnamespace.h" +#include "core_debug.h" #include "kdeconnectplugin.h" #include "pluginloader.h" #include "backends/devicelink.h" diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp index 555c61b07..acb7d452e 100644 --- a/core/filetransferjob.cpp +++ b/core/filetransferjob.cpp @@ -19,15 +19,15 @@ */ #include "filetransferjob.h" +#include #include #include +#include #include #include -#include "kdebugnamespace.h" - FileTransferJob::FileTransferJob(const QSharedPointer& origin, int size, const QUrl &destination): KJob() { Q_ASSERT(destination.isLocalFile()); @@ -105,7 +105,7 @@ void FileTransferJob::renameDone(int result) break; } default: - kWarning() << "Unknown Error"; + qCWarning(KDECONNECT_CORE()) << "Unknown Error"; emitResult(); } diff --git a/core/kdeconnectplugin.cpp b/core/kdeconnectplugin.cpp index 620550b21..fd609acba 100644 --- a/core/kdeconnectplugin.cpp +++ b/core/kdeconnectplugin.cpp @@ -19,6 +19,7 @@ */ #include "kdeconnectplugin.h" +#include struct KdeConnectPluginPrivate { diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp index f2cddf9fe..8bf50d261 100644 --- a/core/networkpackage.cpp +++ b/core/networkpackage.cpp @@ -19,6 +19,7 @@ */ #include "networkpackage.h" +#include "core_debug.h" #include #include @@ -32,6 +33,7 @@ #include #include #include +#include #include "filetransferjob.h" diff --git a/core/networkpackage.h b/core/networkpackage.h index 550ef9d77..dec011156 100644 --- a/core/networkpackage.h +++ b/core/networkpackage.h @@ -33,7 +33,6 @@ #include #include "kdeconnectcore_export.h" -#include "kdebugnamespace.h" #include "default_args.h" class FileTransferJob; diff --git a/core/pluginloader.cpp b/core/pluginloader.cpp index ce65c5a9a..b374ac726 100644 --- a/core/pluginloader.cpp +++ b/core/pluginloader.cpp @@ -22,7 +22,7 @@ #include -#include "kdebugnamespace.h" +#include "core_debug.h" #include "device.h" #include "kdeconnectplugin.h" diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp index d803a538f..91eb704ef 100644 --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -33,8 +33,6 @@ #include #include -#include - Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") extern "C" int KDE_EXPORT kdemain(int argc, char **argv) diff --git a/plugins/battery/batterydbusinterface.cpp b/plugins/battery/batterydbusinterface.cpp index 249eb59d6..7602585ca 100644 --- a/plugins/battery/batterydbusinterface.cpp +++ b/plugins/battery/batterydbusinterface.cpp @@ -23,7 +23,6 @@ #include #include -#include BatteryDbusInterface::BatteryDbusInterface(const Device *device) : QDBusAbstractAdaptor(const_cast(device)) diff --git a/plugins/ping/pingplugin.h b/plugins/ping/pingplugin.h index 82fd759fd..54b17d66c 100644 --- a/plugins/ping/pingplugin.h +++ b/plugins/ping/pingplugin.h @@ -28,7 +28,7 @@ Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PING) -class KDE_EXPORT PingPlugin +class Q_DECL_EXPORT PingPlugin : public KdeConnectPlugin { Q_OBJECT diff --git a/plugins/share/autoclosingqfile.h b/plugins/share/autoclosingqfile.h index c9673d8d9..54dea8318 100644 --- a/plugins/share/autoclosingqfile.h +++ b/plugins/share/autoclosingqfile.h @@ -23,8 +23,6 @@ #include -#include - class AutoClosingQFile : public QFile { Q_OBJECT diff --git a/plugins/share/share_config.cpp b/plugins/share/share_config.cpp index 3805fc9f0..ee06f406b 100644 --- a/plugins/share/share_config.cpp +++ b/plugins/share/share_config.cpp @@ -27,8 +27,6 @@ #include #include -#include - #include "ui_share_config.h" K_PLUGIN_FACTORY(ShareConfigFactory, registerPlugin();)