summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-07-15 05:51:57 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-07-15 05:51:57 +0800
commitfcea48cc8c78af202e7b104223220a997d0c1171 (patch)
tree225c0f37217ad764b489d5f55e58284966792503
parent0a46b1c16b67bbccb74c6244a1f2ea046980e770 (diff)
downloadcompizconfig-backend-gsettings-fcea48cc8c78af202e7b104223220a997d0c1171.tar.gz
compizconfig-backend-gsettings-fcea48cc8c78af202e7b104223220a997d0c1171.tar.bz2
Remove an ugly #define
-rw-r--r--src/gsettings.c22
-rw-r--r--src/gsettings.h4
2 files changed, 11 insertions, 15 deletions
diff --git a/src/gsettings.c b/src/gsettings.c
index 1d24d6d..6ecf913 100644
--- a/src/gsettings.c
+++ b/src/gsettings.c
@@ -298,7 +298,7 @@ readListValue (CCSSetting *setting)
GVariant *value;
GVariantIter *iter;
- CLEAN_SETTING_NAME;
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
switch (setting->info.forList.listType)
{
@@ -432,7 +432,7 @@ readListValue (CCSSetting *setting)
break;
}
- CLEANUP_CLEAN_SETTING_NAME;
+ free (cleanSettingName);
g_object_unref (settings);
free (variantType);
@@ -478,7 +478,7 @@ readOption (CCSSetting * setting)
return FALSE;
}
- CLEAN_SETTING_NAME;
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
KEYNAME(setting->parent->context->screenNum);
PATHNAME;
@@ -518,7 +518,7 @@ readOption (CCSSetting * setting)
"Settings from this path won't be read. Try to remove "
"that value so that operation can continue properly.\n",
pathName);
- CLEANUP_CLEAN_SETTING_NAME;
+ free (cleanSettingName);
g_object_unref (settings);
g_variant_unref (gsettingsValue);
return FALSE;
@@ -646,7 +646,7 @@ readOption (CCSSetting * setting)
break;
}
- CLEANUP_CLEAN_SETTING_NAME;
+ free (cleanSettingName);
g_object_unref (settings);
g_variant_unref (gsettingsValue);
@@ -662,7 +662,7 @@ writeListValue (CCSSetting *setting,
gchar *variantType = NULL;
CCSSettingValueList list;
- CLEAN_SETTING_NAME;
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
if (!ccsGetList (setting, &list))
return;
@@ -762,7 +762,7 @@ writeListValue (CCSSetting *setting,
g_variant_unref (value);
}
- CLEANUP_CLEAN_SETTING_NAME;
+ free (cleanSettingName);
g_object_unref (settings);
}
@@ -784,21 +784,21 @@ resetOptionToDefault (CCSSetting * setting)
{
GSettings *settings = getSettingsObjectForCCSSetting (setting);
- CLEAN_SETTING_NAME;
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
KEYNAME (setting->parent->context->screenNum);
PATHNAME;
g_settings_reset (settings, cleanSettingName);
g_object_unref (settings);
- CLEANUP_CLEAN_SETTING_NAME;
+ free (cleanSettingName);
}
void
writeOption (CCSSetting * setting)
{
GSettings *settings = getSettingsObjectForCCSSetting (setting);
- CLEAN_SETTING_NAME;
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
KEYNAME (setting->parent->context->screenNum);
PATHNAME;
@@ -931,7 +931,7 @@ writeOption (CCSSetting * setting)
}
g_object_unref (settings);
- CLEANUP_CLEAN_SETTING_NAME;
+ free (cleanSettingName);
}
static void
diff --git a/src/gsettings.h b/src/gsettings.h
index c432d17..5220a6d 100644
--- a/src/gsettings.h
+++ b/src/gsettings.h
@@ -72,8 +72,6 @@
#define NUM_WATCHED_DIRS 3
-#define CLEAN_SETTING_NAME char *cleanSettingName = translateKeyForGSettings (setting->name)
-
#define KEYNAME(sn) char keyName[BUFSIZE]; \
snprintf (keyName, BUFSIZE, "screen%i", sn);
@@ -88,8 +86,6 @@
"%s/%s/plugins/%s/%s/options/", COMPIZ, currentProfile, \
setting->parent->name, keyName);
-#define CLEANUP_CLEAN_SETTING_NAME free (cleanSettingName);
-
#define _GNU_SOURCE
typedef enum {