Blame 0005-Use-categorized-logging-in-runtime-component.patch

Rex Dieter 9c29ac
From 8cc732ecc066b5250e501c85b7e2615d47c828ec Mon Sep 17 00:00:00 2001
Rex Dieter 9c29ac
From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
Rex Dieter 9c29ac
Date: Wed, 22 Apr 2015 09:53:26 +0200
Rex Dieter 9c29ac
Subject: [PATCH 5/5] Use categorized logging in runtime component
Rex Dieter 9c29ac
Rex Dieter 9c29ac
BUG: 346429
Rex Dieter 9c29ac
REVIEW: 123463
Rex Dieter 9c29ac
---
Rex Dieter 9c29ac
 src/runtime/CMakeLists.txt              |  1 +
Rex Dieter 9c29ac
 src/runtime/component.cpp               | 15 ++++++++-------
Rex Dieter 9c29ac
 src/runtime/globalshortcut.cpp          |  8 ++++----
Rex Dieter 9c29ac
 src/runtime/globalshortcutsregistry.cpp | 17 +++++++++--------
Rex Dieter 9c29ac
 src/runtime/kglobalaccel_mac.cpp        | 27 ++++++++++++++-------------
Rex Dieter 9c29ac
 src/runtime/kglobalaccel_win.cpp        |  3 ++-
Rex Dieter 9c29ac
 src/runtime/kglobalaccel_x11.cpp        | 23 ++++++++++++-----------
Rex Dieter 9c29ac
 src/runtime/kglobalacceld.cpp           | 31 ++++++++++++++++---------------
Rex Dieter 9c29ac
 src/runtime/logging.cpp                 | 21 +++++++++++++++++++++
Rex Dieter 9c29ac
 src/runtime/logging_p.h                 | 26 ++++++++++++++++++++++++++
Rex Dieter 9c29ac
 src/runtime/main.cpp                    |  3 ++-
Rex Dieter 9c29ac
 11 files changed, 115 insertions(+), 60 deletions(-)
Rex Dieter 9c29ac
 create mode 100644 src/runtime/logging.cpp
Rex Dieter 9c29ac
 create mode 100644 src/runtime/logging_p.h
Rex Dieter 9c29ac
Rex Dieter 9c29ac
diff --git a/src/runtime/CMakeLists.txt b/src/runtime/CMakeLists.txt
Rex Dieter 9c29ac
index e639fa5..8c7c761 100644
Rex Dieter 9c29ac
--- a/src/runtime/CMakeLists.txt
Rex Dieter 9c29ac
+++ b/src/runtime/CMakeLists.txt
Rex Dieter 9c29ac
@@ -9,6 +9,7 @@ set(kglobalaccel_SRCS
Rex Dieter 9c29ac
     main.cpp
Rex Dieter 9c29ac
     kglobalacceld.cpp
Rex Dieter 9c29ac
     component.cpp
Rex Dieter 9c29ac
+    logging.cpp
Rex Dieter 9c29ac
     globalshortcut.cpp
Rex Dieter 9c29ac
     globalshortcutsregistry.cpp
Rex Dieter 9c29ac
     globalshortcutcontext.cpp)
Rex Dieter 9c29ac
diff --git a/src/runtime/component.cpp b/src/runtime/component.cpp
Rex Dieter 9c29ac
index 3b5bdf9..663d0ad 100644
Rex Dieter 9c29ac
--- a/src/runtime/component.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/component.cpp
Rex Dieter 9c29ac
@@ -21,6 +21,7 @@
Rex Dieter 9c29ac
 #include "globalshortcut.h"
Rex Dieter 9c29ac
 #include "globalshortcutcontext.h"
Rex Dieter 9c29ac
 #include "globalshortcutsregistry.h"
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 #include <config-kglobalaccel.h>
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include <qdebug>
Rex Dieter 9c29ac
@@ -165,7 +166,7 @@ bool Component::cleanUp()
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     Q_FOREACH (GlobalShortcut *shortcut, _current->_actions)
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << _current->_actions.size();
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << _current->_actions.size();
Rex Dieter 9c29ac
         if (!shortcut->isPresent())
Rex Dieter 9c29ac
             {
Rex Dieter 9c29ac
             changed = true;
Rex Dieter 9c29ac
@@ -189,7 +190,7 @@ bool Component::createGlobalShortcutContext(
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
     if (_contexts.value(uniqueName))
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << "Shortcut Context " << uniqueName << "already exists for component " << _uniqueName;
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Shortcut Context " << uniqueName << "already exists for component " << _uniqueName;
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
     _contexts.insert(uniqueName, new GlobalShortcutContext(uniqueName, friendlyName, this));
Rex Dieter 9c29ac
@@ -327,7 +328,7 @@ bool Component::isShortcutAvailable(
Rex Dieter 9c29ac
         const QString &component,
Rex Dieter 9c29ac
         const QString &context) const
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
-    qDebug() << QKeySequence(key).toString() << component;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << QKeySequence(key).toString() << component;
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     // if this component asks for the key. only check the keys in the same
Rex Dieter 9c29ac
     // context
Rex Dieter 9c29ac
@@ -382,7 +383,7 @@ void Component::loadSettings(KConfigGroup &configGroup)
Rex Dieter 9c29ac
                     // The shortcut is already used. The config file is
Rex Dieter 9c29ac
                     // broken. Ignore the request.
Rex Dieter 9c29ac
                     keys.removeAll(key);
Rex Dieter 9c29ac
-                    qWarning() << "Shortcut found twice in kglobalshortcutsrc.";
Rex Dieter 9c29ac
+                    qCWarning(KGLOBALACCELD) << "Shortcut found twice in kglobalshortcutsrc.";
Rex Dieter 9c29ac
                     }
Rex Dieter 9c29ac
                 }
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
@@ -466,11 +467,11 @@ void Component::writeSettings(KConfigGroup& configGroup) const
Rex Dieter 9c29ac
             contextGroup.writeEntry("_k_friendly_name", context->friendlyName());
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
-        // qDebug() << "writing group " << _uniqueName << ":" << context->uniqueName();
Rex Dieter 9c29ac
+        // qCDebug(KGLOBALACCELD) << "writing group " << _uniqueName << ":" << context->uniqueName();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
         Q_FOREACH(const GlobalShortcut *shortcut, context->_actions)
Rex Dieter 9c29ac
             {
Rex Dieter 9c29ac
-            // qDebug() << "writing" << shortcut->uniqueName();
Rex Dieter 9c29ac
+            // qCDebug(KGLOBALACCELD) << "writing" << shortcut->uniqueName();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
             // We do not write fresh shortcuts.
Rex Dieter 9c29ac
             // We do not write session shortcuts
Rex Dieter 9c29ac
@@ -478,7 +479,7 @@ void Component::writeSettings(KConfigGroup& configGroup) const
Rex Dieter 9c29ac
                 {
Rex Dieter 9c29ac
                 continue;
Rex Dieter 9c29ac
                 }
Rex Dieter 9c29ac
-            // qDebug() << "really writing" << shortcut->uniqueName();
Rex Dieter 9c29ac
+            // qCDebug(KGLOBALACCELD) << "really writing" << shortcut->uniqueName();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
             QStringList entry(stringFromKeys(shortcut->keys()));
Rex Dieter 9c29ac
             entry.append(stringFromKeys(shortcut->defaultKeys()));
Rex Dieter 9c29ac
diff --git a/src/runtime/globalshortcut.cpp b/src/runtime/globalshortcut.cpp
Rex Dieter 9c29ac
index 3fe7bd9..2fd8462 100644
Rex Dieter 9c29ac
--- a/src/runtime/globalshortcut.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/globalshortcut.cpp
Rex Dieter 9c29ac
@@ -26,7 +26,7 @@
Rex Dieter 9c29ac
 #include "component.h"
Rex Dieter 9c29ac
 #include "globalshortcutcontext.h"
Rex Dieter 9c29ac
 #include "globalshortcutsregistry.h"
Rex Dieter 9c29ac
-
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include <qdebug>
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -189,7 +189,7 @@ void GlobalShortcut::setKeys(const QList<int> newKeys)
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
         else
Rex Dieter 9c29ac
             {
Rex Dieter 9c29ac
-            qDebug() << _uniqueName << "skipping because key" << QKeySequence(key).toString() << "is already taken";
Rex Dieter 9c29ac
+            qCDebug(KGLOBALACCELD) << _uniqueName << "skipping because key" << QKeySequence(key).toString() << "is already taken";
Rex Dieter 9c29ac
             _keys.append(0);
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
@@ -226,7 +226,7 @@ void GlobalShortcut::setActive()
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
         if (key != 0 && !GlobalShortcutsRegistry::self()->registerKey(key, this))
Rex Dieter 9c29ac
             {
Rex Dieter 9c29ac
-            qDebug() << uniqueName() << ": Failed to register " << QKeySequence(key).toString();
Rex Dieter 9c29ac
+            qCDebug(KGLOBALACCELD) << uniqueName() << ": Failed to register " << QKeySequence(key).toString();
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -246,7 +246,7 @@ void GlobalShortcut::setInactive()
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
         if (key != 0 && !GlobalShortcutsRegistry::self()->unregisterKey(key, this))
Rex Dieter 9c29ac
             {
Rex Dieter 9c29ac
-            qDebug() << uniqueName() << ": Failed to unregister " << QKeySequence(key).toString();
Rex Dieter 9c29ac
+            qCDebug(KGLOBALACCELD) << uniqueName() << ": Failed to unregister " << QKeySequence(key).toString();
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
diff --git a/src/runtime/globalshortcutsregistry.cpp b/src/runtime/globalshortcutsregistry.cpp
Rex Dieter 9c29ac
index 3e4d720..446e766 100644
Rex Dieter 9c29ac
--- a/src/runtime/globalshortcutsregistry.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/globalshortcutsregistry.cpp
Rex Dieter 9c29ac
@@ -21,6 +21,7 @@
Rex Dieter 9c29ac
 #include "globalshortcut.h"
Rex Dieter 9c29ac
 #include "globalshortcutcontext.h"
Rex Dieter 9c29ac
 #include <config-kglobalaccel.h>
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include <qdebug>
Rex Dieter 9c29ac
 #include <klocalizedstring>
Rex Dieter 9c29ac
@@ -189,20 +190,20 @@ bool GlobalShortcutsRegistry::keyPressed(int keyQt)
Rex Dieter 9c29ac
         // ALT+PRINT is SYSREQ on my keyboard. So we grab something we think
Rex Dieter 9c29ac
         // is ALT+PRINT but symXToKeyQt and modXToQt make ALT+SYSREQ of it
Rex Dieter 9c29ac
         // when pressed (correctly). We can't match that.
Rex Dieter 9c29ac
-        qDebug() << "Got unknown key" << QKeySequence(keyQt).toString();
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Got unknown key" << QKeySequence(keyQt).toString();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
         // In production mode just do nothing.
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
     else if (!shortcut->isActive())
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << "Got inactive key" << QKeySequence(keyQt).toString();
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Got inactive key" << QKeySequence(keyQt).toString();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
         // In production mode just do nothing.
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
-    qDebug() << QKeySequence(keyQt).toString() << "=" << shortcut->uniqueName();
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << QKeySequence(keyQt).toString() << "=" << shortcut->uniqueName();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     QStringList data(shortcut->context()->component()->uniqueName());
Rex Dieter 9c29ac
     data.append(shortcut->uniqueName());
Rex Dieter 9c29ac
@@ -228,7 +229,7 @@ void GlobalShortcutsRegistry::loadSettings()
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
     foreach (const QString &groupName, _config.groupList())
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << "Loading group " << groupName;
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Loading group " << groupName;
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
         Q_ASSERT(groupName.indexOf('\x1d')==-1);
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -288,17 +289,17 @@ bool GlobalShortcutsRegistry::registerKey(int key, GlobalShortcut *shortcut)
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
     if (key == 0)
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << shortcut->uniqueName() << ": Key '" << QKeySequence(key).toString()
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << shortcut->uniqueName() << ": Key '" << QKeySequence(key).toString()
Rex Dieter 9c29ac
                  << "' already taken by " << _active_keys.value(key)->uniqueName() << ".";
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
     else if (_active_keys.value(key))
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << shortcut->uniqueName() << ": Attempt to register key 0.";
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << shortcut->uniqueName() << ": Attempt to register key 0.";
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
-    qDebug() << "Registering key" << QKeySequence(key).toString() << "for"
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << "Registering key" << QKeySequence(key).toString() << "for"
Rex Dieter 9c29ac
              << shortcut->context()->component()->uniqueName() << ":" << shortcut->uniqueName();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     _active_keys.insert(key, shortcut);
Rex Dieter 9c29ac
@@ -340,7 +341,7 @@ bool GlobalShortcutsRegistry::unregisterKey(int key, GlobalShortcut *shortcut)
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
-    qDebug() << "Unregistering key" << QKeySequence(key).toString() << "for"
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << "Unregistering key" << QKeySequence(key).toString() << "for"
Rex Dieter 9c29ac
              << shortcut->context()->component()->uniqueName() << ":" << shortcut->uniqueName();
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     _manager->grabKey(key, false);
Rex Dieter 9c29ac
diff --git a/src/runtime/kglobalaccel_mac.cpp b/src/runtime/kglobalaccel_mac.cpp
Rex Dieter 9c29ac
index daaa24c..b79eec1 100644
Rex Dieter 9c29ac
--- a/src/runtime/kglobalaccel_mac.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/kglobalaccel_mac.cpp
Rex Dieter 9c29ac
@@ -29,6 +29,7 @@
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include "globalshortcutsregistry.h"
Rex Dieter 9c29ac
 #include "kkeyserver.h"
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void * inUserData)
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
@@ -36,14 +37,14 @@ OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEve
Rex Dieter 9c29ac
     if (eventKind == kEventRawKeyDown) {
Rex Dieter 9c29ac
         UInt32 keycode;
Rex Dieter 9c29ac
         if (GetEventParameter(inEvent, kEventParamKeyCode, typeUInt32, NULL, sizeof(keycode), NULL, &keycode) != noErr) {
Rex Dieter 9c29ac
-            qWarning() << "Error retrieving keycode parameter from event";
Rex Dieter 9c29ac
+            qCWarning(KGLOBALACCELD) << "Error retrieving keycode parameter from event";
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
-        qDebug() << " key down, keycode = " << keycode;
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << " key down, keycode = " << keycode;
Rex Dieter 9c29ac
     } else if (eventKind == kEventHotKeyPressed) {
Rex Dieter 9c29ac
         KGlobalAccelImpl* impl = static_cast<kglobalaccelimpl *="">(inUserData);
Rex Dieter 9c29ac
         EventHotKeyID hotkey;
Rex Dieter 9c29ac
         if (GetEventParameter(inEvent, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(hotkey), NULL, &hotkey) != noErr) {
Rex Dieter 9c29ac
-            qWarning() << "Error retrieving hotkey parameter from event";
Rex Dieter 9c29ac
+            qCWarning(KGLOBALACCELD) << "Error retrieving hotkey parameter from event";
Rex Dieter 9c29ac
             return eventNotHandledErr;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
         // Typecasts necesary to prevent a warning from gcc
Rex Dieter 9c29ac
@@ -72,7 +73,7 @@ KGlobalAccelImpl::KGlobalAccelImpl(GlobalShortcutsRegistry* owner)
Rex Dieter 9c29ac
         CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), this, layoutChanged, str, NULL, CFNotificationSuspensionBehaviorHold);
Rex Dieter 9c29ac
         CFRelease(str);
Rex Dieter 9c29ac
     } else {
Rex Dieter 9c29ac
-        qWarning() << "Couldn't create CFString to register for keyboard notifications";
Rex Dieter 9c29ac
+        qCWarning(KGLOBALACCELD) << "Couldn't create CFString to register for keyboard notifications";
Rex Dieter 9c29ac
     }
Rex Dieter 9c29ac
 }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -86,15 +87,15 @@ KGlobalAccelImpl::~KGlobalAccelImpl()
Rex Dieter 9c29ac
 bool KGlobalAccelImpl::grabKey( int keyQt, bool grab )
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
     if (grab) {
Rex Dieter 9c29ac
-        qDebug() << "Grabbing key " << keyQt;
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Grabbing key " << keyQt;
Rex Dieter 9c29ac
         QList<uint> keyCodes;
Rex Dieter 9c29ac
         uint mod;
Rex Dieter 9c29ac
         KKeyServer::keyQtToCodeMac( keyQt, keyCodes );
Rex Dieter 9c29ac
         KKeyServer::keyQtToModMac( keyQt, mod );
Rex Dieter 9c29ac
         
Rex Dieter 9c29ac
-        qDebug() << "keyQt: " << keyQt << " mod: " << mod;
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "keyQt: " << keyQt << " mod: " << mod;
Rex Dieter 9c29ac
         foreach (uint keyCode, keyCodes) {
Rex Dieter 9c29ac
-            qDebug() << "  keyCode: " << keyCode;
Rex Dieter 9c29ac
+            qCDebug(KGLOBALACCELD) << "  keyCode: " << keyCode;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
         
Rex Dieter 9c29ac
         EventHotKeyID ehkid;
Rex Dieter 9c29ac
@@ -104,17 +105,17 @@ bool KGlobalAccelImpl::grabKey( int keyQt, bool grab )
Rex Dieter 9c29ac
         foreach (uint keyCode, keyCodes) {
Rex Dieter 9c29ac
             EventHotKeyRef ref;
Rex Dieter 9c29ac
             if (RegisterEventHotKey(keyCode, mod, ehkid, m_eventTarget, 0, &ref) != noErr) {
Rex Dieter 9c29ac
-                qWarning() << "RegisterEventHotKey failed!";
Rex Dieter 9c29ac
+                qCWarning(KGLOBALACCELD) << "RegisterEventHotKey failed!";
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
             hotkeys.append(ref);
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
         refs->insert(keyQt, hotkeys);
Rex Dieter 9c29ac
     } else {
Rex Dieter 9c29ac
-        qDebug() << "Ungrabbing key " << keyQt;
Rex Dieter 9c29ac
-        if (refs->count(keyQt) == 0) qWarning() << "Trying to ungrab a key thas is not grabbed";
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Ungrabbing key " << keyQt;
Rex Dieter 9c29ac
+        if (refs->count(keyQt) == 0) qCWarning(KGLOBALACCELD) << "Trying to ungrab a key thas is not grabbed";
Rex Dieter 9c29ac
         foreach (const EventHotKeyRef &ref, refs->value(keyQt)) {
Rex Dieter 9c29ac
             if (UnregisterEventHotKey(ref) != noErr) {
Rex Dieter 9c29ac
-                qWarning() << "UnregisterEventHotKey should not fail!";
Rex Dieter 9c29ac
+                qCWarning(KGLOBALACCELD) << "UnregisterEventHotKey should not fail!";
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
         refs->remove(keyQt);
Rex Dieter 9c29ac
@@ -126,10 +127,10 @@ void KGlobalAccelImpl::setEnabled(bool enable)
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
     if (enable) {
Rex Dieter 9c29ac
         if (InstallEventHandler(m_eventTarget, m_eventHandler, 1, m_eventType, this, &m_curHandler) != noErr)
Rex Dieter 9c29ac
-            qWarning() << "InstallEventHandler failed!";
Rex Dieter 9c29ac
+            qCWarning(KGLOBALACCELD) << "InstallEventHandler failed!";
Rex Dieter 9c29ac
     } else {
Rex Dieter 9c29ac
         if (RemoveEventHandler(m_curHandler) != noErr)
Rex Dieter 9c29ac
-            qWarning() << "RemoveEventHandler failed!";
Rex Dieter 9c29ac
+            qCWarning(KGLOBALACCELD) << "RemoveEventHandler failed!";
Rex Dieter 9c29ac
     }
Rex Dieter 9c29ac
 }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
diff --git a/src/runtime/kglobalaccel_win.cpp b/src/runtime/kglobalaccel_win.cpp
Rex Dieter 9c29ac
index 7457e34..079fc9f 100644
Rex Dieter 9c29ac
--- a/src/runtime/kglobalaccel_win.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/kglobalaccel_win.cpp
Rex Dieter 9c29ac
@@ -26,6 +26,7 @@
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include "kglobalaccel.h"
Rex Dieter 9c29ac
 #include "globalshortcutsregistry.h"
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include <qdebug>
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -39,7 +40,7 @@ KGlobalAccelImpl::KGlobalAccelImpl(GlobalShortcutsRegistry* owner)
Rex Dieter 9c29ac
 bool KGlobalAccelImpl::grabKey( int keyQt, bool grab )
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
     if( !keyQt ) {
Rex Dieter 9c29ac
-        qWarning() << "Tried to grab key with null code.";
Rex Dieter 9c29ac
+        qCWarning(KGLOBALACCELD) << "Tried to grab key with null code.";
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
     }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
diff --git a/src/runtime/kglobalaccel_x11.cpp b/src/runtime/kglobalaccel_x11.cpp
Rex Dieter 9c29ac
index abee5bc..2600220 100644
Rex Dieter 9c29ac
--- a/src/runtime/kglobalaccel_x11.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/kglobalaccel_x11.cpp
Rex Dieter 9c29ac
@@ -20,6 +20,7 @@
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include "kglobalaccel_x11.h"
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 #include "globalshortcutsregistry.h"
Rex Dieter 9c29ac
 #include "kkeyserver.h"
Rex Dieter 9c29ac
 #include <netwm.h>
Rex Dieter 9c29ac
@@ -54,7 +55,7 @@ static void calculateGrabMasks()
Rex Dieter 9c29ac
 			KKeyServer::modXNumLock() |
Rex Dieter 9c29ac
 			KKeyServer::modXScrollLock() |
Rex Dieter 9c29ac
 			KKeyServer::modXModeSwitch();
Rex Dieter 9c29ac
-	//qDebug() << "g_keyModMaskXAccel = " << g_keyModMaskXAccel
Rex Dieter 9c29ac
+	//qCDebug(KGLOBALACCELD) << "g_keyModMaskXAccel = " << g_keyModMaskXAccel
Rex Dieter 9c29ac
 	//	<< "g_keyModMaskXOnOrOff = " << g_keyModMaskXOnOrOff << endl;
Rex Dieter 9c29ac
 }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -91,7 +92,7 @@ bool KGlobalAccelImpl::grabKey( int keyQt, bool grab )
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
     }
Rex Dieter 9c29ac
 	if( !keyQt ) {
Rex Dieter 9c29ac
-        qDebug() << "Tried to grab key with null code.";
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Tried to grab key with null code.";
Rex Dieter 9c29ac
 		return false;
Rex Dieter 9c29ac
 	}
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -100,13 +101,13 @@ bool KGlobalAccelImpl::grabKey( int keyQt, bool grab )
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 	// Resolve the modifier
Rex Dieter 9c29ac
 	if( !KKeyServer::keyQtToModX(keyQt, &keyModX) ) {
Rex Dieter 9c29ac
-		qDebug() << "keyQt (0x" << hex << keyQt << ") failed to resolve to x11 modifier";
Rex Dieter 9c29ac
+		qCDebug(KGLOBALACCELD) << "keyQt (0x" << hex << keyQt << ") failed to resolve to x11 modifier";
Rex Dieter 9c29ac
 		return false;
Rex Dieter 9c29ac
 	}
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 	// Resolve the X symbol
Rex Dieter 9c29ac
 	if( !KKeyServer::keyQtToSymX(keyQt, (int *)&keySymX) ) {
Rex Dieter 9c29ac
-		qDebug() << "keyQt (0x" << hex << keyQt << ") failed to resolve to x11 keycode";
Rex Dieter 9c29ac
+		qCDebug(KGLOBALACCELD) << "keyQt (0x" << hex << keyQt << ") failed to resolve to x11 keycode";
Rex Dieter 9c29ac
 		return false;
Rex Dieter 9c29ac
 	}
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -124,14 +125,14 @@ bool KGlobalAccelImpl::grabKey( int keyQt, bool grab )
Rex Dieter 9c29ac
 	    keySymX != xcb_key_symbols_get_keysym(m_keySymbols, keyCodeX, 0) &&
Rex Dieter 9c29ac
 	    keySymX == xcb_key_symbols_get_keysym(m_keySymbols, keyCodeX, 1) )
Rex Dieter 9c29ac
 	{
Rex Dieter 9c29ac
-		qDebug() << "adding shift to the grab";
Rex Dieter 9c29ac
+		qCDebug(KGLOBALACCELD) << "adding shift to the grab";
Rex Dieter 9c29ac
 		keyModX |= KKeyServer::modXShift();
Rex Dieter 9c29ac
 	}
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 	keyModX &= g_keyModMaskXAccel; // Get rid of any non-relevant bits in mod
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 	if( !keyCodeX ) {
Rex Dieter 9c29ac
-		qDebug() << "keyQt (0x" << hex << keyQt << ") was resolved to x11 keycode 0";
Rex Dieter 9c29ac
+		qCDebug(KGLOBALACCELD) << "keyQt (0x" << hex << keyQt << ") was resolved to x11 keycode 0";
Rex Dieter 9c29ac
 		return false;
Rex Dieter 9c29ac
 	}
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -169,7 +170,7 @@ bool KGlobalAccelImpl::grabKey( int keyQt, bool grab )
Rex Dieter 9c29ac
                 }
Rex Dieter 9c29ac
             }
Rex Dieter 9c29ac
 		if( failed ) {
Rex Dieter 9c29ac
-			qDebug() << "grab failed!\n";
Rex Dieter 9c29ac
+			qCDebug(KGLOBALACCELD) << "grab failed!\n";
Rex Dieter 9c29ac
 			for( uint m = 0; m <= 0xff; m++ ) {
Rex Dieter 9c29ac
 				if(( m & keyModMaskX ) == 0 )
Rex Dieter 9c29ac
                                     xcb_ungrab_key(QX11Info::connection(), keyCodeX, QX11Info::appRootWindow(), keyModX | m);
Rex Dieter 9c29ac
@@ -189,13 +190,13 @@ bool KGlobalAccelImpl::nativeEventFilter(const QByteArray &eventType, void *mess
Rex Dieter 9c29ac
     const uint8_t responseType = event->response_type & ~0x80;
Rex Dieter 9c29ac
     switch (responseType) {
Rex Dieter 9c29ac
         case XCB_MAPPING_NOTIFY:
Rex Dieter 9c29ac
-            qDebug() << "Got XMappingNotify event";
Rex Dieter 9c29ac
+            qCDebug(KGLOBALACCELD) << "Got XMappingNotify event";
Rex Dieter 9c29ac
             xcb_refresh_keyboard_mapping(m_keySymbols, reinterpret_cast<xcb_mapping_notify_event_t*>(event));
Rex Dieter 9c29ac
             x11MappingNotify();
Rex Dieter 9c29ac
             return true;
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
         case XCB_KEY_PRESS:
Rex Dieter 9c29ac
-            qDebug() << "Got XKeyPress event";
Rex Dieter 9c29ac
+            qCDebug(KGLOBALACCELD) << "Got XKeyPress event";
Rex Dieter 9c29ac
             return x11KeyPress(reinterpret_cast<xcb_key_press_event_t*>(event));
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
         default:
Rex Dieter 9c29ac
@@ -228,7 +229,7 @@ void KGlobalAccelImpl::x11MappingNotify()
Rex Dieter 9c29ac
 bool KGlobalAccelImpl::x11KeyPress(xcb_key_press_event_t *pEvent)
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
 	if (QWidget::keyboardGrabber() || QApplication::activePopupWidget()) {
Rex Dieter 9c29ac
-		qWarning() << "kglobalacceld should be popup and keyboard grabbing free!";
Rex Dieter 9c29ac
+		qCWarning(KGLOBALACCELD) << "kglobalacceld should be popup and keyboard grabbing free!";
Rex Dieter 9c29ac
 	}
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 	// Keyboard needs to be ungrabed after XGrabKey() activates the grab,
Rex Dieter 9c29ac
@@ -270,7 +271,7 @@ bool KGlobalAccelImpl::x11KeyPress(xcb_key_press_event_t *pEvent)
Rex Dieter 9c29ac
 	KKeyServer::modXToQt(keyModX, &keyModQt);
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 	if( keyModQt & Qt::SHIFT && !KKeyServer::isShiftAsModifierAllowed( keyCodeQt ) ) {
Rex Dieter 9c29ac
-		qDebug() << "removing shift modifier";
Rex Dieter 9c29ac
+		qCDebug(KGLOBALACCELD) << "removing shift modifier";
Rex Dieter 9c29ac
 		keyModQt &= ~Qt::SHIFT;
Rex Dieter 9c29ac
 	}
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
diff --git a/src/runtime/kglobalacceld.cpp b/src/runtime/kglobalacceld.cpp
Rex Dieter 9c29ac
index 4e7cb9d..e5d39c1 100644
Rex Dieter 9c29ac
--- a/src/runtime/kglobalacceld.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/kglobalacceld.cpp
Rex Dieter 9c29ac
@@ -26,6 +26,7 @@
Rex Dieter 9c29ac
 #include "globalshortcut.h"
Rex Dieter 9c29ac
 #include "globalshortcutcontext.h"
Rex Dieter 9c29ac
 #include "globalshortcutsregistry.h"
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include <qtcore qtimer="">
Rex Dieter 9c29ac
 #include <qtcore qmetamethod="">
Rex Dieter 9c29ac
@@ -85,7 +86,7 @@ GlobalShortcut *KGlobalAccelDPrivate::findAction(const QStringList &actionId) co
Rex Dieter 9c29ac
     // Check if actionId is valid
Rex Dieter 9c29ac
     if (actionId.size() != 4)
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << "Invalid! '" << actionId << "'";
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "Invalid! '" << actionId << "'";
Rex Dieter 9c29ac
         return NULL;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -117,7 +118,7 @@ GlobalShortcut *KGlobalAccelDPrivate::findAction(
Rex Dieter 9c29ac
     if (!component)
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-        qDebug() << componentUnique << "not found";
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << componentUnique << "not found";
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
         return NULL;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
@@ -129,13 +130,13 @@ GlobalShortcut *KGlobalAccelDPrivate::findAction(
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
     if (shortcut)
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << componentUnique
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << componentUnique
Rex Dieter 9c29ac
                  << contextUnique
Rex Dieter 9c29ac
                  << shortcut->uniqueName();
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
     else
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
-        qDebug() << "No match for" << shortcutUnique;
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "No match for" << shortcutUnique;
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
     return shortcut;
Rex Dieter 9c29ac
@@ -219,7 +220,7 @@ bool KGlobalAccelD::init()
Rex Dieter 9c29ac
             reg, SLOT(writeSettings()));
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     if (!QDBusConnection::sessionBus().registerService(QLatin1String("org.kde.kglobalaccel"))) {
Rex Dieter 9c29ac
-        qWarning() << "Failed to register service org.kde.kglobalaccel";
Rex Dieter 9c29ac
+        qCWarning(KGLOBALACCELD) << "Failed to register service org.kde.kglobalaccel";
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
     }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -227,7 +228,7 @@ bool KGlobalAccelD::init()
Rex Dieter 9c29ac
             QStringLiteral("/kglobalaccel"),
Rex Dieter 9c29ac
             this,
Rex Dieter 9c29ac
             QDBusConnection::ExportScriptableContents)) {
Rex Dieter 9c29ac
-        qWarning() << "Failed to register object kglobalaccel in org.kde.kglobalaccel";
Rex Dieter 9c29ac
+        qCWarning(KGLOBALACCELD) << "Failed to register object kglobalaccel in org.kde.kglobalaccel";
Rex Dieter 9c29ac
         return false;
Rex Dieter 9c29ac
     }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
@@ -336,7 +337,7 @@ QList<qdbusobjectpath> KGlobalAccelD::allComponents() const
Rex Dieter 9c29ac
 void KGlobalAccelD::blockGlobalShortcuts(bool block)
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << block;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << block;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
     block
Rex Dieter 9c29ac
         ? GlobalShortcutsRegistry::self()->deactivateShortcuts(true)
Rex Dieter 9c29ac
@@ -367,7 +368,7 @@ QList<int> KGlobalAccelD::defaultShortcut(const QStringList &action) const
Rex Dieter 9c29ac
 void KGlobalAccelD::doRegister(const QStringList &actionId)
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << actionId;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << actionId;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     // Check because we would not want to add a action for an invalid
Rex Dieter 9c29ac
@@ -397,7 +398,7 @@ void KGlobalAccelD::doRegister(const QStringList &actionId)
Rex Dieter 9c29ac
 QDBusObjectPath KGlobalAccelD::getComponent(const QString &componentUnique) const
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << componentUnique;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << componentUnique;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     KdeDGlobalAccel::Component *component =
Rex Dieter 9c29ac
@@ -418,7 +419,7 @@ QDBusObjectPath KGlobalAccelD::getComponent(const QString &componentUnique) cons
Rex Dieter 9c29ac
 QList<kglobalshortcutinfo> KGlobalAccelD::getGlobalShortcutsByKey(int key) const
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << key;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << key;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
     QList<globalshortcut*> shortcuts =
Rex Dieter 9c29ac
         GlobalShortcutsRegistry::self()->getShortcutsByKey(key);
Rex Dieter 9c29ac
@@ -427,7 +428,7 @@ QList<kglobalshortcutinfo> KGlobalAccelD::getGlobalShortcutsByKey(int key) const
Rex Dieter 9c29ac
     Q_FOREACH(const GlobalShortcut *sc, shortcuts)
Rex Dieter 9c29ac
         {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << sc->context()->uniqueName() << sc->uniqueName();
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << sc->context()->uniqueName() << sc->uniqueName();
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
         rc.append(static_cast<kglobalshortcutinfo>(*sc));
Rex Dieter 9c29ac
         }
Rex Dieter 9c29ac
@@ -448,7 +449,7 @@ bool KGlobalAccelD::isGlobalShortcutAvailable(int shortcut, const QString &compo
Rex Dieter 9c29ac
 void KGlobalAccelD::setInactive(const QStringList &actionId)
Rex Dieter 9c29ac
     {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << actionId;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << actionId;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     GlobalShortcut *shortcut = d->findAction(actionId);
Rex Dieter 9c29ac
@@ -460,7 +461,7 @@ void KGlobalAccelD::setInactive(const QStringList &actionId)
Rex Dieter 9c29ac
 bool KGlobalAccelD::unregister(const QString &componentUnique, const QString &shortcutUnique)
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << componentUnique << shortcutUnique;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << componentUnique << shortcutUnique;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     // Stop grabbing the key
Rex Dieter 9c29ac
@@ -478,7 +479,7 @@ bool KGlobalAccelD::unregister(const QString &componentUnique, const QString &sh
Rex Dieter 9c29ac
 void KGlobalAccelD::unRegister(const QStringList &actionId)
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << actionId;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << actionId;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     // Stop grabbing the key
Rex Dieter 9c29ac
@@ -545,7 +546,7 @@ QList<int> KGlobalAccelD::setShortcut(const QStringList &actionId,
Rex Dieter 9c29ac
 void KGlobalAccelD::setForeignShortcut(const QStringList &actionId, const QList<int> &keys)
Rex Dieter 9c29ac
 {
Rex Dieter 9c29ac
 #ifdef KDEDGLOBALACCEL_TRACE
Rex Dieter 9c29ac
-    qDebug() << actionId;
Rex Dieter 9c29ac
+    qCDebug(KGLOBALACCELD) << actionId;
Rex Dieter 9c29ac
 #endif
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     GlobalShortcut *shortcut = d->findAction(actionId);
Rex Dieter 9c29ac
diff --git a/src/runtime/logging.cpp b/src/runtime/logging.cpp
Rex Dieter 9c29ac
new file mode 100644
Rex Dieter 9c29ac
index 0000000..3b2c377
Rex Dieter 9c29ac
--- /dev/null
Rex Dieter 9c29ac
+++ b/src/runtime/logging.cpp
Rex Dieter 9c29ac
@@ -0,0 +1,21 @@
Rex Dieter 9c29ac
+/********************************************************************
Rex Dieter 9c29ac
+Copyright 2015  Martin Gräßlin <mgraesslin@kde.org>
Rex Dieter 9c29ac
+
Rex Dieter 9c29ac
+This library is free software; you can redistribute it and/or
Rex Dieter 9c29ac
+modify it under the terms of the GNU Lesser General Public
Rex Dieter 9c29ac
+License as published by the Free Software Foundation; either
Rex Dieter 9c29ac
+version 2.1 of the License, or (at your option) version 3, or any
Rex Dieter 9c29ac
+later version accepted by the membership of KDE e.V. (or its
Rex Dieter 9c29ac
+successor approved by the membership of KDE e.V.), which shall
Rex Dieter 9c29ac
+act as a proxy defined in Section 6 of version 3 of the license.
Rex Dieter 9c29ac
+
Rex Dieter 9c29ac
+This library is distributed in the hope that it will be useful,
Rex Dieter 9c29ac
+but WITHOUT ANY WARRANTY; without even the implied warranty of
Rex Dieter 9c29ac
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Rex Dieter 9c29ac
+Lesser General Public License for more details.
Rex Dieter 9c29ac
+
Rex Dieter 9c29ac
+You should have received a copy of the GNU Lesser General Public
Rex Dieter 9c29ac
+License along with this library.  If not, see <http: www.gnu.org="" licenses=""/>.
Rex Dieter 9c29ac
+*********************************************************************/
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
+Q_LOGGING_CATEGORY(KGLOBALACCELD, "kglobalaccel-runtime");
Rex Dieter 9c29ac
diff --git a/src/runtime/logging_p.h b/src/runtime/logging_p.h
Rex Dieter 9c29ac
new file mode 100644
Rex Dieter 9c29ac
index 0000000..6895851
Rex Dieter 9c29ac
--- /dev/null
Rex Dieter 9c29ac
+++ b/src/runtime/logging_p.h
Rex Dieter 9c29ac
@@ -0,0 +1,26 @@
Rex Dieter 9c29ac
+/********************************************************************
Rex Dieter 9c29ac
+Copyright 2015  Martin Gräßlin <mgraesslin@kde.org>
Rex Dieter 9c29ac
+
Rex Dieter 9c29ac
+This library is free software; you can redistribute it and/or
Rex Dieter 9c29ac
+modify it under the terms of the GNU Lesser General Public
Rex Dieter 9c29ac
+License as published by the Free Software Foundation; either
Rex Dieter 9c29ac
+version 2.1 of the License, or (at your option) version 3, or any
Rex Dieter 9c29ac
+later version accepted by the membership of KDE e.V. (or its
Rex Dieter 9c29ac
+successor approved by the membership of KDE e.V.), which shall
Rex Dieter 9c29ac
+act as a proxy defined in Section 6 of version 3 of the license.
Rex Dieter 9c29ac
+
Rex Dieter 9c29ac
+This library is distributed in the hope that it will be useful,
Rex Dieter 9c29ac
+but WITHOUT ANY WARRANTY; without even the implied warranty of
Rex Dieter 9c29ac
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Rex Dieter 9c29ac
+Lesser General Public License for more details.
Rex Dieter 9c29ac
+
Rex Dieter 9c29ac
+You should have received a copy of the GNU Lesser General Public
Rex Dieter 9c29ac
+License along with this library.  If not, see <http: www.gnu.org="" licenses=""/>.
Rex Dieter 9c29ac
+*********************************************************************/
Rex Dieter 9c29ac
+#ifndef KGLOBALACCELD_LOGGING_P_H
Rex Dieter 9c29ac
+#define KGLOBALACCELD_LOGGING_P_H
Rex Dieter 9c29ac
+#include <qdebug>
Rex Dieter 9c29ac
+#include <qloggingcategory>
Rex Dieter 9c29ac
+Q_DECLARE_LOGGING_CATEGORY(KGLOBALACCELD)
Rex Dieter 9c29ac
+
Rex Dieter 9c29ac
+#endif
Rex Dieter 9c29ac
diff --git a/src/runtime/main.cpp b/src/runtime/main.cpp
Rex Dieter 9c29ac
index fdf4d62..2e1a9cb 100644
Rex Dieter 9c29ac
--- a/src/runtime/main.cpp
Rex Dieter 9c29ac
+++ b/src/runtime/main.cpp
Rex Dieter 9c29ac
@@ -20,6 +20,7 @@
Rex Dieter 9c29ac
   */
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include "kglobalacceld.h"
Rex Dieter 9c29ac
+#include "logging_p.h"
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
 #include <kcrash.h>
Rex Dieter 9c29ac
 #include <kaboutdata>
Rex Dieter 9c29ac
@@ -71,7 +72,7 @@ extern "C" Q_DECL_EXPORT int main(int argc, char **argv)
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
     // check if kglobalaccel is disabled
Rex Dieter 9c29ac
     if (!isEnabled()) {
Rex Dieter 9c29ac
-        qDebug() << "kglobalaccel is disabled!";
Rex Dieter 9c29ac
+        qCDebug(KGLOBALACCELD) << "kglobalaccel is disabled!";
Rex Dieter 9c29ac
         return 0;
Rex Dieter 9c29ac
     }
Rex Dieter 9c29ac
 
Rex Dieter 9c29ac
-- 
Rex Dieter 9c29ac
1.9.3
Rex Dieter 9c29ac