diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 6f53e4b8..0a33b3cf 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -52,6 +52,7 @@ get_filename_component(proto_xbindir "${some_x_program}" PATH) get_filename_component(XBINDIR "${proto_xbindir}" ABSOLUTE) get_filename_component(xrootdir "${XBINDIR}" PATH) set(XLIBDIR "${xrootdir}/lib/X11") +set(XKBDIR "${xrootdir}/share/X11") check_function_exists(getpassphrase HAVE_GETPASSPHRASE) check_function_exists(vsyslog HAVE_VSYSLOG) diff --git a/config-workspace.h.cmake b/config-workspace.h.cmake index 4a2dcbf4..78895892 100644 --- a/config-workspace.h.cmake +++ b/config-workspace.h.cmake @@ -143,6 +143,9 @@ /* X libraries directory */ #cmakedefine XLIBDIR "${XLIBDIR}" +/* xkb resources directory */ +#cmakedefine XKBDIR "${XKBDIR}" + /* Number of bits in a file offset, on hosts where this is settable. */ #define _FILE_OFFSET_BITS 64 diff --git a/kcontrol/keyboard/xkb_rules.cpp b/kcontrol/keyboard/xkb_rules.cpp index 616e7b84..cbaa556b 100644 --- a/kcontrol/keyboard/xkb_rules.cpp +++ b/kcontrol/keyboard/xkb_rules.cpp @@ -151,29 +151,7 @@ static QString findXkbRulesFile() QString rulesName = Rules::getRulesName(); if ( ! rulesName.isNull() ) { - QString xkbParentDir; - - QString base(XLIBDIR); - if( base.count('/') >= 3 ) { - // .../usr/lib/X11 -> /usr/share/X11/xkb vs .../usr/X11/lib -> /usr/X11/share/X11/xkb - QString delta = base.endsWith("X11") ? "/../../share/X11" : "/../share/X11"; - QDir baseDir(base + delta); - if( baseDir.exists() ) { - xkbParentDir = baseDir.absolutePath(); - } - else { - QDir baseDir(base + "/X11"); // .../usr/X11/lib/X11/xkb (old XFree) - if( baseDir.exists() ) { - xkbParentDir = baseDir.absolutePath(); - } - } - } - - if( xkbParentDir.isEmpty() ) { - xkbParentDir = "/usr/share/X11"; - } - - rulesFile = QString("%1/xkb/rules/%2.xml").arg(xkbParentDir, rulesName); + rulesFile = QString("%1/xkb/rules/%2.xml").arg(XKBDIR, rulesName); } return rulesFile;