diff options
Diffstat (limited to 'plugins/pychrysalide/glibext')
-rw-r--r-- | plugins/pychrysalide/glibext/configuration.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/pychrysalide/glibext/configuration.c b/plugins/pychrysalide/glibext/configuration.c index 0fefc13..6b890a8 100644 --- a/plugins/pychrysalide/glibext/configuration.c +++ b/plugins/pychrysalide/glibext/configuration.c @@ -833,13 +833,19 @@ static PyObject *py_generic_config_new(PyTypeObject *type, PyObject *args, PyObj int ret; /* Bilan de lecture des args. */ GGenConfig *config; /* Version GLib du format */ - ret = PyArg_ParseTuple(args, "s", &name); + name = NULL; + + ret = PyArg_ParseTuple(args, "|s", &name); if (!ret) return NULL; - config = g_generic_config_new(name); + if (name == NULL) + config = g_generic_config_new(); + else + config = g_generic_config_new_from_file(name); + g_object_ref_sink(G_OBJECT(config)); result = pygobject_new(G_OBJECT(config)); - g_object_unref(config); + g_object_unref(G_OBJECT(config)); return result; |