From dae22ebfe48ea769fe55f5330411ca71e0a98542 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 13 Oct 2014 15:32:29 +0200 Subject: Switch to categorized logging in all the input handlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the rule qt.qpa.input (similarly to xcb). In addition, evdevkeyboard supports qt.qpa.input.keymap to enable keymap debug messages. For compatibility, evdevtouch retains the QT_QPA_EVDEV_DEBUG environment variable, this will simply turn on the associated logging rule. Change-Id: Ia038beb827346d2573ca9a2b69b8dcc53adcf0eb Reviewed-by: Shawn Rutledge Reviewed-by: Risto Avila Reviewed-by: Jørgen Lind --- .../input/evdevkeyboard/qevdevkeyboardmanager.cpp | 25 ++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp') diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp index 3f8eb1bcd5..4614fbd499 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp @@ -35,15 +35,12 @@ #include #include - -//#define QT_QPA_KEYMAP_DEBUG - -#ifdef QT_QPA_KEYMAP_DEBUG -#include -#endif +#include QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(qLcEvdevKey) + QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &specification, QObject *parent) : QObject(parent) { @@ -74,10 +71,7 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString & addKeyboard(device); if (devices.isEmpty()) { -#ifdef QT_QPA_KEYMAP_DEBUG - qWarning() << "Use device discovery"; -#endif - + qCDebug(qLcEvdevKey) << "evdevkeyboard: Using device discovery"; m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Keyboard, this); if (m_deviceDiscovery) { // scan and add already connected keyboards @@ -100,24 +94,19 @@ QEvdevKeyboardManager::~QEvdevKeyboardManager() void QEvdevKeyboardManager::addKeyboard(const QString &deviceNode) { -#ifdef QT_QPA_KEYMAP_DEBUG - qWarning() << "Adding keyboard at" << deviceNode; -#endif - + qCDebug(qLcEvdevKey) << "Adding keyboard at" << deviceNode; QEvdevKeyboardHandler *keyboard; keyboard = QEvdevKeyboardHandler::create(deviceNode, m_spec, m_defaultKeymapFile); if (keyboard) m_keyboards.insert(deviceNode, keyboard); else - qWarning("Failed to open keyboard"); + qWarning("Failed to open keyboard device %s", qPrintable(deviceNode)); } void QEvdevKeyboardManager::removeKeyboard(const QString &deviceNode) { if (m_keyboards.contains(deviceNode)) { -#ifdef QT_QPA_KEYMAP_DEBUG - qWarning() << "Removing keyboard at" << deviceNode; -#endif + qCDebug(qLcEvdevKey) << "Removing keyboard at" << deviceNode; QEvdevKeyboardHandler *keyboard = m_keyboards.value(deviceNode); m_keyboards.remove(deviceNode); delete keyboard; -- cgit v1.2.3