summaryrefslogtreecommitdiff
path: root/src/gui/panel.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2021-01-01 23:20:42 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2021-01-01 23:20:42 (GMT)
commitdcd5e0b104143b110997029aa0728731f4087ad8 (patch)
tree141a79ade5eae6e469ba9e5255882039e9c29a3e /src/gui/panel.c
parent7b320516abf871eefe009ff6fe4fb86ed921fed9 (diff)
Managed GObject references each time a configuration parameter is accessed.
Diffstat (limited to 'src/gui/panel.c')
-rw-r--r--src/gui/panel.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gui/panel.c b/src/gui/panel.c
index 976a2d7..5b21620 100644
--- a/src/gui/panel.c
+++ b/src/gui/panel.c
@@ -516,40 +516,31 @@ bool gtk_panel_item_class_setup_configuration(const GPanelItemClass *class, GGen
bool result; /* Bilan à retourner */
char *key; /* Clef d'accès à un paramètre */
bool dock_at_startup; /* Affichage dès le départ ? */
- GCfgParam *param; /* Paramètre chargé */
char *path; /* Localisation du panneau */
- result = true;
-
key = gtk_panel_item_class_build_configuration_key(class, "dock_at_startup");
dock_at_startup = class->dock_at_startup(class);
- param = g_generic_config_create_param_if_not_exist(config, key, CPT_BOOLEAN, dock_at_startup);
+ result = g_generic_config_create_param_if_not_exist(config, key, CPT_BOOLEAN, dock_at_startup);
free(key);
- if (param == NULL)
- {
- result = false;
+ if (!result)
goto exit;
- }
key = gtk_panel_item_class_build_configuration_key(class, "path");
path = class->get_path(class);
- param = g_generic_config_create_param_if_not_exist(config, key, CPT_STRING, path);
-
- if (param == NULL)
- result = false;
+ result = g_generic_config_create_param_if_not_exist(config, key, CPT_STRING, path);
free(path);
- exit:
-
free(key);
+ exit:
+
return result;
}