summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-07-15 03:27:45 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-07-15 03:27:45 +0800
commitde1cda158b3d4661a47e1310c701a810ca81711d (patch)
treef804df79a4d88a08dfcf730d3cdd1459a486ea9d
parentaf493da2eb6c249ce0399426d06d10641e805848 (diff)
downloadcompizconfig-backend-gsettings-de1cda158b3d4661a47e1310c701a810ca81711d.tar.gz
compizconfig-backend-gsettings-de1cda158b3d4661a47e1310c701a810ca81711d.tar.bz2
Profile deletion works in theory, though it seems like gsettings isn't
actually unsetting the keys right now
-rw-r--r--src/gsettings.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gsettings.c b/src/gsettings.c
index d9d1c87..c3322c7 100644
--- a/src/gsettings.c
+++ b/src/gsettings.c
@@ -2140,8 +2140,10 @@ deleteProfile (CCSContext *context,
GVariantBuilder *new_profiles_builder;
char *plugin, *prof;
GVariantIter *iter;
+ char *profileSettingsPath = g_strconcat ("/org/freedesktop/compizconfig/profile/", profile, "/", NULL);
+ GSettings *profile_settings = g_settings_new_with_path ("org.freedesktop.compizconfig.profile", profileSettingsPath);;
- plugins = g_settings_get_value (current_profile_settings, "plugins-with-set-values");
+ plugins = g_settings_get_value (current_profile_settings, "plugins-with-set-keys");
profiles = g_settings_get_value (compizconfig_settings, "existing-profiles");
iter = g_variant_iter_new (plugins);
@@ -2173,7 +2175,7 @@ deleteProfile (CCSContext *context,
char **key_ptr;
/* Unset all the keys */
- for (key_ptr = keys; key_ptr; key_ptr++)
+ for (key_ptr = keys; *key_ptr; key_ptr++)
g_settings_reset (settings, *key_ptr);
g_strfreev (keys);
@@ -2184,7 +2186,7 @@ deleteProfile (CCSContext *context,
/* Remove the profile from existing-profiles */
g_variant_iter_free (iter);
- g_settings_reset (current_profile_settings, "plugins-with-set-values");
+ g_settings_reset (profile_settings, "plugins-with-set-values");
iter = g_variant_iter_new (profiles);
new_profiles_builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
@@ -2201,6 +2203,8 @@ deleteProfile (CCSContext *context,
g_variant_unref (new_profiles);
g_variant_builder_unref (new_profiles_builder);
+ g_object_unref (profile_settings);
+
updateProfile (context);
return TRUE;