Merge lp:~wchwch/switchboard-plug-keyboard/fix-1479618 into lp:~elementary-pantheon/switchboard-plug-keyboard/trunk

Proposed by Alleen Wang
Status: Rejected
Rejected by: Danielle Foré
Proposed branch: lp:~wchwch/switchboard-plug-keyboard/fix-1479618
Merge into: lp:~elementary-pantheon/switchboard-plug-keyboard/trunk
Diff against target: 30 lines (+6/-3)
2 files modified
src/Pages/Layout/display.vala (+5/-2)
src/Pages/Layout/handler.vala (+1/-1)
To merge this branch: bzr merge lp:~wchwch/switchboard-plug-keyboard/fix-1479618
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+278396@code.launchpad.net

Description of the change

Fixed Bug#1479618 : switchboard crashes on keyboard

Root caused : When switchboard-plug-keyboard can't to find the keyboard layout via "layouts.txt", it will be crash.
Solution : Add check function for getting the layout and modify loop boundaries on "handler.get_name". If it can't find the keyboard layout on now setting, it will to use name of the keyboard layout and return.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

We now get the layouts list from xbd-data

Unmerged revisions

373. By Alleen Wang

Fixed Bug#1479618

Root caused : When switchboard-plug-keyboard can't to find the keyboard layout via "layouts.txt", it will be crash.
Solution : Add check function for getting the layout and modify loop boundaries on "handler.get_name". If it can't find the keyboard layout on now setting, it will to use name of the keyboard layout and return.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Pages/Layout/display.vala'
2--- src/Pages/Layout/display.vala 2015-10-27 00:02:07 +0000
3+++ src/Pages/Layout/display.vala 2015-11-24 03:46:00 +0000
4@@ -167,8 +167,11 @@
5
6 for (uint i = 0; i < settings.layouts.length; i++) {
7 string item = settings.layouts.get_layout (i).name;
8- handler.from_code (item, out layout, out variant);
9- item = handler.get_name (layout, variant);
10+
11+ if (handler.from_code (item, out layout, out variant))
12+ {
13+ item = handler.get_name (layout, variant);
14+ }
15
16 list_store.append (out iter);
17 list_store.set (iter, 0, item);
18
19=== modified file 'src/Pages/Layout/handler.vala'
20--- src/Pages/Layout/handler.vala 2014-08-10 19:29:15 +0000
21+++ src/Pages/Layout/handler.vala 2015-11-24 03:46:00 +0000
22@@ -53,7 +53,7 @@
23 if (parts[0] == null) return false;
24
25 while (codes[l] != parts[0])
26- if (l++ > codes.length)
27+ if (l++ >= codes.length)
28 return false;
29
30 if (parts[1] == null) return true;

Subscribers

People subscribed via source and target branches

to all changes: