diff options
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 28 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.h | 2 |
2 files changed, 10 insertions, 20 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 92b24f4722..73cfb76bfc 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -663,23 +663,14 @@ void QXcbKeyboard::clearXKBConfig() memset(&xkb_names, 0, sizeof(xkb_names)); } -void QXcbKeyboard::printKeymapError(const QString &error) const +void QXcbKeyboard::printKeymapError(const char *error) const { - qWarning() << "Qt: " << error; - // check if XKB config root is a valid path - const QDir xkbRoot = qEnvironmentVariableIsSet("QT_XKB_CONFIG_ROOT") - ? QString::fromLocal8Bit(qgetenv("QT_XKB_CONFIG_ROOT")) - : DFLT_XKB_CONFIG_ROOT; - if (!xkbRoot.exists() || xkbRoot.dirName() != "xkb") { - qWarning() << "Set QT_XKB_CONFIG_ROOT to provide a valid XKB configuration data path, current search paths: " - << xkbRoot.path() << ". Use ':' as separator to provide several search paths."; - return; - } - qWarning() << "_XKB_RULES_NAMES property contains:" << "\nrules : " << xkb_names.rules << - "\nmodel : " << xkb_names.model << "\nlayout : " << xkb_names.layout << - "\nvariant : " << xkb_names.variant << "\noptions : " << xkb_names.options << - "\nIf this looks like a valid keyboard layout information then you might need to " - "update XKB configuration data on the system (http://cgit.freedesktop.org/xkeyboard-config/)."; + qWarning() << error << "Current XKB configuration data search paths are: "; + for (unsigned int i = 0; i < xkb_context_num_include_paths(xkb_context); ++i) + qWarning() << xkb_context_include_path_get(xkb_context, i); + qWarning() << "Use QT_XKB_CONFIG_ROOT environmental variable to provide an additional search path, " + "add ':' as separator to provide several search paths and/or make sure that XKB configuration data " + "directory contains recent enough contents, to update please see http://cgit.freedesktop.org/xkeyboard-config/ ."; } void QXcbKeyboard::updateKeymap() @@ -696,7 +687,7 @@ void QXcbKeyboard::updateKeymap() xkb_context = xkb_context_new((xkb_context_flags)0); } if (!xkb_context) { - printKeymapError("Failed to create XKB context!"); + printKeymapError("Qt: Failed to create XKB context!"); m_config = false; return; } @@ -731,8 +722,7 @@ void QXcbKeyboard::updateKeymap() if (xkb_keymap) { new_state = xkb_state_new(xkb_keymap); } else { - // failed to compile from RMLVO, give a verbose error message - printKeymapError("Qt: Failed to compile a keymap!"); + printKeymapError("Failed to compile a keymap!"); m_config = false; return; } diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h index 36ce1ea2f0..aefd9655ed 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.h +++ b/src/plugins/platforms/xcb/qxcbkeyboard.h @@ -92,7 +92,7 @@ protected: QString keysymToUnicode(xcb_keysym_t sym) const; int keysymToQtKey(xcb_keysym_t keysym) const; int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const; - void printKeymapError(const QString &error) const; + void printKeymapError(const char *error) const; void readXKBConfig(); void clearXKBConfig(); |