summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-12-05 00:39:57 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-12-05 00:39:57 (GMT)
commit1e3fa9b79ebe55698e2aa7d5484baec7e8400a8f (patch)
treec3581ceb7f8586f2f6822de563927a1246dd33a5 /src/glibext
parent6122bb7f34b178d4c07285adae16afcc55294b1f (diff)
Rewritten the whole API dealing with panels.
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/configuration.c2
-rw-r--r--src/glibext/configuration.h13
2 files changed, 14 insertions, 1 deletions
diff --git a/src/glibext/configuration.c b/src/glibext/configuration.c
index 256513a..c19f7ef 100644
--- a/src/glibext/configuration.c
+++ b/src/glibext/configuration.c
@@ -1541,7 +1541,7 @@ GCfgParam *_g_generic_config_add_param(GGenConfig *config, GCfgParam *param, boo
if (old != NULL)
{
g_clear_object(&param);
- goto exit;
+ goto exit;
}
config->params = g_list_append(config->params, param);
diff --git a/src/glibext/configuration.h b/src/glibext/configuration.h
index 13bc1da..49a289b 100644
--- a/src/glibext/configuration.h
+++ b/src/glibext/configuration.h
@@ -234,6 +234,19 @@ GCfgParam *_g_generic_config_add_param(GGenConfig *, GCfgParam *, bool);
})
+#define g_generic_config_create_param_if_not_exist(c, p, t, d) \
+ ({ \
+ GCfgParam *__result; \
+ __result = g_generic_config_search(c, p); \
+ if (__result == NULL) \
+ { \
+ __result = g_config_param_new(p, t, d); \
+ __result = g_generic_config_add_param(c, __result); \
+ } \
+ __result; \
+ })
+
+
#define g_generic_config_create_or_udpdate_param(c, p, t, d, v) \
({ \
GCfgParam *__param; \