diff options
| author | Michael Nottebrock <lofi@FreeBSD.org> | 2004-11-08 00:34:12 +0000 |
|---|---|---|
| committer | Michael Nottebrock <lofi@FreeBSD.org> | 2004-11-08 00:34:12 +0000 |
| commit | 14a1da27f45c47f56c03f100467c4145b22cc27f (patch) | |
| tree | 1672be7254edbd4e14c07966ad43adbe5529db3b /x11/kde4-workspace/files/patch-kxkb_rules.cpp | |
| parent | * update to 0.20 (diff) | |
Update to KDE 3.3.1
Diffstat (limited to 'x11/kde4-workspace/files/patch-kxkb_rules.cpp')
| -rw-r--r-- | x11/kde4-workspace/files/patch-kxkb_rules.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/x11/kde4-workspace/files/patch-kxkb_rules.cpp b/x11/kde4-workspace/files/patch-kxkb_rules.cpp index d210eaf73139..00122a2b9898 100644 --- a/x11/kde4-workspace/files/patch-kxkb_rules.cpp +++ b/x11/kde4-workspace/files/patch-kxkb_rules.cpp @@ -1,11 +1,28 @@ --- kxkb/rules.cpp 2004/06/28 14:19:03 1.38 -+++ kxkb/rules.cpp 2004/08/29 19:05:04 1.39 -@@ -17,7 +17,7 @@ - #include "rules.h" ++++ kxkb/rules.cpp 2004/10/10 22:59:59 1.38.2.1 +@@ -1,3 +1,4 @@ ++#include <qwindowdefs.h> + #include <qfile.h> + #include <qtextstream.h> + #include <qregexp.h> +@@ -42,11 +43,19 @@ KeyRules::KeyRules(): + } - const char* X11DirList[2] = {"/usr/X11R6/lib/X11/", "/usr/local/X11R6/lib/X11/"}; --const char* rulesFileList[2] = {"xkb/rules/xfree86", "xkb/rules/xorg"}; -+const char* rulesFileList[2] = {"xkb/rules/xorg", "xkb/rules/xfree86"}; + QString rulesFile; +- for(int ii=0; ii<2; ii++) ++ Display *dpy = qt_xdisplay(); ++ XkbRF_VarDefsRec vd; ++ char *tmp= NULL; ++ if (XkbRF_GetNamesProp(dpy,&tmp,&vd) && tmp) ++ rulesFile = X11_DIR + QString("xkb/rules/%1").arg(tmp); ++ else { ++ // old way ++ for(int ii=0; ii<2; ii++) + if( QFile(X11_DIR + QString(rulesFileList[ii])).exists() ) { + rulesFile = X11_DIR + rulesFileList[ii]; + break; + } ++ } - KeyRules::KeyRules(): - m_layouts(90) + if( rulesFile.isEmpty() ) { + kdDebug() << "Cannot find rules file in " << X11_DIR << endl; |
