diff --git a/applets/systemtray/CMakeLists.txt b/applets/systemtray/CMakeLists.txt index c111f4e95..f1a30f6c3 100644 --- a/applets/systemtray/CMakeLists.txt +++ b/applets/systemtray/CMakeLists.txt @@ -6,6 +6,11 @@ set(systemtray_SRCS systemtray.cpp ) +ecm_qt_declare_logging_category(systemtray_SRCS HEADER debug.h + IDENTIFIER SYSTEM_TRAY + CATEGORY_NAME kde.systemtray + DEFAULT_SEVERITY Info) + add_library(org.kde.plasma.private.systemtray MODULE ${systemtray_SRCS}) kcoreaddons_desktop_to_json(org.kde.plasma.private.systemtray package/metadata.desktop) @@ -19,7 +24,6 @@ target_link_libraries(org.kde.plasma.private.systemtray KF5::XmlGui KF5::I18n) - install(TARGETS org.kde.plasma.private.systemtray DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets) add_subdirectory(container) diff --git a/applets/systemtray/debug.h b/applets/systemtray/debug.h deleted file mode 100644 index af44d87ed..000000000 --- a/applets/systemtray/debug.h +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * debug.h * - * * - * Copyright 2013 Sebastian Kügler * - * * - * 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) any later version. * - * * - * 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, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#ifndef SYSTEMTRAYDEBUG_H -#define SYSTEMTRAYDEBUG_H - -#include - -Q_DECLARE_LOGGING_CATEGORY(SYSTEMTRAY) - -#endif \ No newline at end of file diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp index c87e82472..30d25a1d0 100644 --- a/applets/systemtray/systemtray.cpp +++ b/applets/systemtray/systemtray.cpp @@ -44,8 +44,6 @@ #include -Q_LOGGING_CATEGORY(SYSTEMTRAY, "systemtray") - /* * An app may also load icons from their own directories, so we need a new iconloader that takes this into account * This is wrapped into a subclass of iconengine so the iconloader lifespan matches the icon object @@ -149,7 +147,7 @@ QVariant SystemTray::resolveIcon(const QVariant &variant, const QString &iconThe return QVariant(QIcon(new AppIconEngine(variant.toString(), path, appName))); } else { - qCWarning(SYSTEMTRAY) << "Wrong IconThemePath" << path << ": too short or does not end with 'icons'"; + qCWarning(SYSTEM_TRAY) << "Wrong IconThemePath" << path << ": too short or does not end with 'icons'"; } } @@ -344,7 +342,7 @@ void SystemTray::restoreContents(KConfigGroup &group) void SystemTray::restorePlasmoids() { if (!isContainment()) { - qCWarning(SYSTEMTRAY) << "Loaded as an applet, this shouldn't have happened"; + qCWarning(SYSTEM_TRAY) << "Loaded as an applet, this shouldn't have happened"; return; } @@ -374,7 +372,7 @@ void SystemTray::restorePlasmoids() m_knownPlugins[plugin] = group.toInt(); } } - qCWarning(SYSTEMTRAY) << "Known plasmoid ids:"<< m_knownPlugins; + qCWarning(SYSTEM_TRAY) << "Known plasmoid ids:"<< m_knownPlugins; //X-Plasma-NotificationArea @@ -391,7 +389,7 @@ void SystemTray::restorePlasmoids() foreach (const KPluginInfo &info, applets) { const QString dbusactivation = info.property(QStringLiteral("X-Plasma-DBusActivationService")).toString(); if (!dbusactivation.isEmpty()) { - qCDebug(SYSTEMTRAY) << "ST Found DBus-able Applet: " << info.pluginName() << dbusactivation; + qCDebug(SYSTEM_TRAY) << "ST Found DBus-able Applet: " << info.pluginName() << dbusactivation; m_dbusActivatableTasks[info.pluginName()] = dbusactivation; continue; } @@ -426,7 +424,7 @@ void SystemTray::restorePlasmoids() } foreach (const KPluginInfo &info, sortedApplets) { - qCDebug(SYSTEMTRAY) << " Adding applet: " << info.name(); + qCDebug(SYSTEM_TRAY) << " Adding applet: " << info.name(); if (m_allowedPlasmoids.contains(info.pluginName())) { newTask(info.pluginName()); } @@ -526,7 +524,7 @@ void SystemTray::serviceNameFetchFinished(QDBusPendingCallWatcher* watcher, cons watcher->deleteLater(); if (propsReply.isError()) { - qCWarning(SYSTEMTRAY) << "Could not get list of available D-Bus services"; + qCWarning(SYSTEM_TRAY) << "Could not get list of available D-Bus services"; } else { foreach (const QString& serviceName, propsReply.value()) { serviceRegistered(serviceName); @@ -556,7 +554,7 @@ void SystemTray::serviceOwnerChanged(const QString &serviceName, const QString & void SystemTray::serviceRegistered(const QString &service) { - //qCDebug(SYSTEMTRAY) << "DBus service appeared:" << service; + //qCDebug(SYSTEM_TRAY) << "DBus service appeared:" << service; for (auto it = m_dbusActivatableTasks.constBegin(), end = m_dbusActivatableTasks.constEnd(); it != end; ++it) { const QString &plugin = it.key(); if (!m_allowedPlasmoids.contains(plugin)) { @@ -567,7 +565,7 @@ void SystemTray::serviceRegistered(const QString &service) QRegExp rx(pattern); rx.setPatternSyntax(QRegExp::Wildcard); if (rx.exactMatch(service)) { - //qCDebug(SYSTEMTRAY) << "ST : DBus service " << m_dbusActivatableTasks[plugin] << "appeared. Loading " << plugin; + //qCDebug(SYSTEM_TRAY) << "ST : DBus service " << m_dbusActivatableTasks[plugin] << "appeared. Loading " << plugin; newTask(plugin); m_dbusServiceCounts[plugin]++; } @@ -576,7 +574,7 @@ void SystemTray::serviceRegistered(const QString &service) void SystemTray::serviceUnregistered(const QString &service) { - //qCDebug(SYSTEMTRAY) << "DBus service disappeared:" << service; + //qCDebug(SYSTEM_TRAY) << "DBus service disappeared:" << service; for (auto it = m_dbusActivatableTasks.constBegin(), end = m_dbusActivatableTasks.constEnd(); it != end; ++it) { const QString &plugin = it.key(); @@ -591,7 +589,7 @@ void SystemTray::serviceUnregistered(const QString &service) m_dbusServiceCounts[plugin]--; Q_ASSERT(m_dbusServiceCounts[plugin] >= 0); if (m_dbusServiceCounts[plugin] == 0) { - //qCDebug(SYSTEMTRAY) << "ST : DBus service " << m_dbusActivatableTasks[plugin] << " disappeared. Unloading " << plugin; + //qCDebug(SYSTEM_TRAY) << "ST : DBus service " << m_dbusActivatableTasks[plugin] << " disappeared. Unloading " << plugin; cleanupTask(plugin); } } diff --git a/components/keyboardlayout/CMakeLists.txt b/components/keyboardlayout/CMakeLists.txt index 0d5331e3e..d357a8373 100644 --- a/components/keyboardlayout/CMakeLists.txt +++ b/components/keyboardlayout/CMakeLists.txt @@ -2,6 +2,12 @@ set(keyboardlayoutplugin_SRCS keyboardlayout.cpp keyboardlayoutplugin.cpp) + +ecm_qt_declare_logging_category(keyboardlayoutplugin_SRCS HEADER debug.h + IDENTIFIER KEYBOARD_LAYOUT + CATEGORY_NAME kde.keyboardlayout + DEFAULT_SEVERITY Info) + add_library(keyboardlayoutplugin SHARED ${keyboardlayoutplugin_SRCS}) target_link_libraries(keyboardlayoutplugin Qt5::Core diff --git a/components/keyboardlayout/keyboardlayout.cpp b/components/keyboardlayout/keyboardlayout.cpp index 15206ba6c..195de076f 100644 --- a/components/keyboardlayout/keyboardlayout.cpp +++ b/components/keyboardlayout/keyboardlayout.cpp @@ -23,8 +23,7 @@ #include #include - -Q_LOGGING_CATEGORY(KEYBOARD_LAYOUT, "org.kde.keyboardLayout") +#include "debug.h" KeyboardLayout::KeyboardLayout(QObject* parent) : QObject(parent) diff --git a/components/keyboardlayout/keyboardlayout.h b/components/keyboardlayout/keyboardlayout.h index f8e3586c1..ad2a8337a 100644 --- a/components/keyboardlayout/keyboardlayout.h +++ b/components/keyboardlayout/keyboardlayout.h @@ -22,7 +22,6 @@ #include #include -#include class QDBusInterface; class QDBusPendingCallWatcher; @@ -77,7 +76,5 @@ private: }; -Q_DECLARE_LOGGING_CATEGORY(KEYBOARD_LAYOUT) - #endif // KEYBOARDLAYOUT_H diff --git a/dataengines/mpris2/CMakeLists.txt b/dataengines/mpris2/CMakeLists.txt index f73dd87ad..b187c19d8 100644 --- a/dataengines/mpris2/CMakeLists.txt +++ b/dataengines/mpris2/CMakeLists.txt @@ -10,6 +10,11 @@ set(mpris2_engine_SRCS playercontainer.cpp ) +ecm_qt_declare_logging_category(mpris2_engine_SRCS HEADER debug.h + IDENTIFIER MPRIS2 + CATEGORY_NAME kde.dataengine.mpris + DEFAULT_SEVERITY Info) + set_source_files_properties( org.freedesktop.DBus.Properties.xml org.mpris.MediaPlayer2.Player.xml diff --git a/dataengines/mpris2/debug.h b/dataengines/mpris2/debug.h deleted file mode 100644 index 9f780cc70..000000000 --- a/dataengines/mpris2/debug.h +++ /dev/null @@ -1,2 +0,0 @@ -#include -Q_DECLARE_LOGGING_CATEGORY(MPRIS2) diff --git a/dataengines/mpris2/mpris2engine.cpp b/dataengines/mpris2/mpris2engine.cpp index 0ed623415..fa494d0c3 100644 --- a/dataengines/mpris2/mpris2engine.cpp +++ b/dataengines/mpris2/mpris2engine.cpp @@ -30,8 +30,6 @@ #include "multiplexer.h" #include "multiplexedservice.h" -Q_LOGGING_CATEGORY(MPRIS2, "plasma.engine.mpris2") - Mpris2Engine::Mpris2Engine(QObject* parent, const QVariantList& args) : Plasma::DataEngine(parent)