Merge lp:~laney/indicator-keyboard/lp1627057 into lp:indicator-keyboard

Proposed by Iain Lane
Status: Merged
Approved by: Iain Lane
Approved revision: 1104
Merged at revision: 1104
Proposed branch: lp:~laney/indicator-keyboard/lp1627057
Merge into: lp:indicator-keyboard
Diff against target: 43 lines (+23/-0)
1 file modified
lib/main.vala (+23/-0)
To merge this branch: bzr merge lp:~laney/indicator-keyboard/lp1627057
Reviewer Review Type Date Requested Status
Iain Lane Approve
William Hua Pending
Review via email: mp+308004@code.launchpad.net

Commit message

Don't clobber unity-settings-daemon's configured input sources when migrating from old configurations

Description of the change

See bug #1627057. I don't understand why this happens now, or why it would be linked to parts of the session being started by systemd, but it seems like i-keyboard is clobbering the values that u-s-d sets up.

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

(Self approving the MP, since none of the usual suspects are around today and I think this is important to have in the image. Sorry if this breaks things...)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/main.vala'
--- lib/main.vala 2016-08-03 15:12:49 +0000
+++ lib/main.vala 2016-10-09 13:26:05 +0000
@@ -433,9 +433,26 @@
433 user_list.get_user_by_name ("");433 user_list.get_user_by_name ("");
434 } else {434 } else {
435 if (!indicator_settings.get_boolean ("migrated")) {435 if (!indicator_settings.get_boolean ("migrated")) {
436 string[] seen_sources = {};
436 var builder = new VariantBuilder (new VariantType ("a(ss)"));437 var builder = new VariantBuilder (new VariantType ("a(ss)"));
437 var length = 0;438 var length = 0;
438439
440 foreach (var pair in source_settings.get_value ("sources")) {
441 unowned string source_type;
442 unowned string source_name;
443
444 ((!) pair).get ("(&s&s)", out source_type, out source_name);
445
446 if (source_name in seen_sources)
447 continue;
448
449 builder.add ("(ss)", source_type, source_name);
450
451 seen_sources += source_name;
452
453 length++;
454 }
455
439 var layout_settings = new Settings ("org.gnome.libgnomekbd.keyboard");456 var layout_settings = new Settings ("org.gnome.libgnomekbd.keyboard");
440 var layouts = layout_settings.get_strv ("layouts");457 var layouts = layout_settings.get_strv ("layouts");
441458
@@ -444,7 +461,13 @@
444 source = source.replace (" ", "+");461 source = source.replace (" ", "+");
445 source = source.replace ("\t", "+");462 source = source.replace ("\t", "+");
446463
464 if (source in seen_sources)
465 continue;
466
447 builder.add ("(ss)", "xkb", source);467 builder.add ("(ss)", "xkb", source);
468
469 seen_sources += source;
470
448 length++;471 length++;
449 }472 }
450473

Subscribers

People subscribed via source and target branches

to all changes: