mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
GParamSpec: add g_param_spec_get_default_value()
The way of getting the default value out of a GParamSpec is to allocate a GValue, initialise it, then call g_param_spec_set_default() to set the default value into that GValue. This is exactly how we handle setting the default value for all of the construct properties that were not explicitly passed to g_object_new(). Instead of doing the alloc/init/store on all construct properties on every call to g_object_new(), we can cache those GValues in the private data of the GParamSpec itself and reuse them. This patch does not actually make that change to g_object_new() yet, but it adds the API to GParamSpec so that a future patch to GObject can make the change. https://bugzilla.gnome.org/show_bug.cgi?id=698056
This commit is contained in:
@@ -480,6 +480,7 @@ g_param_spec_ref
|
||||
g_param_spec_unref
|
||||
g_param_spec_sink
|
||||
g_param_spec_ref_sink
|
||||
g_param_spec_get_default_value
|
||||
g_param_value_set_default
|
||||
g_param_value_defaults
|
||||
g_param_value_validate
|
||||
|
Reference in New Issue
Block a user