diff --git a/CMakeLists.txt b/CMakeLists.txt index e0b88dc90..c342cb97b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ include(KDECMakeSettings) include(ECMAddTests) include(ECMSetupVersion) include(ECMInstallIcons) +include(ECMQtDeclareLoggingCategory) include(FeatureSummary) include(GenerateExportHeader) if (NOT SAILFISHOS) @@ -124,4 +125,6 @@ if(BUILD_TESTING) add_subdirectory(tests) endif() +ecm_qt_install_logging_categories(EXPORT kdeconnect-kde FILE kdeconnect-kde.categories SORT DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}") + feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 40fc61c56..92f57a12b 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,5 +1,13 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-core\") +set(debug_file_SRCS) + +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER kdeconnect_debug.h + IDENTIFIER KDECONNECT_CORE CATEGORY_NAME kdeconnect.core + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (core)") + set(KDECONNECT_PRIVATE_DBUS_ADDR unix:tmpdir=/tmp) if(WIN32) set(KDECONNECT_PRIVATE_DBUS_ADDR tcp:host=localhost,port=0) @@ -39,6 +47,7 @@ set(kdeconnectcore_SRCS device.cpp core_debug.cpp notificationserverinfo.cpp + ${debug_file_SRCS} ) add_library(kdeconnectcore ${kdeconnectcore_SRCS}) diff --git a/core/core_debug.cpp b/core/core_debug.cpp index c82f65d73..a6ccc75e0 100644 --- a/core/core_debug.cpp +++ b/core/core_debug.cpp @@ -20,8 +20,6 @@ #include "core_debug.h" -Q_LOGGING_CATEGORY(KDECONNECT_CORE, "kdeconnect.core") - #if defined(__GNU_LIBRARY__) #include #include diff --git a/core/core_debug.h b/core/core_debug.h index 3daf0f725..cb9a6bf34 100644 --- a/core/core_debug.h +++ b/core/core_debug.h @@ -21,11 +21,8 @@ #ifndef CORE_DEBUG_H #define CORE_DEBUG_H -#include - #include "kdeconnectcore_export.h" - -KDECONNECTCORE_EXPORT Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_CORE) +#include "kdeconnect_debug.h" void logBacktrace(); diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 5d81ef3b6..310ad6092 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -1,6 +1,13 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kded") -add_executable(kdeconnectd kdeconnectd.cpp) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER kdeconnectd_debug.h + IDENTIFIER KDECONNECT_DAEMON CATEGORY_NAME kdeconnect.daemon + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (daemon)") + +add_executable(kdeconnectd kdeconnectd.cpp ${debug_file_SRCS}) target_include_directories(kdeconnectd PUBLIC ${CMAKE_BINARY_DIR}) target_link_libraries(kdeconnectd kdeconnectcore KF5::KIOWidgets KF5::DBusAddons KF5::Notifications KF5::I18n Qt5::Widgets) diff --git a/daemon/kdeconnectd.cpp b/daemon/kdeconnectd.cpp index 29d72b19e..c717d58d1 100644 --- a/daemon/kdeconnectd.cpp +++ b/daemon/kdeconnectd.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -42,9 +41,7 @@ #include "core/device.h" #include "core/backends/pairinghandler.h" #include "kdeconnect-version.h" - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_DAEMON) -Q_LOGGING_CATEGORY(KDECONNECT_DAEMON, "kdeconnect.daemon") +#include "kdeconnectd_debug.h" class DesktopDaemon : public Daemon { diff --git a/fileitemactionplugin/CMakeLists.txt b/fileitemactionplugin/CMakeLists.txt index d6b29f11a..dd980bbdf 100644 --- a/fileitemactionplugin/CMakeLists.txt +++ b/fileitemactionplugin/CMakeLists.txt @@ -1,6 +1,13 @@ add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-fileitemaction") -add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER kdeconnect_fileitemaction_debug.h + IDENTIFIER KDECONNECT_FILEITEMACTION CATEGORY_NAME kdeconnect.fileitemaction + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (fileitemaction)") + +add_library(kdeconnectfileitemaction MODULE sendfileitemaction.cpp ${debug_file_SRCS}) target_link_libraries( kdeconnectfileitemaction KF5::KIOWidgets diff --git a/fileitemactionplugin/sendfileitemaction.cpp b/fileitemactionplugin/sendfileitemaction.cpp index bf8e17336..9c8670b61 100644 --- a/fileitemactionplugin/sendfileitemaction.cpp +++ b/fileitemactionplugin/sendfileitemaction.cpp @@ -37,9 +37,9 @@ #include -K_PLUGIN_CLASS_WITH_JSON(SendFileItemAction, "kdeconnectsendfile.json") +#include "kdeconnect_fileitemaction_debug.h" -Q_LOGGING_CATEGORY(KDECONNECT_FILEITEMACTION, "kdeconnect.fileitemaction") +K_PLUGIN_CLASS_WITH_JSON(SendFileItemAction, "kdeconnectsendfile.json") SendFileItemAction::SendFileItemAction(QObject* parent, const QVariantList& ): KAbstractFileItemActionPlugin(parent) { diff --git a/fileitemactionplugin/sendfileitemaction.h b/fileitemactionplugin/sendfileitemaction.h index 6020a23db..1fea7c107 100644 --- a/fileitemactionplugin/sendfileitemaction.h +++ b/fileitemactionplugin/sendfileitemaction.h @@ -23,13 +23,11 @@ #include #include -#include class QAction; class KFileItemListProperties; class QWidget; -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_FILEITEMACTION) class SendFileItemAction : public KAbstractFileItemActionPlugin { Q_OBJECT diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt index 389ca0290..7912a6dd0 100644 --- a/interfaces/CMakeLists.txt +++ b/interfaces/CMakeLists.txt @@ -10,6 +10,19 @@ function(geninterface source_h output_h) set(libkdeconnect_SRC ${libkdeconnect_SRC} PARENT_SCOPE) endfunction() +set(debug_files_SRCS) +ecm_qt_declare_logging_category( + debug_files_SRCS HEADER interfaces_conversation_message_debug.h + IDENTIFIER CONVERSATION_MESSAGE_LOGGING_CATEGORY CATEGORY_NAME kdeconnect.interfaces.conversationmessage + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (conversation message)") + +ecm_qt_declare_logging_category( + debug_files_SRCS HEADER interfaces_debug.h + IDENTIFIER KDECONNECT_INTERFACES CATEGORY_NAME kdeconnect.interfaces + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (interfaces)") + set(libkdeconnect_SRC dbusinterfaces.cpp devicesmodel.cpp @@ -20,6 +33,7 @@ set(libkdeconnect_SRC remotesinksmodel.cpp devicespluginfilterproxymodel.cpp # modeltest.cpp + ${debug_files_SRCS} ) geninterface(${PROJECT_SOURCE_DIR}/core/daemon.h daemoninterface) diff --git a/interfaces/conversationmessage.cpp b/interfaces/conversationmessage.cpp index 47234ca23..4b2a4fcde 100644 --- a/interfaces/conversationmessage.cpp +++ b/interfaces/conversationmessage.cpp @@ -20,10 +20,9 @@ #include "conversationmessage.h" -#include #include -Q_LOGGING_CATEGORY(CONVERSATION_MESSAGE_LOGGING_CATEGORY, "kdeconnect.interfaces.conversationmessage") +#include "interfaces_conversation_message_debug.h" ConversationMessage::ConversationMessage(const QVariantMap& args) : m_eventField(args[QStringLiteral("event")].toInt()), diff --git a/interfaces/conversationmessage.h b/interfaces/conversationmessage.h index bbf3060ae..0287734d3 100644 --- a/interfaces/conversationmessage.h +++ b/interfaces/conversationmessage.h @@ -22,12 +22,9 @@ #define PLUGINS_TELEPHONY_CONVERSATIONMESSAGE_H_ #include -#include #include "kdeconnectinterfaces_export.h" -Q_DECLARE_LOGGING_CATEGORY(CONVERSATION_MESSAGE_LOGGING_CATEGORY) - class ConversationAddress; class KDECONNECTINTERFACES_EXPORT ConversationMessage diff --git a/interfaces/devicesmodel.cpp b/interfaces/devicesmodel.cpp index 7d456498f..d0182c16c 100644 --- a/interfaces/devicesmodel.cpp +++ b/interfaces/devicesmodel.cpp @@ -32,7 +32,7 @@ #include // #include "modeltest.h" -Q_LOGGING_CATEGORY(KDECONNECT_INTERFACES, "kdeconnect.interfaces"); +#include "interfaces_debug.h" static QString createId() { return QCoreApplication::instance()->applicationName()+QString::number(QCoreApplication::applicationPid()); } diff --git a/interfaces/interfaces_debug.h b/interfaces/interfaces_debug.h deleted file mode 100644 index cfd1b6484..000000000 --- a/interfaces/interfaces_debug.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef KDECONNECT_INTERFACES_DEBUG_H -#define KDECONNECT_INTERFACES_DEBUG_H - -#include - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_INTERFACES) - -#endif //KDECONNECT_INTERFACES_DEBUG_H diff --git a/interfaces/notificationsmodel.cpp b/interfaces/notificationsmodel.cpp index 2af718365..17609ad41 100644 --- a/interfaces/notificationsmodel.cpp +++ b/interfaces/notificationsmodel.cpp @@ -19,7 +19,6 @@ */ #include "notificationsmodel.h" -#include "interfaces_debug.h" #include #include @@ -30,6 +29,7 @@ //In older Qt released, qAsConst isnt available #include "core/qtcompat_p.h" +#include "interfaces_debug.h" NotificationsModel::NotificationsModel(QObject* parent) : QAbstractListModel(parent) diff --git a/kio/CMakeLists.txt b/kio/CMakeLists.txt index b16ccdd96..186dc2dba 100644 --- a/kio/CMakeLists.txt +++ b/kio/CMakeLists.txt @@ -1,8 +1,16 @@ include_directories(${CMAKE_SOURCE_DIR}) add_definitions(-DTRANSLATION_DOMAIN="kdeconnect-kio") +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER kdeconnectkio_debug.h + IDENTIFIER KDECONNECT_KIO CATEGORY_NAME kdeconnect.kio + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (kio)") + set(kio_kdeconnect_PART_SRCS kiokdeconnect.cpp + ${debug_file_SRCS} ) add_library(kio_kdeconnect MODULE ${kio_kdeconnect_PART_SRCS}) diff --git a/kio/kiokdeconnect.cpp b/kio/kiokdeconnect.cpp index 766dbd7a2..ea7526e39 100644 --- a/kio/kiokdeconnect.cpp +++ b/kio/kiokdeconnect.cpp @@ -29,7 +29,7 @@ #include #include -Q_LOGGING_CATEGORY(KDECONNECT_KIO, "kdeconnect.kio") +#include "kdeconnectkio_debug.h" class KIOPluginForMetaData : public QObject { diff --git a/kio/kiokdeconnect.h b/kio/kiokdeconnect.h index 28778bc16..6e012c956 100644 --- a/kio/kiokdeconnect.h +++ b/kio/kiokdeconnect.h @@ -22,14 +22,11 @@ #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 diff --git a/plugins/battery/CMakeLists.txt b/plugins/battery/CMakeLists.txt index 00c5477b6..e4b947b7a 100644 --- a/plugins/battery/CMakeLists.txt +++ b/plugins/battery/CMakeLists.txt @@ -1,6 +1,14 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_battery_debug.h + IDENTIFIER KDECONNECT_PLUGIN_BATTERY CATEGORY_NAME kdeconnect.plugin.battery + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin battery)") + set(kdeconnect_battery_SRCS batteryplugin.cpp batterydbusinterface.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_battery JSON kdeconnect_battery.json SOURCES ${kdeconnect_battery_SRCS}) diff --git a/plugins/battery/batterydbusinterface.cpp b/plugins/battery/batterydbusinterface.cpp index f2bd39627..d598da8c8 100644 --- a/plugins/battery/batterydbusinterface.cpp +++ b/plugins/battery/batterydbusinterface.cpp @@ -23,6 +23,7 @@ #include #include +#include "plugin_battery_debug.h" QMap BatteryDbusInterface::s_dbusInterfaces; diff --git a/plugins/battery/batteryplugin.cpp b/plugins/battery/batteryplugin.cpp index dc79e04a6..7be80c20e 100644 --- a/plugins/battery/batteryplugin.cpp +++ b/plugins/battery/batteryplugin.cpp @@ -30,11 +30,10 @@ #include #include "batterydbusinterface.h" +#include "plugin_battery_debug.h" K_PLUGIN_CLASS_WITH_JSON(BatteryPlugin, "kdeconnect_battery.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_BATTERY, "kdeconnect.plugin.battery") - BatteryPlugin::BatteryPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , batteryDbusInterface(new BatteryDbusInterface(device())) diff --git a/plugins/battery/batteryplugin.h b/plugins/battery/batteryplugin.h index c631e88d4..4970e6b2b 100644 --- a/plugins/battery/batteryplugin.h +++ b/plugins/battery/batteryplugin.h @@ -21,13 +21,11 @@ #ifndef BATTERYPLUGIN_H #define BATTERYPLUGIN_H -#include #include #define PACKET_TYPE_BATTERY QStringLiteral("kdeconnect.battery") #define PACKET_TYPE_BATTERY_REQUEST QStringLiteral("kdeconnect.battery.request") -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_BATTERY) class BatteryDbusInterface; class BatteryPlugin diff --git a/plugins/clipboard/CMakeLists.txt b/plugins/clipboard/CMakeLists.txt index 3481a9a17..30f62989e 100644 --- a/plugins/clipboard/CMakeLists.txt +++ b/plugins/clipboard/CMakeLists.txt @@ -1,6 +1,14 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_clipboard_debug.h + IDENTIFIER KDECONNECT_PLUGIN_CLIPBOARD CATEGORY_NAME kdeconnect.plugin.clipboard + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin clipboard)") + set(kdeconnect_clipboard_SRCS clipboardplugin.cpp clipboardlistener.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_clipboard JSON kdeconnect_clipboard.json SOURCES ${kdeconnect_clipboard_SRCS}) diff --git a/plugins/clipboard/clipboardplugin.cpp b/plugins/clipboard/clipboardplugin.cpp index bab72f5c5..07884190a 100644 --- a/plugins/clipboard/clipboardplugin.cpp +++ b/plugins/clipboard/clipboardplugin.cpp @@ -21,13 +21,12 @@ #include "clipboardplugin.h" #include "clipboardlistener.h" +#include "plugin_clipboard_debug.h" #include K_PLUGIN_CLASS_WITH_JSON(ClipboardPlugin, "kdeconnect_clipboard.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_CLIPBOARD, "kdeconnect.plugin.clipboard") - ClipboardPlugin::ClipboardPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/clipboard/clipboardplugin.h b/plugins/clipboard/clipboardplugin.h index 8d104b623..4722b2c49 100644 --- a/plugins/clipboard/clipboardplugin.h +++ b/plugins/clipboard/clipboardplugin.h @@ -23,11 +23,8 @@ #include #include -#include #include -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_CLIPBOARD) - /** * Packet containing just clipboard contents, sent when a device updates its clipboard. *

diff --git a/plugins/contacts/CMakeLists.txt b/plugins/contacts/CMakeLists.txt index b9df52371..492ebcb70 100644 --- a/plugins/contacts/CMakeLists.txt +++ b/plugins/contacts/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_contacts_debug.h + IDENTIFIER KDECONNECT_PLUGIN_CONTACTS CATEGORY_NAME kdeconnect.plugin.contacts + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin contacts)") + set(kdeconnect_contacts_SRCS contactsplugin.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_contacts JSON kdeconnect_contacts.json SOURCES ${kdeconnect_contacts_SRCS}) diff --git a/plugins/contacts/contactsplugin.cpp b/plugins/contacts/contactsplugin.cpp index 3c7340e81..3c4062aec 100644 --- a/plugins/contacts/contactsplugin.cpp +++ b/plugins/contacts/contactsplugin.cpp @@ -24,16 +24,15 @@ #include #include -#include #include #include #include #include -K_PLUGIN_CLASS_WITH_JSON(ContactsPlugin, "kdeconnect_contacts.json") +#include "plugin_contacts_debug.h" -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_CONTACTS, "kdeconnect.plugin.contacts") +K_PLUGIN_CLASS_WITH_JSON(ContactsPlugin, "kdeconnect_contacts.json") ContactsPlugin::ContactsPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) diff --git a/plugins/findthisdevice/CMakeLists.txt b/plugins/findthisdevice/CMakeLists.txt index f32602ad4..39e665c58 100644 --- a/plugins/findthisdevice/CMakeLists.txt +++ b/plugins/findthisdevice/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_findthisdevice_debug.h + IDENTIFIER KDECONNECT_PLUGIN_FINDTHISDEVICE CATEGORY_NAME kdeconnect.plugin.findthisdevice + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin findthisdevice)") + set(kdeconnect_findthisdevice_SRCS findthisdeviceplugin.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_findthisdevice @@ -22,7 +30,7 @@ endif() set(kdeconnect_findthisdevice_config_SRCS findthisdevice_config.cpp) ki18n_wrap_ui(kdeconnect_findthisdevice_config_SRCS findthisdevice_config.ui) -add_library(kdeconnect_findthisdevice_config MODULE ${kdeconnect_findthisdevice_config_SRCS}) +add_library(kdeconnect_findthisdevice_config MODULE ${kdeconnect_findthisdevice_config_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnect_findthisdevice_config kdeconnectpluginkcm Qt5::Multimedia diff --git a/plugins/findthisdevice/findthisdeviceplugin.cpp b/plugins/findthisdevice/findthisdeviceplugin.cpp index 5d0df2ae0..c868d6eda 100644 --- a/plugins/findthisdevice/findthisdeviceplugin.cpp +++ b/plugins/findthisdevice/findthisdeviceplugin.cpp @@ -32,6 +32,7 @@ // Qt #include #include +#include "plugin_findthisdevice_debug.h" K_PLUGIN_CLASS_WITH_JSON(FindThisDevicePlugin, "kdeconnect_findthisdevice.json") diff --git a/plugins/findthisdevice/findthisdeviceplugin.h b/plugins/findthisdevice/findthisdeviceplugin.h index 8b957c259..d0dbd89ce 100644 --- a/plugins/findthisdevice/findthisdeviceplugin.h +++ b/plugins/findthisdevice/findthisdeviceplugin.h @@ -33,16 +33,10 @@ #include #endif // Qt -#include +#include "plugin_findthisdevice_debug.h" #define PACKET_TYPE_FINDMYPHONE_REQUEST QStringLiteral("kdeconnect.findmyphone.request") -static const QLoggingCategory &KDECONNECT_PLUGIN_FINDTHISDEVICE() -{ - static const QLoggingCategory category("kdeconnect.plugin.findthisdevice"); - return category; -} - class FindThisDevicePlugin : public KdeConnectPlugin { diff --git a/plugins/lockdevice/CMakeLists.txt b/plugins/lockdevice/CMakeLists.txt index 2e7a96577..a6c25076b 100644 --- a/plugins/lockdevice/CMakeLists.txt +++ b/plugins/lockdevice/CMakeLists.txt @@ -1,6 +1,13 @@ qt5_add_dbus_interface(lockdevice_SRCS org.freedesktop.ScreenSaver.xml screensaverdbusinterface) -kdeconnect_add_plugin(kdeconnect_lockdevice JSON kdeconnect_lockdevice.json SOURCES lockdeviceplugin.cpp ${lockdevice_SRCS}) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_lock_debug.h + IDENTIFIER KDECONNECT_PLUGIN_LOCKREMOTE CATEGORY_NAME kdeconnect.plugin.lock + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin lockremote)") + +kdeconnect_add_plugin(kdeconnect_lockdevice JSON kdeconnect_lockdevice.json SOURCES lockdeviceplugin.cpp ${lockdevice_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnect_lockdevice kdeconnectcore diff --git a/plugins/lockdevice/lockdeviceplugin.cpp b/plugins/lockdevice/lockdeviceplugin.cpp index da6945514..cfdea7198 100644 --- a/plugins/lockdevice/lockdeviceplugin.cpp +++ b/plugins/lockdevice/lockdeviceplugin.cpp @@ -24,16 +24,14 @@ #include #include -#include #include "screensaverdbusinterface.h" +#include "plugin_lock_debug.h" #include #include K_PLUGIN_CLASS_WITH_JSON(LockDevicePlugin, "kdeconnect_lockdevice.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_LOCKREMOTE, "kdeconnect.plugin.lock") - LockDevicePlugin::LockDevicePlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , m_remoteLocked(false) diff --git a/plugins/mpriscontrol/CMakeLists.txt b/plugins/mpriscontrol/CMakeLists.txt index 9025b1932..4ab748de4 100644 --- a/plugins/mpriscontrol/CMakeLists.txt +++ b/plugins/mpriscontrol/CMakeLists.txt @@ -20,7 +20,14 @@ qt5_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.mpris.MediaPlayer2.xml m endif() -kdeconnect_add_plugin(kdeconnect_mpriscontrol JSON kdeconnect_mpriscontrol.json SOURCES ${kdeconnect_mpriscontrol_SRCS}) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_mpris_debug.h + IDENTIFIER KDECONNECT_PLUGIN_MPRIS CATEGORY_NAME kdeconnect.plugin.mpris + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mpris)") + +kdeconnect_add_plugin(kdeconnect_mpriscontrol JSON kdeconnect_mpriscontrol.json SOURCES ${kdeconnect_mpriscontrol_SRCS} ${debug_file_SRCS}) if(WIN32) target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore) diff --git a/plugins/mpriscontrol/mpriscontrolplugin-win.cpp b/plugins/mpriscontrol/mpriscontrolplugin-win.cpp index 4ccefa21d..1326a76b9 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin-win.cpp +++ b/plugins/mpriscontrol/mpriscontrolplugin-win.cpp @@ -20,6 +20,7 @@ #include "mpriscontrolplugin-win.h" #include +#include "plugin_mpris_debug.h" #include @@ -27,8 +28,6 @@ K_PLUGIN_CLASS_WITH_JSON(MprisControlPlugin, "kdeconnect_mpriscontrol.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRIS, "kdeconnect.plugin.mpris") - MprisControlPlugin::MprisControlPlugin(QObject *parent, const QVariantList &args) : KdeConnectPlugin(parent, args) { } bool MprisControlPlugin::receivePacket(const NetworkPacket &np) diff --git a/plugins/mpriscontrol/mpriscontrolplugin-win.h b/plugins/mpriscontrol/mpriscontrolplugin-win.h index 0e1affaf0..71c2286f0 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin-win.h +++ b/plugins/mpriscontrol/mpriscontrolplugin-win.h @@ -24,14 +24,11 @@ #include #include -#include #define PLAYERNAME QStringLiteral("Media Player") #define PACKET_TYPE_MPRIS QStringLiteral("kdeconnect.mpris") -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRIS) - class MprisControlPlugin : public KdeConnectPlugin { diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscontrol/mpriscontrolplugin.cpp index dc2d1897f..71b1b83e0 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin.cpp +++ b/plugins/mpriscontrol/mpriscontrolplugin.cpp @@ -34,12 +34,10 @@ #include "dbusproperties.h" #include "mprisplayer.h" #include "mprisroot.h" +#include "plugin_mpris_debug.h" K_PLUGIN_CLASS_WITH_JSON(MprisControlPlugin, "kdeconnect_mpriscontrol.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRIS, "kdeconnect.plugin.mpris") - - MprisPlayer::MprisPlayer(const QString& serviceName, const QString& dbusObjectPath, const QDBusConnection& busConnection) : m_serviceName(serviceName) , m_propertiesInterface(new OrgFreedesktopDBusPropertiesInterface(serviceName, dbusObjectPath, busConnection)) diff --git a/plugins/mpriscontrol/mpriscontrolplugin.h b/plugins/mpriscontrol/mpriscontrolplugin.h index 6f4c89d47..954357f1c 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin.h +++ b/plugins/mpriscontrol/mpriscontrolplugin.h @@ -23,13 +23,11 @@ #include #include -#include #include #include #include - class OrgFreedesktopDBusPropertiesInterface; class OrgMprisMediaPlayer2PlayerInterface; @@ -53,8 +51,6 @@ private: #define PACKET_TYPE_MPRIS QStringLiteral("kdeconnect.mpris") -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRIS) - class MprisControlPlugin : public KdeConnectPlugin { diff --git a/plugins/mprisremote/CMakeLists.txt b/plugins/mprisremote/CMakeLists.txt index f65630f71..42b75670c 100644 --- a/plugins/mprisremote/CMakeLists.txt +++ b/plugins/mprisremote/CMakeLists.txt @@ -1,4 +1,11 @@ -kdeconnect_add_plugin(kdeconnect_mprisremote JSON kdeconnect_mprisremote.json SOURCES mprisremoteplugin.cpp mprisremoteplayer.cpp mprisremoteplayermediaplayer2.cpp mprisremoteplayermediaplayer2player.cpp) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_mprisremote_debug.h + IDENTIFIER KDECONNECT_PLUGIN_MPRISREMOTE CATEGORY_NAME kdeconnect.plugin.mprisremote + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin mprisremote)") + +kdeconnect_add_plugin(kdeconnect_mprisremote JSON kdeconnect_mprisremote.json SOURCES mprisremoteplugin.cpp mprisremoteplayer.cpp mprisremoteplayermediaplayer2.cpp mprisremoteplayermediaplayer2player.cpp ${debug_file_SRCS}) target_link_libraries(kdeconnect_mprisremote kdeconnectcore diff --git a/plugins/mprisremote/mprisremoteplugin.cpp b/plugins/mprisremote/mprisremoteplugin.cpp index 333d0807b..1123c6a78 100644 --- a/plugins/mprisremote/mprisremoteplugin.cpp +++ b/plugins/mprisremote/mprisremoteplugin.cpp @@ -23,13 +23,13 @@ #include #include -#include #include +#include "plugin_mprisremote_debug.h" + K_PLUGIN_CLASS_WITH_JSON(MprisRemotePlugin, "kdeconnect_mprisremote.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_MPRISREMOTE, "kdeconnect.plugin.mprisremote") MprisRemotePlugin::MprisRemotePlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) diff --git a/plugins/notifications/CMakeLists.txt b/plugins/notifications/CMakeLists.txt index 74561b917..89a66f08c 100644 --- a/plugins/notifications/CMakeLists.txt +++ b/plugins/notifications/CMakeLists.txt @@ -1,8 +1,16 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_notification_debug.h + IDENTIFIER KDECONNECT_PLUGIN_NOTIFICATION CATEGORY_NAME kdeconnect.plugin.notification + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin notification)") + set(kdeconnect_notifications_SRCS notification.cpp notificationsplugin.cpp notificationsdbusinterface.cpp sendreplydialog.cpp + ${debug_file_SRCS} ) ki18n_wrap_ui(kdeconnect_notifications_SRCS sendreplydialog.ui) diff --git a/plugins/notifications/notification.cpp b/plugins/notifications/notification.cpp index 9ca660900..6c08a16de 100644 --- a/plugins/notifications/notification.cpp +++ b/plugins/notifications/notification.cpp @@ -19,7 +19,7 @@ */ #include "notification.h" -#include "notification_debug.h" +#include "plugin_notification_debug.h" #include #include diff --git a/plugins/notifications/notification_debug.h b/plugins/notifications/notification_debug.h deleted file mode 100644 index b13668013..000000000 --- a/plugins/notifications/notification_debug.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef NOTIFICATION_DEBUG_H -#define NOTIFICATION_DEBUG_H - -#include - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_NOTIFICATION) - -#endif //NOTIFICATION_DEBUG_H diff --git a/plugins/notifications/notificationsdbusinterface.cpp b/plugins/notifications/notificationsdbusinterface.cpp index 4bcc2f4b7..2c693fc1c 100644 --- a/plugins/notifications/notificationsdbusinterface.cpp +++ b/plugins/notifications/notificationsdbusinterface.cpp @@ -19,7 +19,7 @@ */ #include "notificationsdbusinterface.h" -#include "notification_debug.h" +#include "plugin_notification_debug.h" #include "notification.h" #include diff --git a/plugins/notifications/notificationsplugin.cpp b/plugins/notifications/notificationsplugin.cpp index 115f341f0..f646ad348 100644 --- a/plugins/notifications/notificationsplugin.cpp +++ b/plugins/notifications/notificationsplugin.cpp @@ -21,14 +21,12 @@ #include "notificationsplugin.h" #include "notificationsdbusinterface.h" -#include "notification_debug.h" +#include "plugin_notification_debug.h" #include K_PLUGIN_CLASS_WITH_JSON(NotificationsPlugin, "kdeconnect_notifications.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_NOTIFICATION, "kdeconnect.plugin.notification") - NotificationsPlugin::NotificationsPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/pausemusic/CMakeLists.txt b/plugins/pausemusic/CMakeLists.txt index d2b99d025..af857e889 100644 --- a/plugins/pausemusic/CMakeLists.txt +++ b/plugins/pausemusic/CMakeLists.txt @@ -8,9 +8,16 @@ else() ) endif() +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_pausemusic_debug.h + IDENTIFIER KDECONNECT_PLUGIN_PAUSEMUSIC CATEGORY_NAME kdeconnect.plugin.pausemusic + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin pausemusic)") + qt5_add_dbus_interface(kdeconnect_pausemusic_SRCS org.mpris.MediaPlayer2.Player.xml mprisplayer) -kdeconnect_add_plugin(kdeconnect_pausemusic JSON kdeconnect_pausemusic.json SOURCES ${kdeconnect_pausemusic_SRCS}) +kdeconnect_add_plugin(kdeconnect_pausemusic JSON kdeconnect_pausemusic.json SOURCES ${kdeconnect_pausemusic_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnect_pausemusic kdeconnectcore diff --git a/plugins/pausemusic/pausemusicplugin-win.cpp b/plugins/pausemusic/pausemusicplugin-win.cpp index 2bc41580c..ed90fd682 100644 --- a/plugins/pausemusic/pausemusicplugin-win.cpp +++ b/plugins/pausemusic/pausemusicplugin-win.cpp @@ -22,11 +22,10 @@ #include "pausemusicplugin-win.h" #include +#include "plugin_pausemusic_debug.h" K_PLUGIN_CLASS_WITH_JSON(PauseMusicPlugin, "kdeconnect_pausemusic.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PAUSEMUSIC, "kdeconnect.plugin.pausemusic") - PauseMusicPlugin::PauseMusicPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/pausemusic/pausemusicplugin-win.h b/plugins/pausemusic/pausemusicplugin-win.h index 51b647239..95ea4b636 100644 --- a/plugins/pausemusic/pausemusicplugin-win.h +++ b/plugins/pausemusic/pausemusicplugin-win.h @@ -28,13 +28,9 @@ #include -#include - #include #include -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PAUSEMUSIC) - class PauseMusicPlugin : public KdeConnectPlugin { diff --git a/plugins/pausemusic/pausemusicplugin.cpp b/plugins/pausemusic/pausemusicplugin.cpp index 1e8d6ef9e..9f14cd59b 100644 --- a/plugins/pausemusic/pausemusicplugin.cpp +++ b/plugins/pausemusic/pausemusicplugin.cpp @@ -29,11 +29,10 @@ //In older Qt released, qAsConst isnt available #include "qtcompat_p.h" +#include "plugin_pausemusic_debug.h" K_PLUGIN_CLASS_WITH_JSON(PauseMusicPlugin, "kdeconnect_pausemusic.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PAUSEMUSIC, "kdeconnect.plugin.pausemusic") - PauseMusicPlugin::PauseMusicPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , mutedSinks() diff --git a/plugins/pausemusic/pausemusicplugin.h b/plugins/pausemusic/pausemusicplugin.h index 7457b6005..43a12fdd6 100644 --- a/plugins/pausemusic/pausemusicplugin.h +++ b/plugins/pausemusic/pausemusicplugin.h @@ -27,10 +27,6 @@ #include -#include - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PAUSEMUSIC) - class PauseMusicPlugin : public KdeConnectPlugin { diff --git a/plugins/photo/CMakeLists.txt b/plugins/photo/CMakeLists.txt index 740dffc33..21c7910d2 100644 --- a/plugins/photo/CMakeLists.txt +++ b/plugins/photo/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_photo_debug.h + IDENTIFIER KDECONNECT_PLUGIN_PHOTO CATEGORY_NAME kdeconnect.plugin.photo + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin photo)") + set(kdeconnect_photo_SRCS photoplugin.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_photo JSON kdeconnect_photo.json SOURCES ${kdeconnect_photo_SRCS}) diff --git a/plugins/photo/photoplugin.cpp b/plugins/photo/photoplugin.cpp index 8fb0302c8..37333b84a 100644 --- a/plugins/photo/photoplugin.cpp +++ b/plugins/photo/photoplugin.cpp @@ -23,14 +23,12 @@ #include #include -#include #include +#include "plugin_photo_debug.h" K_PLUGIN_CLASS_WITH_JSON(PhotoPlugin, "kdeconnect_photo.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PHOTO, "kdeconnect.plugin.photo") - PhotoPlugin::PhotoPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/ping/CMakeLists.txt b/plugins/ping/CMakeLists.txt index 1ea45d166..56fb60e8a 100644 --- a/plugins/ping/CMakeLists.txt +++ b/plugins/ping/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_ping_debug.h + IDENTIFIER KDECONNECT_PLUGIN_PING CATEGORY_NAME kdeconnect.plugin.ping + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin ping)") + set(kdeconnect_ping_SRCS pingplugin.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_ping JSON kdeconnect_ping.json SOURCES ${kdeconnect_ping_SRCS}) diff --git a/plugins/ping/pingplugin.cpp b/plugins/ping/pingplugin.cpp index a324acc54..341c7c418 100644 --- a/plugins/ping/pingplugin.cpp +++ b/plugins/ping/pingplugin.cpp @@ -25,14 +25,13 @@ #include #include -#include #include #include -K_PLUGIN_CLASS_WITH_JSON(PingPlugin, "kdeconnect_ping.json") +#include "plugin_ping_debug.h" -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PING, "kdeconnect.plugin.ping") +K_PLUGIN_CLASS_WITH_JSON(PingPlugin, "kdeconnect_ping.json") PingPlugin::PingPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) diff --git a/plugins/presenter/CMakeLists.txt b/plugins/presenter/CMakeLists.txt index 6fea7f67e..42c2f0bdb 100644 --- a/plugins/presenter/CMakeLists.txt +++ b/plugins/presenter/CMakeLists.txt @@ -1,6 +1,13 @@ qt5_add_resources(presenter_SRCS assets.qrc) -kdeconnect_add_plugin(kdeconnect_presenter JSON kdeconnect_presenter.json SOURCES presenterplugin.cpp ${presenter_SRCS}) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_presenter_debug.h + IDENTIFIER KDECONNECT_PLUGIN_PRESENT CATEGORY_NAME kdeconnect.plugin.presenter + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin presenter)") + +kdeconnect_add_plugin(kdeconnect_presenter JSON kdeconnect_presenter.json SOURCES presenterplugin.cpp ${presenter_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnect_presenter kdeconnectcore Qt5::DBus diff --git a/plugins/presenter/presenterplugin.cpp b/plugins/presenter/presenterplugin.cpp index 5f6c53f01..766e5d4f8 100644 --- a/plugins/presenter/presenterplugin.cpp +++ b/plugins/presenter/presenterplugin.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -34,11 +33,10 @@ #include #include #include +#include "plugin_presenter_debug.h" K_PLUGIN_CLASS_WITH_JSON(PresenterPlugin, "kdeconnect_presenter.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_PRESENT, "kdeconnect.plugin.presenter") - class PresenterView : public QQuickView { public: diff --git a/plugins/remotecommands/CMakeLists.txt b/plugins/remotecommands/CMakeLists.txt index 179400a81..4645f16af 100644 --- a/plugins/remotecommands/CMakeLists.txt +++ b/plugins/remotecommands/CMakeLists.txt @@ -1,7 +1,15 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_remotecommands_debug.h + IDENTIFIER KDECONNECT_PLUGIN_REMOTECOMMANDS CATEGORY_NAME kdeconnect.plugin.remotecommands + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotecommands)") + kdeconnect_add_plugin(kdeconnect_remotecommands JSON kdeconnect_remotecommands.json - SOURCES remotecommandsplugin.cpp + SOURCES remotecommandsplugin.cpp ${debug_file_SRCS} ) + target_link_libraries(kdeconnect_remotecommands kdeconnectcore Qt5::DBus diff --git a/plugins/remotecommands/remotecommandsplugin.cpp b/plugins/remotecommands/remotecommandsplugin.cpp index 4b103c1c3..64a2f140e 100644 --- a/plugins/remotecommands/remotecommandsplugin.cpp +++ b/plugins/remotecommands/remotecommandsplugin.cpp @@ -22,17 +22,15 @@ #include -#include - #include #include +#include "plugin_remotecommands_debug.h" + #define PACKET_TYPE_RUNCOMMAND_REQUEST QLatin1String("kdeconnect.runcommand.request") K_PLUGIN_CLASS_WITH_JSON(RemoteCommandsPlugin, "kdeconnect_remotecommands.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTECOMMANDS, "kdeconnect.plugin.remotecommands") - RemoteCommandsPlugin::RemoteCommandsPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , m_commands("{}") diff --git a/plugins/remotecontrol/CMakeLists.txt b/plugins/remotecontrol/CMakeLists.txt index c33d932d3..5496dc54e 100644 --- a/plugins/remotecontrol/CMakeLists.txt +++ b/plugins/remotecontrol/CMakeLists.txt @@ -1,4 +1,11 @@ -kdeconnect_add_plugin(kdeconnect_remotecontrol JSON kdeconnect_remotecontrol.json SOURCES remotecontrolplugin.cpp) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_remotecontrol_debug.h + IDENTIFIER KDECONNECT_PLUGIN_REMOTECONTROL CATEGORY_NAME kdeconnect.plugin.remotecontrol + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotecontrol)") + +kdeconnect_add_plugin(kdeconnect_remotecontrol JSON kdeconnect_remotecontrol.json SOURCES remotecontrolplugin.cpp ${debug_file_SRCS}) target_link_libraries(kdeconnect_remotecontrol kdeconnectcore diff --git a/plugins/remotecontrol/remotecontrolplugin.cpp b/plugins/remotecontrol/remotecontrolplugin.cpp index dd6eb6685..64c39ea2d 100644 --- a/plugins/remotecontrol/remotecontrolplugin.cpp +++ b/plugins/remotecontrol/remotecontrolplugin.cpp @@ -26,14 +26,12 @@ #include #include #include -#include #include +#include "plugin_remotecontrol_debug.h" K_PLUGIN_CLASS_WITH_JSON(RemoteControlPlugin, "kdeconnect_remotecontrol.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTECONTROL, "kdeconnect.plugin.remotecontrol") - RemoteControlPlugin::RemoteControlPlugin(QObject* parent, const QVariantList &args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/remotekeyboard/CMakeLists.txt b/plugins/remotekeyboard/CMakeLists.txt index 43a4cd063..02137749e 100644 --- a/plugins/remotekeyboard/CMakeLists.txt +++ b/plugins/remotekeyboard/CMakeLists.txt @@ -1,5 +1,12 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_remotekeyboard_debug.h + IDENTIFIER KDECONNECT_PLUGIN_REMOTEKEYBOARD CATEGORY_NAME kdeconnect.plugin.remotekeyboard + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotekeyboard)") + kdeconnect_add_plugin(kdeconnect_remotekeyboard JSON kdeconnect_remotekeyboard.json - SOURCES remotekeyboardplugin.cpp) + SOURCES remotekeyboardplugin.cpp ${debug_file_SRCS}) target_link_libraries(kdeconnect_remotekeyboard kdeconnectcore diff --git a/plugins/remotekeyboard/remotekeyboardplugin.cpp b/plugins/remotekeyboard/remotekeyboardplugin.cpp index 8c9c087e7..8c70502f8 100644 --- a/plugins/remotekeyboard/remotekeyboardplugin.cpp +++ b/plugins/remotekeyboard/remotekeyboardplugin.cpp @@ -23,11 +23,10 @@ #include #include #include +#include "plugin_remotekeyboard_debug.h" K_PLUGIN_CLASS_WITH_JSON(RemoteKeyboardPlugin, "kdeconnect_remotekeyboard.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTEKEYBOARD, "kdeconnect.plugin.remotekeyboard"); - // Mapping of Qt::Key to internal codes, corresponds to the mapping in mousepadplugin QMap specialKeysMap = { //0, // Invalid diff --git a/plugins/remotekeyboard/remotekeyboardplugin.h b/plugins/remotekeyboard/remotekeyboardplugin.h index d6cc06cdb..54c46e24a 100644 --- a/plugins/remotekeyboard/remotekeyboardplugin.h +++ b/plugins/remotekeyboard/remotekeyboardplugin.h @@ -23,13 +23,10 @@ #include #include -#include #include struct FakeKey; -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTEKEYBOARD); - #define PACKET_TYPE_MOUSEPAD_REQUEST QLatin1String("kdeconnect.mousepad.request") #define PACKET_TYPE_MOUSEPAD_ECHO QLatin1String("kdeconnect.mousepad.echo") #define PACKET_TYPE_MOUSEPAD_KEYBOARDSTATE QLatin1String("kdeconnect.mousepad.keyboardstate") diff --git a/plugins/remotesystemvolume/CMakeLists.txt b/plugins/remotesystemvolume/CMakeLists.txt index a8eb04cff..ba12e120c 100644 --- a/plugins/remotesystemvolume/CMakeLists.txt +++ b/plugins/remotesystemvolume/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_remotesystemvolume_debug.h + IDENTIFIER KDECONNECT_PLUGIN_REMOTESYSTEMVOLUME CATEGORY_NAME kdeconnect.plugin.remotesystemvolume + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin remotesystemvolume)") + set(kdeconnect_remotesystemvolume_SRCS remotesystemvolumeplugin.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_remotesystemvolume JSON kdeconnect_remotesystemvolume.json SOURCES ${kdeconnect_remotesystemvolume_SRCS}) diff --git a/plugins/remotesystemvolume/remotesystemvolumeplugin.cpp b/plugins/remotesystemvolume/remotesystemvolumeplugin.cpp index 9ff33206b..bcd4cc882 100644 --- a/plugins/remotesystemvolume/remotesystemvolumeplugin.cpp +++ b/plugins/remotesystemvolume/remotesystemvolumeplugin.cpp @@ -25,16 +25,15 @@ #include #include -#include #include #include #include #include -K_PLUGIN_CLASS_WITH_JSON(RemoteSystemVolumePlugin, "kdeconnect_remotesystemvolume.json") +#include "plugin_remotesystemvolume_debug.h" -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_REMOTESYSTEMVOLUME, "kdeconnect.plugin.remotesystemvolume") +K_PLUGIN_CLASS_WITH_JSON(RemoteSystemVolumePlugin, "kdeconnect_remotesystemvolume.json") RemoteSystemVolumePlugin::RemoteSystemVolumePlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) diff --git a/plugins/runcommand/CMakeLists.txt b/plugins/runcommand/CMakeLists.txt index b2615e9f2..8f492c82f 100644 --- a/plugins/runcommand/CMakeLists.txt +++ b/plugins/runcommand/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_runcommand_debug.h + IDENTIFIER KDECONNECT_PLUGIN_RUNCOMMAND CATEGORY_NAME kdeconnect.plugin.runcommand + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin runcommand)") + set(kdeconnect_runcommand_SRCS runcommandplugin.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_runcommand JSON kdeconnect_runcommand.json SOURCES ${kdeconnect_runcommand_SRCS}) diff --git a/plugins/runcommand/runcommandplugin.cpp b/plugins/runcommand/runcommandplugin.cpp index a8e3548a5..81f91d32a 100644 --- a/plugins/runcommand/runcommandplugin.cpp +++ b/plugins/runcommand/runcommandplugin.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -39,6 +38,8 @@ #include #include +#include "plugin_runcommand_debug.h" + #define PACKET_TYPE_RUNCOMMAND QStringLiteral("kdeconnect.runcommand") #ifdef Q_OS_WIN @@ -53,8 +54,6 @@ K_PLUGIN_CLASS_WITH_JSON(RunCommandPlugin, "kdeconnect_runcommand.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_RUNCOMMAND, "kdeconnect.plugin.runcommand") - RunCommandPlugin::RunCommandPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/screensaver-inhibit/CMakeLists.txt b/plugins/screensaver-inhibit/CMakeLists.txt index 3398a3525..ec6353b49 100644 --- a/plugins/screensaver-inhibit/CMakeLists.txt +++ b/plugins/screensaver-inhibit/CMakeLists.txt @@ -12,7 +12,14 @@ else() ) endif() -kdeconnect_add_plugin(kdeconnect_screensaver_inhibit JSON kdeconnect_screensaver_inhibit.json SOURCES ${kdeconnect_screensaver_inhibit_SRCS}) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER kdeconnect_screensaverinhibit_debug.h + IDENTIFIER KDECONNECT_PLUGIN_SCREENSAVERINHIBIT CATEGORY_NAME kdeconnect.plugin.screensaverinhibit + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin screensaverinhibit)") + +kdeconnect_add_plugin(kdeconnect_screensaver_inhibit JSON kdeconnect_screensaver_inhibit.json SOURCES ${kdeconnect_screensaver_inhibit_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnect_screensaver_inhibit kdeconnectcore) if(NOT APPLE AND NOT WIN32) diff --git a/plugins/screensaver-inhibit/screensaverinhibitplugin-macos.cpp b/plugins/screensaver-inhibit/screensaverinhibitplugin-macos.cpp index c89bbc0fb..514c9eb1f 100644 --- a/plugins/screensaver-inhibit/screensaverinhibitplugin-macos.cpp +++ b/plugins/screensaver-inhibit/screensaverinhibitplugin-macos.cpp @@ -21,12 +21,10 @@ #include "screensaverinhibitplugin-macos.h" #include -#include +#include "kdeconnect_screensaverinhibit_debug.h" K_PLUGIN_CLASS_WITH_JSON(ScreensaverInhibitPlugin, "kdeconnect_screensaver_inhibit.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT, "kdeconnect.plugin.screensaverinhibit") - ScreensaverInhibitPlugin::ScreensaverInhibitPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args), m_caffeinateProcess(nullptr) { diff --git a/plugins/screensaver-inhibit/screensaverinhibitplugin-win.cpp b/plugins/screensaver-inhibit/screensaverinhibitplugin-win.cpp index 0a8c7613f..5480e7819 100644 --- a/plugins/screensaver-inhibit/screensaverinhibitplugin-win.cpp +++ b/plugins/screensaver-inhibit/screensaverinhibitplugin-win.cpp @@ -21,13 +21,11 @@ #include "screensaverinhibitplugin-win.h" #include -#include #include +#include "kdeconnect_screensaverinhibit_debug.h" K_PLUGIN_CLASS_WITH_JSON(ScreensaverInhibitPlugin, "kdeconnect_screensaver_inhibit.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT, "kdeconnect.plugin.screensaverinhibit") - ScreensaverInhibitPlugin::ScreensaverInhibitPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp b/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp index ed1547976..1b2762566 100644 --- a/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp +++ b/plugins/screensaver-inhibit/screensaverinhibitplugin.cpp @@ -22,14 +22,12 @@ #include #include -#include #include #include +#include "kdeconnect_screensaverinhibit_debug.h" K_PLUGIN_CLASS_WITH_JSON(ScreensaverInhibitPlugin, "kdeconnect_screensaver_inhibit.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SCREENSAVERINHIBIT, "kdeconnect.plugin.screensaverinhibit") - #define INHIBIT_SERVICE QStringLiteral("org.freedesktop.ScreenSaver") #define INHIBIT_INTERFACE INHIBIT_SERVICE #define INHIBIT_PATH QStringLiteral("/ScreenSaver") diff --git a/plugins/sendnotifications/CMakeLists.txt b/plugins/sendnotifications/CMakeLists.txt index 94576b421..090c4b81f 100644 --- a/plugins/sendnotifications/CMakeLists.txt +++ b/plugins/sendnotifications/CMakeLists.txt @@ -6,11 +6,19 @@ endif() configure_file(kdeconnect_sendnotifications.json.in kdeconnect_sendnotifications.json) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_sendnotification_debug.h + IDENTIFIER KDECONNECT_PLUGIN_SENDNOTIFICATION CATEGORY_NAME kdeconnect.plugin.sendnotification + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sendnotification)") + set(kdeconnect_sendnotifications_SRCS sendnotificationsplugin.cpp notificationslistener.cpp notifyingapplication.cpp kdeconnect_sendnotifications.json + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_sendnotifications JSON "${CMAKE_CURRENT_BINARY_DIR}/kdeconnect_sendnotifications.json" SOURCES ${kdeconnect_sendnotifications_SRCS}) diff --git a/plugins/sendnotifications/notificationslistener.cpp b/plugins/sendnotifications/notificationslistener.cpp index bfbea38e9..fdb10f757 100644 --- a/plugins/sendnotifications/notificationslistener.cpp +++ b/plugins/sendnotifications/notificationslistener.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -36,7 +35,7 @@ #include #include "sendnotificationsplugin.h" -#include "sendnotification_debug.h" +#include "plugin_sendnotification_debug.h" #include "notifyingapplication.h" //In older Qt released, qAsConst isnt available diff --git a/plugins/sendnotifications/sendnotification_debug.h b/plugins/sendnotifications/sendnotification_debug.h deleted file mode 100644 index e0cee05d8..000000000 --- a/plugins/sendnotifications/sendnotification_debug.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef SENDNOTIFICATION_DEBUG_H -#define SENDNOTIFICATION_DEBUG_H - -#include - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SENDNOTIFICATION) - -#endif //NOTIFICATION_DEBUG_H diff --git a/plugins/sendnotifications/sendnotificationsplugin.cpp b/plugins/sendnotifications/sendnotificationsplugin.cpp index 602f8a051..1b1301097 100644 --- a/plugins/sendnotifications/sendnotificationsplugin.cpp +++ b/plugins/sendnotifications/sendnotificationsplugin.cpp @@ -21,14 +21,12 @@ #include "sendnotificationsplugin.h" #include "notificationslistener.h" -#include "sendnotification_debug.h" +#include "plugin_sendnotification_debug.h" #include K_PLUGIN_CLASS_WITH_JSON(SendNotificationsPlugin, "kdeconnect_sendnotifications.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SENDNOTIFICATION, "kdeconnect.plugin.sendnotification") - SendNotificationsPlugin::SendNotificationsPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/sftp/CMakeLists.txt b/plugins/sftp/CMakeLists.txt index 2066102ea..beb177436 100644 --- a/plugins/sftp/CMakeLists.txt +++ b/plugins/sftp/CMakeLists.txt @@ -14,7 +14,14 @@ else() ) endif() -kdeconnect_add_plugin(kdeconnect_sftp JSON kdeconnect_sftp.json SOURCES ${kdeconnect_sftp_SRCS}) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_sftp_debug.h + IDENTIFIER KDECONNECT_PLUGIN_SFTP CATEGORY_NAME kdeconnect.plugin.sftp + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sftp)") + +kdeconnect_add_plugin(kdeconnect_sftp JSON kdeconnect_sftp.json SOURCES ${kdeconnect_sftp_SRCS} ${debug_file_SRCS}) target_link_libraries(kdeconnect_sftp kdeconnectcore diff --git a/plugins/sftp/mounter.cpp b/plugins/sftp/mounter.cpp index fca9907cb..b435a56b1 100644 --- a/plugins/sftp/mounter.cpp +++ b/plugins/sftp/mounter.cpp @@ -28,7 +28,7 @@ #include "mountloop.h" #include "config-sftp.h" -#include "sftp_debug.h" +#include "plugin_sftp_debug.h" #include "kdeconnectconfig.h" Mounter::Mounter(SftpPlugin* sftp) diff --git a/plugins/sftp/sftp_debug.h b/plugins/sftp/sftp_debug.h deleted file mode 100644 index 89a2de057..000000000 --- a/plugins/sftp/sftp_debug.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef SFTP_DEBUG_H -#define SFTP_DEBUG_H - -#include - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SFTP) - -#endif //SFTP_DEBUG_H diff --git a/plugins/sftp/sftpplugin-win.cpp b/plugins/sftp/sftpplugin-win.cpp index 10959b534..859fc9c44 100644 --- a/plugins/sftp/sftpplugin-win.cpp +++ b/plugins/sftp/sftpplugin-win.cpp @@ -29,12 +29,10 @@ #include #include -#include "sftp_debug.h" +#include "plugin_sftp_debug.h" K_PLUGIN_CLASS_WITH_JSON(SftpPlugin, "kdeconnect_sftp.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SFTP, "kdeconnect.plugin.sftp") - SftpPlugin::SftpPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp index 9fb35ff88..37d15c706 100644 --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -32,12 +32,10 @@ #include #include "mounter.h" -#include "sftp_debug.h" +#include "plugin_sftp_debug.h" K_PLUGIN_CLASS_WITH_JSON(SftpPlugin, "kdeconnect_sftp.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SFTP, "kdeconnect.plugin.sftp") - static const QSet fields_c = QSet() << QStringLiteral("ip") << QStringLiteral("port") << QStringLiteral("user") << QStringLiteral("port") << QStringLiteral("path"); struct SftpPlugin::Pimpl diff --git a/plugins/share/CMakeLists.txt b/plugins/share/CMakeLists.txt index bb47e9878..a4a40ad46 100644 --- a/plugins/share/CMakeLists.txt +++ b/plugins/share/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_share_debug.h + IDENTIFIER KDECONNECT_PLUGIN_SHARE CATEGORY_NAME kdeconnect.plugin.share + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin share)") + set(kdeconnect_share_SRCS shareplugin.cpp + ${debug_file_SRCS} ) kdeconnect_add_plugin(kdeconnect_share JSON kdeconnect_share.json SOURCES ${kdeconnect_share_SRCS}) diff --git a/plugins/share/share_debug.h b/plugins/share/share_debug.h deleted file mode 100644 index 6097e7374..000000000 --- a/plugins/share/share_debug.h +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef SHARE_DEBUG_H -#define SHARE_DEBUG_H - -#include - -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SHARE) - -#endif //SHARE_DEBUG_H diff --git a/plugins/share/shareplugin.cpp b/plugins/share/shareplugin.cpp index 92c5364f6..ec9e4c443 100644 --- a/plugins/share/shareplugin.cpp +++ b/plugins/share/shareplugin.cpp @@ -19,7 +19,6 @@ */ #include "shareplugin.h" -#include "share_debug.h" #include #include @@ -39,11 +38,10 @@ #include "core/filetransferjob.h" #include "core/daemon.h" +#include "plugin_share_debug.h" K_PLUGIN_CLASS_WITH_JSON(SharePlugin, "kdeconnect_share.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SHARE, "kdeconnect.plugin.share") - SharePlugin::SharePlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , m_compositeJob() diff --git a/plugins/sms/CMakeLists.txt b/plugins/sms/CMakeLists.txt index 969105891..68cf67bff 100644 --- a/plugins/sms/CMakeLists.txt +++ b/plugins/sms/CMakeLists.txt @@ -1,7 +1,21 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_sms_debug.h + IDENTIFIER KDECONNECT_PLUGIN_SMS CATEGORY_NAME kdeconnect.plugin.sms + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin sms)") + +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER kdeconnect_conversations_debug.h + IDENTIFIER KDECONNECT_CONVERSATIONS CATEGORY_NAME kdeconnect.conversations + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (conversations)") + set(kdeconnect_sms_SRCS smsplugin.cpp conversationsdbusinterface.cpp requestconversationworker.cpp + ${debug_file_SRCS} ) include_directories(${CMAKE_BINARY_DIR}) diff --git a/plugins/sms/conversationsdbusinterface.cpp b/plugins/sms/conversationsdbusinterface.cpp index 1be3b02d5..1806230d4 100644 --- a/plugins/sms/conversationsdbusinterface.cpp +++ b/plugins/sms/conversationsdbusinterface.cpp @@ -29,7 +29,7 @@ #include #include -Q_LOGGING_CATEGORY(KDECONNECT_CONVERSATIONS, "kdeconnect.conversations") +#include "kdeconnect_conversations_debug.h" QMap ConversationsDbusInterface::liveConversationInterfaces; diff --git a/plugins/sms/smsplugin.cpp b/plugins/sms/smsplugin.cpp index 5c926de95..2b4f6667f 100644 --- a/plugins/sms/smsplugin.cpp +++ b/plugins/sms/smsplugin.cpp @@ -26,18 +26,16 @@ #include #include -#include #include #include #include #include "sendreplydialog.h" +#include "plugin_sms_debug.h" K_PLUGIN_CLASS_WITH_JSON(SmsPlugin, "kdeconnect_sms.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SMS, "kdeconnect.plugin.sms") - SmsPlugin::SmsPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) , m_telepathyInterface(QStringLiteral("org.freedesktop.Telepathy.ConnectionManager.kdeconnect"), QStringLiteral("/kdeconnect")) diff --git a/plugins/systemvolume/CMakeLists.txt b/plugins/systemvolume/CMakeLists.txt index cbbf1b372..49123497a 100644 --- a/plugins/systemvolume/CMakeLists.txt +++ b/plugins/systemvolume/CMakeLists.txt @@ -12,7 +12,13 @@ else() ) endif() -kdeconnect_add_plugin(kdeconnect_systemvolume JSON kdeconnect_systemvolume.json SOURCES ${kdeconnect_systemvolume_SRCS}) +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_systemvolume_debug.h + IDENTIFIER KDECONNECT_PLUGIN_SYSTEMVOLUME CATEGORY_NAME kdeconnect.plugin.systemvolume + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin systemvolume)") +kdeconnect_add_plugin(kdeconnect_systemvolume JSON kdeconnect_systemvolume.json SOURCES ${kdeconnect_systemvolume_SRCS} ${debug_file_SRCS}) if(WIN32) target_link_libraries(kdeconnect_systemvolume diff --git a/plugins/systemvolume/systemvolumeplugin-macos.cpp b/plugins/systemvolume/systemvolumeplugin-macos.cpp index 5fa5ee934..b34c66c87 100644 --- a/plugins/systemvolume/systemvolumeplugin-macos.cpp +++ b/plugins/systemvolume/systemvolumeplugin-macos.cpp @@ -23,14 +23,13 @@ #include #include -#include #include #include #include +#include "plugin_systemvolume_debug.h" K_PLUGIN_FACTORY_WITH_JSON( KdeConnectPluginFactory, "kdeconnect_systemvolume.json", registerPlugin< SystemvolumePlugin >(); ) -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SYSTEMVOLUME, "kdeconnect.plugin.systemvolume") class MacOSCoreAudioDevice { diff --git a/plugins/systemvolume/systemvolumeplugin-pulse.cpp b/plugins/systemvolume/systemvolumeplugin-pulse.cpp index 5c20638ed..11ffea237 100644 --- a/plugins/systemvolume/systemvolumeplugin-pulse.cpp +++ b/plugins/systemvolume/systemvolumeplugin-pulse.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -33,10 +32,10 @@ #include #include +#include "plugin_systemvolume_debug.h" K_PLUGIN_CLASS_WITH_JSON(SystemvolumePlugin, "kdeconnect_systemvolume.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SYSTEMVOLUME, "kdeconnect.plugin.systemvolume") SystemvolumePlugin::SystemvolumePlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) diff --git a/plugins/systemvolume/systemvolumeplugin-win.cpp b/plugins/systemvolume/systemvolumeplugin-win.cpp index a1c7c89ec..9e89d2991 100644 --- a/plugins/systemvolume/systemvolumeplugin-win.cpp +++ b/plugins/systemvolume/systemvolumeplugin-win.cpp @@ -21,7 +21,6 @@ #include "systemvolumeplugin-win.h" #include -#include #include #include #include @@ -32,9 +31,9 @@ #include -K_PLUGIN_CLASS_WITH_JSON(SystemvolumePlugin, "kdeconnect_systemvolume.json") +#include "plugin_systemvolume_debug.h" -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_SYSTEMVOLUME, "kdeconnect.plugin.systemvolume") +K_PLUGIN_CLASS_WITH_JSON(SystemvolumePlugin, "kdeconnect_systemvolume.json") // Private classes of SystemvolumePlugin diff --git a/plugins/telephony/CMakeLists.txt b/plugins/telephony/CMakeLists.txt index 4eb34fa17..bb616d471 100644 --- a/plugins/telephony/CMakeLists.txt +++ b/plugins/telephony/CMakeLists.txt @@ -1,5 +1,13 @@ +set(debug_file_SRCS) +ecm_qt_declare_logging_category( + debug_file_SRCS HEADER plugin_telephony_debug.h + IDENTIFIER KDECONNECT_PLUGIN_TELEPHONY CATEGORY_NAME kdeconnect.plugin.telephony + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (plugin telephony)") + set(kdeconnect_telephony_SRCS telephonyplugin.cpp + ${debug_file_SRCS} ) include_directories(${CMAKE_BINARY_DIR}) diff --git a/plugins/telephony/telephonyplugin.cpp b/plugins/telephony/telephonyplugin.cpp index f84de9a29..b6a0f2157 100644 --- a/plugins/telephony/telephonyplugin.cpp +++ b/plugins/telephony/telephonyplugin.cpp @@ -27,11 +27,10 @@ #include #include +#include "plugin_telephony_debug.h" K_PLUGIN_CLASS_WITH_JSON(TelephonyPlugin, "kdeconnect_telephony.json") -Q_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY, "kdeconnect.plugin.telephony") - TelephonyPlugin::TelephonyPlugin(QObject* parent, const QVariantList& args) : KdeConnectPlugin(parent, args) { diff --git a/plugins/telephony/telephonyplugin.h b/plugins/telephony/telephonyplugin.h index bb119c617..368dbae0c 100644 --- a/plugins/telephony/telephonyplugin.h +++ b/plugins/telephony/telephonyplugin.h @@ -22,7 +22,6 @@ #ifndef TELEPHONYPLUGIN_H #define TELEPHONYPLUGIN_H -#include #include #include @@ -45,8 +44,6 @@ #define PACKET_TYPE_TELEPHONY_REQUEST_MUTE QStringLiteral("kdeconnect.telephony.request_mute") -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_PLUGIN_TELEPHONY) - class TelephonyPlugin : public KdeConnectPlugin { diff --git a/smsapp/CMakeLists.txt b/smsapp/CMakeLists.txt index 19f69d88d..c1c764e16 100644 --- a/smsapp/CMakeLists.txt +++ b/smsapp/CMakeLists.txt @@ -2,9 +2,30 @@ qt5_add_resources(KCSMS_SRCS resources.qrc) find_package(KF5People) +set(smshelper_debug_file_SRCS) +ecm_qt_declare_logging_category( + smshelper_debug_file_SRCS HEADER smshelper_debug.h + IDENTIFIER KDECONNECT_SMS_SMSHELPER CATEGORY_NAME kdeconnect.sms.smshelper + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (smshelper)") + +set(sms_debug_files_SRCS) +ecm_qt_declare_logging_category( + sms_debug_files_SRCS HEADER sms_conversation_debug.h + IDENTIFIER KDECONNECT_SMS_CONVERSATION_MODEL CATEGORY_NAME kdeconnect.sms.conversation + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (sms conversation model)") + +ecm_qt_declare_logging_category( + sms_debug_files_SRCS HEADER sms_conversations_list_debug.h + IDENTIFIER KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL CATEGORY_NAME kdeconnect.sms.conversations_list + DEFAULT_SEVERITY Warning + EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (sms conversations list)") + add_library(kdeconnectsmshelper smshelper.cpp gsmasciimap.cpp + ${smshelper_debug_file_SRCS} ) set_target_properties(kdeconnectsmshelper PROPERTIES @@ -35,7 +56,8 @@ add_executable(kdeconnect-sms conversationlistmodel.cpp conversationmodel.cpp conversationssortfilterproxymodel.cpp - ${KCSMS_SRCS}) + ${KCSMS_SRCS} + ${sms_debug_files_SRCS}) target_include_directories(kdeconnect-sms PUBLIC ${CMAKE_BINARY_DIR}) diff --git a/smsapp/conversationlistmodel.cpp b/smsapp/conversationlistmodel.cpp index f0cb75831..854787d43 100644 --- a/smsapp/conversationlistmodel.cpp +++ b/smsapp/conversationlistmodel.cpp @@ -22,7 +22,6 @@ #include "conversationlistmodel.h" #include -#include #include #include @@ -30,8 +29,7 @@ #include "interfaces/conversationmessage.h" #include "interfaces/dbusinterfaces.h" #include "smshelper.h" - -Q_LOGGING_CATEGORY(KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL, "kdeconnect.sms.conversations_list") +#include "sms_conversations_list_debug.h" #define INVALID_THREAD_ID -1 #define INVALID_DATE -1 diff --git a/smsapp/conversationlistmodel.h b/smsapp/conversationlistmodel.h index 0a9dc54fc..f84f1106a 100644 --- a/smsapp/conversationlistmodel.h +++ b/smsapp/conversationlistmodel.h @@ -23,13 +23,10 @@ #define CONVERSATIONLISTMODEL_H #include -#include #include "interfaces/conversationmessage.h" #include "interfaces/dbusinterfaces.h" -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_SMS_CONVERSATIONS_LIST_MODEL) - class ConversationListModel : public QStandardItemModel { diff --git a/smsapp/conversationmodel.cpp b/smsapp/conversationmodel.cpp index 189339192..c8bccfa74 100644 --- a/smsapp/conversationmodel.cpp +++ b/smsapp/conversationmodel.cpp @@ -21,14 +21,12 @@ #include "conversationmodel.h" -#include - #include #include "interfaces/conversationmessage.h" #include "smshelper.h" -Q_LOGGING_CATEGORY(KDECONNECT_SMS_CONVERSATION_MODEL, "kdeconnect.sms.conversation") +#include "sms_conversation_debug.h" ConversationModel::ConversationModel(QObject* parent) : QStandardItemModel(parent) diff --git a/smsapp/conversationmodel.h b/smsapp/conversationmodel.h index 96a6b98c3..14784e3e5 100644 --- a/smsapp/conversationmodel.h +++ b/smsapp/conversationmodel.h @@ -23,14 +23,11 @@ #define CONVERSATIONMODEL_H #include -#include #include #include "interfaces/conversationmessage.h" #include "interfaces/dbusinterfaces.h" -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_SMS_CONVERSATION_MODEL) - #define INVALID_THREAD_ID -1 class ConversationModel diff --git a/smsapp/smshelper.cpp b/smsapp/smshelper.cpp index fab12f112..7b0bca529 100644 --- a/smsapp/smshelper.cpp +++ b/smsapp/smshelper.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -35,8 +34,7 @@ #include "interfaces/conversationmessage.h" #include "smsapp/gsmasciimap.h" - -Q_LOGGING_CATEGORY(KDECONNECT_SMS_SMSHELPER, "kdeconnect.sms.smshelper") +#include "smshelper_debug.h" QObject* SmsHelper::singletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine) { diff --git a/smsapp/smshelper.h b/smsapp/smshelper.h index deb7afb0e..47e089324 100644 --- a/smsapp/smshelper.h +++ b/smsapp/smshelper.h @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -34,8 +33,6 @@ #include "kdeconnectsms_export.h" #include "smsapp/smscharcount.h" -Q_DECLARE_LOGGING_CATEGORY(KDECONNECT_SMS_SMSHELPER) - class PersonsCache; class KDECONNECTSMSAPPLIB_EXPORT SmsHelper : public QObject