diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-09-06 15:04:19 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-09-06 17:13:25 -0400 |
commit | 14c0ed8bae2b83b4da97f443f188970c3a9a1707 (patch) | |
tree | aa635408ff445de510e72520691954db96c90660 /gtk | |
parent | 2e52310d4b0c1871ffe673c6ff42e236ef88c7e6 (diff) | |
download | gtk+-14c0ed8bae2b83b4da97f443f188970c3a9a1707.tar.gz |
builder: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkbuilder.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 02c2cdabc8..5849cbe23f 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -242,8 +242,11 @@ static GType gtk_builder_real_get_type_from_name (GtkBuilder *builder, enum { PROP_0, PROP_TRANSLATION_DOMAIN, + LAST_PROP }; +static GParamSpec *builder_props[LAST_PROP]; + struct _GtkBuilderPrivate { gchar *domain; @@ -283,13 +286,14 @@ gtk_builder_class_init (GtkBuilderClass *klass) * * Since: 2.12 */ - g_object_class_install_property (gobject_class, - PROP_TRANSLATION_DOMAIN, - g_param_spec_string ("translation-domain", - P_("Translation Domain"), - P_("The translation domain used by gettext"), - NULL, - GTK_PARAM_READWRITE)); + builder_props[PROP_TRANSLATION_DOMAIN] = + g_param_spec_string ("translation-domain", + P_("Translation Domain"), + P_("The translation domain used by gettext"), + NULL, + GTK_PARAM_READWRITE); + + g_object_class_install_properties (gobject_class, LAST_PROP, builder_props); } static void @@ -1496,7 +1500,7 @@ gtk_builder_set_translation_domain (GtkBuilder *builder, g_free (builder->priv->domain); builder->priv->domain = new_domain; - g_object_notify (G_OBJECT (builder), "translation-domain"); + g_object_notify_by_pspec (G_OBJECT (builder), builder_props[PROP_TRANSLATION_DOMAIN]); } /** |