From 6ce6ab87472b7d227393ea1058424439168683cc Mon Sep 17 00:00:00 2001 From: Van de Bugger Date: Mon, 28 Feb 2011 03:35:25 +0300 Subject: Few messages added for easier troubleshooting. If setxkbmap fails to load rules file, it is not possible to find out where setxkbmap looks for it. Increasing verbosity level does not help: $ ./setxkbmap -v 10 Setting verbose level to 10 locale is C Couldn't find rules file (evdev) The problem fixed by adding two messages: before loading file and after successful loading. Messages are displayed if verbosity level is 8 or higher: $ ./setxkbmap -v 10 Setting verbose level to 10 locale is C Trying to load rules file ./rules/evdev... Trying to load rules file /usr/local/share/X11/xkb/rules/evdev... Couldn't find rules file (evdev) Signed-off-by: Van de Bugger Signed-off-by: Peter Hutterer --- setxkbmap.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'setxkbmap.c') diff --git a/setxkbmap.c b/setxkbmap.c index 04c3fdf..88adea7 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -186,6 +186,7 @@ FILE *findFileInPath(char *name); Bool addStringToOptions(char *opt_str, list_t *opts); char *stringFromOptions(char *orig, list_t *newOpts); Bool applyConfig(char *name); +XkbRF_RulesPtr tryLoadRules(char *name, char *locale, Bool wantDesc, Bool wantRules); Bool applyRules(void); Bool applyComponentNames(void); void printKeymap(void); @@ -804,6 +805,19 @@ applyConfig(char *name) return True; } +XkbRF_RulesPtr +tryLoadRules(char *name, char *locale, Bool wantDesc, Bool wantRules) +{ + XkbRF_RulesPtr rules = NULL; + VMSG1(7, "Trying to load rules file %s...\n", name); + rules = XkbRF_Load(name, locale, wantDesc, wantRules); + if (rules) + { + VMSG(7, "Success.\n"); + } + return rules; +} + /** * If any of model, layout, variant or options is specified, then compile the * options into the @@ -839,7 +853,7 @@ applyRules(void) if (rfName[0] == '/') { - rules = XkbRF_Load(rfName, settings.locale.value, True, True); + rules = tryLoadRules(rfName, settings.locale.value, True, True); } else { @@ -854,7 +868,7 @@ applyRules(void) inclPath.item[i], rfName); continue; } - rules = XkbRF_Load(buf, settings.locale.value, True, True); + rules = tryLoadRules(buf, settings.locale.value, True, True); } } if (!rules) -- cgit v1.2.3