Merge lp:~3v1n0/unity-control-center/use-proper-ccp-profile-path into lp:unity-control-center

Proposed by Marco Trevisan (Treviño) on 2016-07-05
Status: Merged
Approved by: Sebastien Bacher on 2016-07-05
Approved revision: 12867
Merged at revision: 12868
Proposed branch: lp:~3v1n0/unity-control-center/use-proper-ccp-profile-path
Merge into: lp:unity-control-center
Diff against target: 61 lines (+21/-3)
1 file modified
panels/appearance/cc-appearance-panel.c (+21/-3)
To merge this branch: bzr merge lp:~3v1n0/unity-control-center/use-proper-ccp-profile-path
Reviewer Review Type Date Requested Status
Sebastien Bacher 2016-07-05 Approve on 2016-07-05
Review via email: mp+299171@code.launchpad.net

Commit message

CcAppearancePanel: read COMPIZ_CONFIG_PROFILE value to choose the right settings path

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panels/appearance/cc-appearance-panel.c'
2--- panels/appearance/cc-appearance-panel.c 2016-01-28 16:15:49 +0000
3+++ panels/appearance/cc-appearance-panel.c 2016-07-05 14:29:35 +0000
4@@ -99,7 +99,7 @@
5 };
6
7 #define UNITY_GSETTINGS_SCHEMA "org.compiz.unityshell"
8-#define UNITY_PROFILE_PATH "/org/compiz/profiles/unity/plugins/"
9+#define UNITY_PROFILE_PATH "/org/compiz/profiles/%s/plugins/"
10 #define UNITY_GSETTINGS_PATH UNITY_PROFILE_PATH"unityshell/"
11 #define UNITY_ICONSIZE_KEY "icon-size"
12 #define UNITY_LAUNCHERSENSITIVITY_KEY "edge-responsiveness"
13@@ -1848,6 +1848,19 @@
14
15 /* </hacks> */
16
17+static gchar *
18+compiz_profile_gsettings_path (const gchar *path)
19+{
20+ const gchar *profile = "unity";
21+
22+ if (g_strcmp0 (g_getenv ("COMPIZ_CONFIG_PROFILE"), "ubuntu-lowgfx") == 0)
23+ {
24+ profile = "unity-lowgfx";
25+ }
26+
27+ return g_strdup_printf (path, profile);
28+}
29+
30 static void
31 setup_unity_settings (CcAppearancePanel *self)
32 {
33@@ -1858,6 +1871,7 @@
34 GtkScale* launcher_sensitivity_scale;
35 GSettingsSchema *schema;
36 GSettingsSchemaSource* source;
37+ gchar *settings_path;
38
39 source = g_settings_schema_source_get_default ();
40 schema = g_settings_schema_source_lookup (source, UNITY_OWN_GSETTINGS_SCHEMA, TRUE);
41@@ -1875,14 +1889,18 @@
42 schema = g_settings_schema_source_lookup (source, UNITY_GSETTINGS_SCHEMA, TRUE);
43 if (schema)
44 {
45- priv->unity_settings = g_settings_new_with_path (UNITY_GSETTINGS_SCHEMA, UNITY_GSETTINGS_PATH);
46+ settings_path = compiz_profile_gsettings_path (UNITY_GSETTINGS_PATH);
47+ priv->unity_settings = g_settings_new_with_path (UNITY_GSETTINGS_SCHEMA, settings_path);
48 g_settings_schema_unref (schema);
49+ g_free (settings_path);
50 }
51 schema = g_settings_schema_source_lookup (source, COMPIZCORE_GSETTINGS_SCHEMA, TRUE);
52 if (schema)
53 {
54- priv->compizcore_settings = g_settings_new_with_path (COMPIZCORE_GSETTINGS_SCHEMA, COMPIZCORE_GSETTINGS_PATH);
55+ settings_path = compiz_profile_gsettings_path (COMPIZCORE_GSETTINGS_PATH);
56+ priv->compizcore_settings = g_settings_new_with_path (COMPIZCORE_GSETTINGS_SCHEMA, settings_path);
57 g_settings_schema_unref (schema);
58+ g_free (settings_path);
59 }
60
61 if (!priv->unity_settings || !priv->compizcore_settings || !priv->unity_own_settings || !priv->unity_launcher_settings)

Subscribers

People subscribed via source and target branches