Merge lp:~attente/unity-settings-daemon/1430971 into lp:unity-settings-daemon

Proposed by William Hua on 2015-03-12
Status: Merged
Approved by: Sebastien Bacher on 2015-03-13
Approved revision: 4071
Merged at revision: 4071
Proposed branch: lp:~attente/unity-settings-daemon/1430971
Merge into: lp:unity-settings-daemon
Diff against target: 80 lines (+31/-28)
2 files modified
debian/control (+1/-2)
plugins/keyboard/gsd-keyboard-manager.c (+30/-26)
To merge this branch: bzr merge lp:~attente/unity-settings-daemon/1430971
Reviewer Review Type Date Requested Status
Sebastien Bacher 2015-03-12 Approve on 2015-03-13
PS Jenkins bot continuous-integration Approve on 2015-03-12
Review via email: mp+252830@code.launchpad.net

Commit Message

Remove fcitx-data from Recommends and check if the required file, config.desc, is available at runtime. Trying to dist-upgrade currently pulls in the fcitx-bin which is higher priority than ibus.

Description of the Change

Remove fcitx-data from Recommends and check if the required file, config.desc, is available at runtime. Trying to dist-upgrade currently pulls in the fcitx-bin which is higher priority than ibus.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-02-12 15:37:32 +0000
3+++ debian/control 2015-03-12 22:01:50 +0000
4@@ -58,8 +58,7 @@
5 nautilus-data (>= 2.91.3-1),
6 gnome-settings-daemon-schemas (>= 3.8),
7 gsettings-ubuntu-schemas (>= 0.0.1+14.04.20140224),
8-Recommends: fcitx-data,
9- ibus (>= 1.5.0),
10+Recommends: ibus (>= 1.5.0),
11 pulseaudio,
12 systemd-services
13 Pre-Depends: ${misc:Pre-Depends}
14
15=== modified file 'plugins/keyboard/gsd-keyboard-manager.c'
16--- plugins/keyboard/gsd-keyboard-manager.c 2015-02-12 15:37:32 +0000
17+++ plugins/keyboard/gsd-keyboard-manager.c 2015-03-12 22:01:50 +0000
18@@ -1566,32 +1566,36 @@
19 static void
20 update_share_state_from_per_window (GsdKeyboardManager *manager)
21 {
22- /* Set Fcitx' share state setting based on the GSettings per-window option. */
23- GSettings *settings = g_settings_new ("org.gnome.libgnomekbd.desktop");
24- gboolean per_window = g_settings_get_boolean (settings, "group-per-window");
25-
26- FcitxShareStateConfig config = { { NULL } };
27-
28- /* Load the user's Fcitx configuration. */
29- FILE *file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "r", NULL);
30- FcitxConfigFile *config_file = FcitxConfigParseConfigFileFp (file, get_fcitx_config_desc ());
31- FcitxShareStateConfigConfigBind (&config, config_file, get_fcitx_config_desc ());
32-
33- if (file)
34- fclose (file);
35-
36- config.share_state = per_window ? 0 : 1;
37-
38- /* Save the user's Fcitx configuration. */
39- file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "w", NULL);
40- FcitxConfigSaveConfigFileFp (file, &config.config, get_fcitx_config_desc ());
41-
42- if (file)
43- fclose (file);
44-
45- fcitx_input_method_reload_config (manager->priv->fcitx);
46-
47- g_object_unref (settings);
48+ FcitxConfigFileDesc *config_file_desc = get_fcitx_config_desc ();
49+
50+ if (config_file_desc) {
51+ /* Set Fcitx' share state setting based on the GSettings per-window option. */
52+ GSettings *settings = g_settings_new ("org.gnome.libgnomekbd.desktop");
53+ gboolean per_window = g_settings_get_boolean (settings, "group-per-window");
54+
55+ FcitxShareStateConfig config = { { NULL } };
56+
57+ /* Load the user's Fcitx configuration. */
58+ FILE *file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "r", NULL);
59+ FcitxConfigFile *config_file = FcitxConfigParseConfigFileFp (file, config_file_desc);
60+ FcitxShareStateConfigConfigBind (&config, config_file, config_file_desc);
61+
62+ if (file)
63+ fclose (file);
64+
65+ config.share_state = per_window ? 0 : 1;
66+
67+ /* Save the user's Fcitx configuration. */
68+ file = FcitxXDGGetFileUserWithPrefix (NULL, "config", "w", NULL);
69+ FcitxConfigSaveConfigFileFp (file, &config.config, config_file_desc);
70+
71+ if (file)
72+ fclose (file);
73+
74+ fcitx_input_method_reload_config (manager->priv->fcitx);
75+
76+ g_object_unref (settings);
77+ }
78 }
79
80 static void

Subscribers

People subscribed via source and target branches