summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbkeyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp28
1 files changed, 9 insertions, 19 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;
}