libinput: Rename logging category to prevent clashes

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>
This commit is contained in:
Laszlo Agocs 2015-08-17 18:01:03 +02:00
parent b652c19f08
commit 1fe890317a
2 changed files with 9 additions and 3 deletions

View 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"))

View 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
}