diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-07-01 19:22:17 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-07-01 19:22:17 (GMT) |
commit | bfd453d597d23b5c782aa8d40eb744d2ab56838e (patch) | |
tree | b285ada70fcb80b367542ec876716b2aa33ebc5c /plugins/pychrysalide/glibext | |
parent | 2f1a1323b4b6c5d4ff84a6d4d335e0cf56c5c8fa (diff) |
Introduced attributes for loaded contents.
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; |