summaryrefslogtreecommitdiff
path: root/config.tests
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-05-08 14:59:22 +0300
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-05-09 10:23:06 +0200
commit3cfd14a551b3b4830aa8e9e8522242cb8e4321ba (patch)
treedef448099ee9e537be52df51c66d2490e873fd7c /config.tests
parent9d7ef928ce0febdcee3cb4327b7f4fc559d3aba1 (diff)
downloadqtwayland-3cfd14a551b3b4830aa8e9e8522242cb8e4321ba.tar.gz
Compile with new xkbcommon API
Change-Id: Ie3f45a1e624cae3abb71d85c7ea8107b0f6b710c Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'config.tests')
-rw-r--r--config.tests/xkbcommon/main.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/config.tests/xkbcommon/main.cpp b/config.tests/xkbcommon/main.cpp
index 27422bf2..9eb8506d 100644
--- a/config.tests/xkbcommon/main.cpp
+++ b/config.tests/xkbcommon/main.cpp
@@ -42,17 +42,28 @@
#include <X11/keysym.h>
#include <QtCore/qnamespace.h>
+#include <string.h>
-int main(int argc, char **argv)
+int main()
{
- struct xkb_rule_names names;
- names.rules = "evdev";
- names.model = "pc105";
- names.layout = "us";
- names.variant = "";
- names.options = "";
+ xkb_rule_names names;
+ names.rules = strdup("evdev");
+ names.model = strdup("pc105");
+ names.layout = strdup("us");
+ names.variant = strdup("");
+ names.options = strdup("");
+
+ xkb_context *context = xkb_context_new();
+ if (context) {
+ xkb_keymap * keymap = xkb_map_new_from_names(context, &names);
+ if (keymap) {
+ xkb_state *state = xkb_state_new(keymap);
+ if (state)
+ xkb_state_unref(state);
+ xkb_map_unref(keymap);
+ }
+ xkb_context_unref(context);
+ }
- struct xkb_desc *xkb = xkb_compile_keymap_from_rules(&names);
- Q_UNUSED(xkb);
return 0;
}