diff options
| author | Milan Crha <mcrha@redhat.com> | 2014-06-05 01:46:25 +0800 |
|---|---|---|
| committer | Milan Crha <mcrha@redhat.com> | 2014-06-05 01:46:25 +0800 |
| commit | 2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f (patch) | |
| tree | fd60a103158c3cfdbbce197feca07d7fea008a3d /addressbook/gui | |
| parent | 668745ff49d8f312c7d419a691cdab3e128ded06 (diff) | |
| download | gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.gz gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.bz2 gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.lz gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.xz gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.tar.zst gsoc2013-evolution-2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f.zip | |
Ignore false GObject property change notifications
This is related to bug 698275, which did not cover all cases.
The problem here is that the dconf can in certain situation claim
that everything changed (path "/" changed), which GSettingsBinding
propagates to a GObject property unconditionally and GObject's
property setter (g_object_set_property()) also notifies about
the property change unconditionally, despite the real descendant
property setter properly checks for the value change. After all
these false notifications a callback on "notify" signal is called
and possibly an expensive operation is run.
Checking whether the value really changed helps in performance, for
which were added new e-util functions:
e_signal_connect_notify()
e_signal_connect_notify_after()
e_signal_connect_notify_swapped()
e_signal_connect_notify_object()
which have the same prototype as their GLib counterparts, but they allow
only "notify::..." signals and they test whether the value really changed
before they call the registered callback.
Diffstat (limited to 'addressbook/gui')
4 files changed, 7 insertions, 7 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index add2337faa..93f0828758 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -4378,7 +4378,7 @@ e_contact_editor_constructed (GObject *object) GTK_WINDOW (editor->priv->app), gtk_ui_manager_get_accel_group (editor->priv->ui_manager)); - g_signal_connect ( + e_signal_connect_notify ( editor->priv->focus_tracker, "notify::focus", G_CALLBACK (contact_editor_focus_widget_changed_cb), editor); @@ -4619,7 +4619,7 @@ e_contact_editor_set_property (GObject *object, editor->priv->target_client = editor->priv->source_client; g_object_ref (editor->priv->target_client); - editor->priv->target_editable_id = g_signal_connect ( + editor->priv->target_editable_id = e_signal_connect_notify ( editor->priv->target_client, "notify::readonly", G_CALLBACK (notify_readonly_cb), editor); @@ -4666,7 +4666,7 @@ e_contact_editor_set_property (GObject *object, editor->priv->target_client = target_client; g_object_ref (editor->priv->target_client); - editor->priv->target_editable_id = g_signal_connect ( + editor->priv->target_editable_id = e_signal_connect_notify ( editor->priv->target_client, "notify::readonly", G_CALLBACK (notify_readonly_cb), editor); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index bd3a121fd9..47088aae06 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -1485,10 +1485,10 @@ contact_list_editor_constructed (GObject *object) e_name_selector_peek_model (editor->priv->name_selector), "Members", _("_Members"), NULL); - g_signal_connect ( + e_signal_connect_notify ( editor, "notify::book", G_CALLBACK (contact_list_editor_notify_cb), NULL); - g_signal_connect ( + e_signal_connect_notify ( editor, "notify::editable", G_CALLBACK (contact_list_editor_notify_cb), NULL); diff --git a/addressbook/gui/widgets/e-contact-map-window.c b/addressbook/gui/widgets/e-contact-map-window.c index 736bad808f..b2d13c34f0 100644 --- a/addressbook/gui/widgets/e-contact-map-window.c +++ b/addressbook/gui/widgets/e-contact-map-window.c @@ -381,7 +381,7 @@ e_contact_map_window_init (EContactMapWindow *window) view = e_contact_map_get_view (E_CONTACT_MAP (map)); champlain_view_set_zoom_level (view, 2); priv->map = E_CONTACT_MAP (map); - g_signal_connect ( + e_signal_connect_notify ( view, "notify::zoom-level", G_CALLBACK (contact_map_window_zoom_level_changed_cb), window); g_signal_connect ( diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index f8de8a1003..cd1e41cc5b 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -513,7 +513,7 @@ eab_contact_display_init (EABContactDisplay *display) web_view, "create-plugin-widget", G_CALLBACK (contact_display_object_requested), display); #endif - g_signal_connect ( + e_signal_connect_notify ( web_view, "notify::load-status", G_CALLBACK (contact_display_load_status_changed), NULL); g_signal_connect ( |
