summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-12-31 11:40:42 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-12-31 11:40:42 (GMT)
commit8965133f188c817cbdf4fcf9d1f1b60462bbfe7d (patch)
tree96193fdbcb692790bb2ffe4de7b2020b0dbf528d /src/glibext
parent93e9ab125bced1374c7d4a03e5bd11a0dc1b2968 (diff)
Offered a custom configuration facility to each plugin.
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/configuration.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/glibext/configuration.c b/src/glibext/configuration.c
index 1fa2968..8746bfd 100644
--- a/src/glibext/configuration.c
+++ b/src/glibext/configuration.c
@@ -1323,14 +1323,21 @@ void g_generic_config_build(GGenConfig *config, const char *name)
{
char *suffix; /* Fin du nom de fichier */
- suffix = strdup("chrysalide");
- suffix = stradd(suffix, G_DIR_SEPARATOR_S);
- suffix = stradd(suffix, name);
- suffix = stradd(suffix, ".xml");
+ if (g_path_is_absolute(name))
+ config->filename = strdup(name);
- config->filename = get_xdg_config_dir(suffix);
+ else
+ {
+ suffix = strdup("chrysalide");
+ suffix = stradd(suffix, G_DIR_SEPARATOR_S);
+ suffix = stradd(suffix, name);
+ suffix = stradd(suffix, ".xml");
+
+ config->filename = get_xdg_config_dir(suffix);
- free(suffix);
+ free(suffix);
+
+ }
}
@@ -1468,7 +1475,8 @@ bool g_generic_config_write(GGenConfig *config)
g_generic_config_runlock(config);
- save_xml_file(xdoc, config->filename);
+ if (result)
+ result = save_xml_file(xdoc, config->filename);
close_xml_file(xdoc, context);