libinput: Rename logging category to prevent clashes
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Mon, 17 Aug 2015 16:01:03 +0000 (18:01 +0200)
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Tue, 18 Aug 2015 08:07:21 +0000 (08:07 +0000)
Anything linking to platformsupport may use the same name so use
something less generic.

Change-Id: I657dd5dfcad9cf22585fcb17eda62deaf26ea6c4
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
src/platformsupport/input/libinput/qlibinputhandler.cpp
src/platformsupport/input/libinput/qlibinputkeyboard.cpp

index 1a64ad5a30bf91c603deb228cff7e1df51832b37..5aa66a4eafc0061c7ba453795d04c6a6214bd49d 100644 (file)
@@ -46,7 +46,7 @@
 
 QT_BEGIN_NAMESPACE
 
-Q_LOGGING_CATEGORY(qLcInput, "qt.qpa.input")
+Q_LOGGING_CATEGORY(qLcLibInput, "qt.qpa.input")
 
 static int liOpen(const char *path, int flags, void *user_data)
 {
@@ -75,7 +75,7 @@ static void liLogHandler(libinput *libinput, libinput_log_priority priority, con
     if (n > 0) {
         if (buf[n - 1] == '\n')
             buf[n - 1] = '\0';
-        qCDebug(qLcInput, "libinput: %s", buf);
+        qCDebug(qLcLibInput, "libinput: %s", buf);
     }
 }
 
@@ -93,7 +93,7 @@ QLibInputHandler::QLibInputHandler(const QString &key, const QString &spec)
         qFatal("Failed to get libinput context");
 
     libinput_log_set_handler(m_li, liLogHandler);
-    if (qLcInput().isDebugEnabled())
+    if (qLcLibInput().isDebugEnabled())
         libinput_log_set_priority(m_li, LIBINPUT_LOG_PRIORITY_DEBUG);
 
     if (libinput_udev_assign_seat(m_li, "seat0"))
index 5f1bc550b4aa9c306cf64617ce2122e8ae73464f..3bb9107e16df8877fba515b09761d26dbcede5be 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "qlibinputkeyboard_p.h"
 #include <QtCore/QTextCodec>
+#include <QtCore/QLoggingCategory>
 #include <qpa/qwindowsysteminterface.h>
 #include <libinput.h>
 #ifndef QT_NO_XKBCOMMON_EVDEV
@@ -42,6 +43,8 @@
 
 QT_BEGIN_NAMESPACE
 
+Q_DECLARE_LOGGING_CATEGORY(qLcLibInput)
+
 const int REPEAT_DELAY = 500;
 const int REPEAT_RATE = 100;
 
@@ -128,6 +131,7 @@ QLibInputKeyboard::QLibInputKeyboard()
 #endif
 {
 #ifndef QT_NO_XKBCOMMON_EVDEV
+    qCDebug(qLcLibInput) << "Using xkbcommon for key mapping";
     m_ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
     if (!m_ctx) {
         qWarning("Failed to create xkb context");
@@ -150,6 +154,8 @@ QLibInputKeyboard::QLibInputKeyboard()
 
     m_repeatTimer.setSingleShot(true);
     connect(&m_repeatTimer, &QTimer::timeout, this, &QLibInputKeyboard::handleRepeat);
+#else
+    qCWarning(qLcLibInput) << "X-less xkbcommon not available, not performing key mapping";
 #endif
 }