summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/glibext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-07-01 19:22:17 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-07-01 19:22:17 (GMT)
commitbfd453d597d23b5c782aa8d40eb744d2ab56838e (patch)
treeb285ada70fcb80b367542ec876716b2aa33ebc5c /plugins/pychrysalide/glibext
parent2f1a1323b4b6c5d4ff84a6d4d335e0cf56c5c8fa (diff)
Introduced attributes for loaded contents.
Diffstat (limited to 'plugins/pychrysalide/glibext')
-rw-r--r--plugins/pychrysalide/glibext/configuration.c12
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;