diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-12-18 14:43:43 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-12-18 14:43:43 +0000 |
commit | 43fe10400e1beb50019f2eb9825173e2794da15b (patch) | |
tree | 60d476723e17a05b1c66c53db0e88e05a0c308c6 /tools | |
parent | 1796d6a2b2b9ec6060c7daa07e318d94ac35160e (diff) | |
download | drakx-kbd-mouse-x11-43fe10400e1beb50019f2eb9825173e2794da15b.tar drakx-kbd-mouse-x11-43fe10400e1beb50019f2eb9825173e2794da15b.tar.gz drakx-kbd-mouse-x11-43fe10400e1beb50019f2eb9825173e2794da15b.tar.bz2 drakx-kbd-mouse-x11-43fe10400e1beb50019f2eb9825173e2794da15b.tar.xz drakx-kbd-mouse-x11-43fe10400e1beb50019f2eb9825173e2794da15b.zip |
enhance "correctly handle default XkbModel" commit
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/keyboarddrake | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/keyboarddrake b/tools/keyboarddrake index d508018..5d79ea8 100755 --- a/tools/keyboarddrake +++ b/tools/keyboarddrake @@ -26,11 +26,9 @@ if (my ($kb) = grep { !/^-/ } @ARGV) { my ($xkb_models, $model2text) = keyboard::xkb_models(); s/ /|/ foreach values %$model2text; - my $default_XkbModel; - if (!$keyboard->{XkbModel}) { - $default_XkbModel = 1; - $keyboard->{XkbModel} = keyboard::default_XkbModel($keyboard); - } + my $default_XkbModel = keyboard::default_XkbModel($keyboard); + $keyboard->{XkbModel} ||= $default_XkbModel; + my $is_default_XkbModel = $keyboard->{XkbModel} eq $default_XkbModel; choose: $in->ask_from(N("Keyboard"), @@ -43,7 +41,7 @@ if (my ($kb) = grep { !/^-/ } @ARGV) { list => [ keyboard::KEYBOARDs() ], type => 'list', changed => sub { - if ($default_XkbModel) { + if ($is_default_XkbModel) { $keyboard->{XkbModel} = keyboard::default_XkbModel($keyboard); } }, @@ -54,7 +52,7 @@ if (my ($kb) = grep { !/^-/ } @ARGV) { { val => \$keyboard->{XkbModel}, format => sub { $model2text->{$_[0]} }, separator => '|', - changed => sub { $default_XkbModel = 0 }, + changed => sub { $is_default_XkbModel = 0 }, list => $xkb_models }, ]) or goto end; |