From 2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 4 Jun 2014 19:46:25 +0200 Subject: 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. --- addressbook/gui/contact-editor/e-contact-editor.c | 6 +- .../contact-list-editor/e-contact-list-editor.c | 4 +- addressbook/gui/widgets/e-contact-map-window.c | 2 +- addressbook/gui/widgets/eab-contact-display.c | 2 +- calendar/gui/dialogs/recurrence-page.c | 4 +- calendar/gui/dialogs/schedule-page.c | 2 +- calendar/gui/e-cal-list-view.c | 2 +- calendar/gui/e-day-view.c | 24 +-- calendar/gui/e-meeting-time-sel.c | 2 +- calendar/gui/e-task-table.c | 8 +- calendar/gui/e-week-view.c | 2 +- calendar/gui/gnome-cal.c | 16 +- composer/e-composer-name-header.c | 2 +- composer/e-composer-private.c | 2 +- composer/e-msg-composer.c | 16 +- e-util/e-action-combo-box.c | 5 +- e-util/e-activity-bar.c | 3 +- e-util/e-activity-proxy.c | 3 +- e-util/e-attachment-bar.c | 5 +- e-util/e-attachment-button.c | 3 +- e-util/e-attachment-paned.c | 7 +- e-util/e-attachment.c | 25 +-- e-util/e-buffer-tagger.c | 2 +- e-util/e-category-completion.c | 6 +- e-util/e-charset-combo-box.c | 2 +- e-util/e-filter-rule.c | 5 +- e-util/e-interval-chooser.c | 5 +- e-util/e-menu-tool-button.c | 3 +- e-util/e-misc-utils.c | 236 +++++++++++++++++++++ e-util/e-misc-utils.h | 18 ++ e-util/e-online-button.c | 6 +- e-util/e-paned.c | 9 +- e-util/e-picture-gallery.c | 3 +- e-util/e-search-bar.c | 3 +- e-util/e-source-config-dialog.c | 3 +- e-util/e-spell-entry.c | 3 +- e-util/e-table-click-to-add.c | 4 +- e-util/e-table-group-leaf.c | 2 +- e-util/e-table.c | 6 +- e-util/e-tree-view-frame.c | 12 +- e-util/e-tree.c | 6 +- e-util/e-web-view-gtkhtml.c | 39 ++++ e-util/e-web-view.c | 2 +- libemail-engine/e-mail-session.c | 4 +- mail/e-mail-config-assistant.c | 4 +- mail/e-mail-display.c | 81 ++++--- mail/e-mail-paned-view.c | 2 +- mail/e-mail-reader.c | 2 +- mail/em-filter-rule.c | 2 +- mail/em-subscription-editor.c | 2 +- modules/addressbook/e-book-shell-view-private.c | 4 +- modules/calendar/e-cal-shell-content.c | 8 +- modules/calendar/e-cal-shell-view-private.c | 2 +- modules/calendar/e-memo-shell-content.c | 2 +- modules/calendar/e-memo-shell-view-private.c | 2 +- modules/calendar/e-task-shell-content.c | 2 +- modules/calendar/e-task-shell-view-private.c | 2 +- modules/composer-autosave/e-composer-autosave.c | 2 +- modules/mail/e-mail-shell-view-private.c | 2 +- modules/offline-alert/evolution-offline-alert.c | 4 +- .../e-mail-config-import-progress-page.c | 2 +- plugins/mail-to-task/mail-to-task.c | 2 +- plugins/publish-calendar/publish-calendar.c | 2 +- shell/e-shell-switcher.c | 4 +- shell/e-shell-window-private.c | 8 +- shell/e-shell-window.c | 14 +- shell/e-shell.c | 2 +- smime/gui/certificate-manager.c | 2 +- 68 files changed, 513 insertions(+), 170 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 ( diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 35fafe4d54..bce7414efa 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -284,7 +284,7 @@ recurrence_page_constructor (GType type, /* Keep the calendar updated as the user twizzles widgets. */ editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (object)); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( editor, "notify::changed", G_CALLBACK (preview_recur), object); @@ -2619,7 +2619,7 @@ recurrence_page_construct (RecurrencePage *rpage, init_widgets (rpage); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( editor, "notify::client", G_CALLBACK (sensitize_buttons), rpage); diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 6ed59b16c4..054fe133f7 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -429,7 +429,7 @@ schedule_page_construct (SchedulePage *spage, return NULL; } - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( editor, "notify::client", G_CALLBACK (sensitize_widgets), spage); diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index c4b982984d..7a0983b422 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -324,7 +324,7 @@ setup_e_table (ECalListView *cal_list_view) cal_list_view->table, "cursor_change", G_CALLBACK (e_cal_list_view_cursor_change_cb), cal_list_view); - g_signal_connect_after ( + e_signal_connect_notify_after ( cal_list_view->table, "notify::is-editing", G_CALLBACK (e_cal_list_view_table_editing_changed_cb), cal_list_view); diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 658f6d60b7..45bb8197e3 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1185,62 +1185,62 @@ day_view_constructed (GObject *object) * disconnect signal handlers in dispose(). */ day_view->priv->model = g_object_ref (model); - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( model, "notify::work-day-monday", G_CALLBACK (day_view_notify_work_day_cb), day_view); day_view->priv->notify_work_day_monday_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( model, "notify::work-day-tuesday", G_CALLBACK (day_view_notify_work_day_cb), day_view); day_view->priv->notify_work_day_tuesday_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( model, "notify::work-day-wednesday", G_CALLBACK (day_view_notify_work_day_cb), day_view); day_view->priv->notify_work_day_wednesday_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( model, "notify::work-day-thursday", G_CALLBACK (day_view_notify_work_day_cb), day_view); day_view->priv->notify_work_day_thursday_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( model, "notify::work-day-friday", G_CALLBACK (day_view_notify_work_day_cb), day_view); day_view->priv->notify_work_day_friday_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( model, "notify::work-day-saturday", G_CALLBACK (day_view_notify_work_day_cb), day_view); day_view->priv->notify_work_day_saturday_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( model, "notify::work-day-sunday", G_CALLBACK (day_view_notify_work_day_cb), day_view); day_view->priv->notify_work_day_sunday_handler_id = handler_id; - handler_id = g_signal_connect_swapped ( + handler_id = e_signal_connect_notify_swapped ( model, "notify::week-start-day", G_CALLBACK (day_view_notify_week_start_day_cb), day_view); day_view->priv->notify_week_start_day_handler_id = handler_id; - handler_id = g_signal_connect_swapped ( + handler_id = e_signal_connect_notify_swapped ( model, "notify::work-day-start-hour", G_CALLBACK (gtk_widget_queue_draw), day_view->main_canvas); day_view->priv->notify_work_day_start_hour_handler_id = handler_id; - handler_id = g_signal_connect_swapped ( + handler_id = e_signal_connect_notify_swapped ( model, "notify::work-day-start-minute", G_CALLBACK (gtk_widget_queue_draw), day_view->main_canvas); day_view->priv->notify_work_day_start_minute_handler_id = handler_id; - handler_id = g_signal_connect_swapped ( + handler_id = e_signal_connect_notify_swapped ( model, "notify::work-day-end-hour", G_CALLBACK (gtk_widget_queue_draw), day_view->main_canvas); day_view->priv->notify_work_day_end_hour_handler_id = handler_id; - handler_id = g_signal_connect_swapped ( + handler_id = e_signal_connect_notify_swapped ( model, "notify::work-day-end-minute", G_CALLBACK (gtk_widget_queue_draw), day_view->main_canvas); day_view->priv->notify_work_day_end_minute_handler_id = handler_id; diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index a7474681f8..9bea92f2dc 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -396,7 +396,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, if (mts->model) g_object_ref (mts->model); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( mts->model, "notify::free-busy-template", G_CALLBACK (free_busy_template_changed_cb), mts); diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index ee2b614630..10184ef725 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -315,22 +315,22 @@ task_table_set_model (ETaskTable *task_table, task_table); /* redraw on drawing options change */ - g_signal_connect ( + e_signal_connect_notify ( model, "notify::highlight-due-today", G_CALLBACK (task_table_queue_draw_cb), task_table); - g_signal_connect ( + e_signal_connect_notify ( model, "notify::color-due-today", G_CALLBACK (task_table_queue_draw_cb), task_table); - g_signal_connect ( + e_signal_connect_notify ( model, "notify::highlight-overdue", G_CALLBACK (task_table_queue_draw_cb), task_table); - g_signal_connect ( + e_signal_connect_notify ( model, "notify::color-overdue", G_CALLBACK (task_table_queue_draw_cb), task_table); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 7cfe7aea87..21ec0229f4 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -772,7 +772,7 @@ week_view_constructed (GObject *object) e_week_view_recalc_display_start_day (E_WEEK_VIEW (object)); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( model, "notify::week-start-day", G_CALLBACK (week_view_notify_week_start_day_cb), object); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 8b03105651..58877dc87d 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -519,31 +519,31 @@ gnome_calendar_constructed (GObject *object) gcal->priv->views[GNOME_CAL_WORK_WEEK_VIEW] = calendar_view; g_object_ref_sink (calendar_view); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( calendar_view, "notify::working-day-monday", G_CALLBACK (gnome_calendar_update_time_range), gcal); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( calendar_view, "notify::working-day-tuesday", G_CALLBACK (gnome_calendar_update_time_range), gcal); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( calendar_view, "notify::working-day-wednesday", G_CALLBACK (gnome_calendar_update_time_range), gcal); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( calendar_view, "notify::working-day-thursday", G_CALLBACK (gnome_calendar_update_time_range), gcal); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( calendar_view, "notify::working-day-friday", G_CALLBACK (gnome_calendar_update_time_range), gcal); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( calendar_view, "notify::working-day-saturday", G_CALLBACK (gnome_calendar_update_time_range), gcal); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( calendar_view, "notify::working-day-sunday", G_CALLBACK (gnome_calendar_update_time_range), gcal); @@ -591,7 +591,7 @@ gnome_calendar_constructed (GObject *object) calendar_view, "selection-changed", G_CALLBACK (view_selection_changed_cb), gcal); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( model, "notify::week-start-day", G_CALLBACK (gnome_calendar_notify_week_start_day_cb), gcal); diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index 9fc3071319..4529fae2c1 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -221,7 +221,7 @@ composer_name_header_constructed (GObject *object) NULL); E_COMPOSER_HEADER (object)->input_widget = g_object_ref_sink (entry); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( object, "notify::visible", G_CALLBACK (composer_name_header_visible_changed_cb), object); diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index 786faba8fc..59e1625639 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -310,7 +310,7 @@ e_composer_private_constructed (EMsgComposer *composer) priv->gallery_icon_view = g_object_ref_sink (widget); g_free (gallery_path); - g_signal_connect ( + e_signal_connect_notify ( composer, "notify::html-mode", G_CALLBACK (composer_update_gallery_visibility), NULL); diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 1f9f7e0f06..57b716c1ad 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2039,28 +2039,28 @@ msg_composer_constructed (GObject *object) /* Configure Headers */ - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::destinations-bcc", G_CALLBACK (msg_composer_notify_header_cb), composer); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::destinations-cc", G_CALLBACK (msg_composer_notify_header_cb), composer); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::destinations-to", G_CALLBACK (msg_composer_notify_header_cb), composer); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::identity-uid", G_CALLBACK (msg_composer_mail_identity_changed_cb), composer); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::reply-to", G_CALLBACK (msg_composer_notify_header_cb), composer); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::signature-uid", G_CALLBACK (e_composer_update_signature), composer); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::subject", G_CALLBACK (msg_composer_subject_changed_cb), composer); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( table, "notify::subject", G_CALLBACK (msg_composer_notify_header_cb), composer); diff --git a/e-util/e-action-combo-box.c b/e-util/e-action-combo-box.c index 14731a7983..1b784b8ee8 100644 --- a/e-util/e-action-combo-box.c +++ b/e-util/e-action-combo-box.c @@ -21,6 +21,7 @@ #endif #include "e-action-combo-box.h" +#include "e-misc-utils.h" #include @@ -513,13 +514,13 @@ e_action_combo_box_set_action (EActionComboBox *combo_box, if (combo_box->priv->action_group != NULL) { combo_box->priv->group_sensitive_handler_id = - g_signal_connect ( + e_signal_connect_notify ( combo_box->priv->action_group, "notify::sensitive", G_CALLBACK ( action_combo_box_action_group_notify_cb), combo_box); combo_box->priv->group_visible_handler_id = - g_signal_connect ( + e_signal_connect_notify ( combo_box->priv->action_group, "notify::visible", G_CALLBACK ( action_combo_box_action_group_notify_cb), diff --git a/e-util/e-activity-bar.c b/e-util/e-activity-bar.c index 0edf019878..f90e51df94 100644 --- a/e-util/e-activity-bar.c +++ b/e-util/e-activity-bar.c @@ -16,6 +16,7 @@ */ #include "e-activity-bar.h" +#include "e-misc-utils.h" #include @@ -388,7 +389,7 @@ e_activity_bar_set_activity (EActivityBar *bar, G_OBJECT (activity), (GWeakNotify) activity_bar_weak_notify_cb, bar); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( activity, "notify::state", G_CALLBACK (activity_bar_feedback), bar); diff --git a/e-util/e-activity-proxy.c b/e-util/e-activity-proxy.c index bf8ab6778b..bb21a5bc8a 100644 --- a/e-util/e-activity-proxy.c +++ b/e-util/e-activity-proxy.c @@ -19,6 +19,7 @@ */ #include "e-activity-proxy.h" +#include "e-misc-utils.h" #include #include @@ -361,7 +362,7 @@ e_activity_proxy_set_activity (EActivityProxy *proxy, G_OBJECT (activity), (GWeakNotify) activity_proxy_weak_notify_cb, proxy); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( activity, "notify::state", G_CALLBACK (activity_proxy_feedback), proxy); diff --git a/e-util/e-attachment-bar.c b/e-util/e-attachment-bar.c index 3a14ba76b8..83c3c69430 100644 --- a/e-util/e-attachment-bar.c +++ b/e-util/e-attachment-bar.c @@ -29,6 +29,7 @@ #include "e-attachment-store.h" #include "e-attachment-icon-view.h" #include "e-attachment-tree-view.h" +#include "e-misc-utils.h" #define E_ATTACHMENT_BAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -132,12 +133,12 @@ attachment_bar_set_store (EAttachmentBar *bar, GTK_TREE_VIEW (bar->priv->tree_view), bar->priv->model); - g_signal_connect_object ( + e_signal_connect_notify_object ( bar->priv->model, "notify::num-attachments", G_CALLBACK (attachment_bar_update_status), bar, G_CONNECT_SWAPPED); - g_signal_connect_object ( + e_signal_connect_notify_object ( bar->priv->model, "notify::total-size", G_CALLBACK (attachment_bar_update_status), bar, G_CONNECT_SWAPPED); diff --git a/e-util/e-attachment-button.c b/e-util/e-attachment-button.c index 5d38a213d8..016e293f72 100644 --- a/e-util/e-attachment-button.c +++ b/e-util/e-attachment-button.c @@ -25,6 +25,7 @@ #endif #include "e-attachment-button.h" +#include "e-misc-utils.h" #define E_ATTACHMENT_BUTTON_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -776,7 +777,7 @@ e_attachment_button_set_attachment (EAttachmentButton *button, G_BINDING_SYNC_CREATE); button->priv->shown_binding = binding; - handler_id = g_signal_connect_swapped ( + handler_id = e_signal_connect_notify_swapped ( attachment, "notify::reference", G_CALLBACK (attachment_button_update_cell_view), button); diff --git a/e-util/e-attachment-paned.c b/e-util/e-attachment-paned.c index 98772db873..34f0a2e5b9 100644 --- a/e-util/e-attachment-paned.c +++ b/e-util/e-attachment-paned.c @@ -26,6 +26,7 @@ #include +#include "e-misc-utils.h" #include "e-attachment-view.h" #include "e-attachment-store.h" #include "e-attachment-icon-view.h" @@ -744,15 +745,15 @@ e_attachment_paned_init (EAttachmentPaned *paned) paned->priv->status_label = g_object_ref (widget); gtk_widget_hide (widget); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( paned->priv->expander, "notify::expanded", G_CALLBACK (attachment_paned_notify_cb), paned); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( paned->priv->model, "notify::num-attachments", G_CALLBACK (attachment_paned_update_status), paned); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( paned->priv->model, "notify::total-size", G_CALLBACK (attachment_paned_update_status), paned); diff --git a/e-util/e-attachment.c b/e-util/e-attachment.c index 06018e8130..1ce400767d 100644 --- a/e-util/e-attachment.c +++ b/e-util/e-attachment.c @@ -33,6 +33,7 @@ #include "e-attachment-store.h" #include "e-icon-factory.h" #include "e-mktemp.h" +#include "e-misc-utils.h" #define E_ATTACHMENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -997,51 +998,51 @@ e_attachment_init (EAttachment *attachment) g_mutex_init (&attachment->priv->property_lock); g_mutex_init (&attachment->priv->idle_lock); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::encrypted", G_CALLBACK (attachment_update_icon_column), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::file-info", G_CALLBACK (attachment_update_file_info_columns), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::file-info", G_CALLBACK (attachment_update_icon_column), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::loading", G_CALLBACK (attachment_update_icon_column), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::loading", G_CALLBACK (attachment_update_progress_columns), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::percent", G_CALLBACK (attachment_update_progress_columns), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::reference", G_CALLBACK (attachment_update_file_info_columns), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::reference", G_CALLBACK (attachment_update_icon_column), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::reference", G_CALLBACK (attachment_update_progress_columns), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::saving", G_CALLBACK (attachment_update_icon_column), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::saving", G_CALLBACK (attachment_update_progress_columns), NULL); - g_signal_connect ( + e_signal_connect_notify ( attachment, "notify::signed", G_CALLBACK (attachment_update_icon_column), NULL); diff --git a/e-util/e-buffer-tagger.c b/e-util/e-buffer-tagger.c index c3c923aa7b..ccd23dc158 100644 --- a/e-util/e-buffer-tagger.c +++ b/e-util/e-buffer-tagger.c @@ -609,7 +609,7 @@ e_buffer_tagger_connect (GtkTextView *textview) g_signal_connect ( buffer, "delete-range", G_CALLBACK (buffer_delete_range), NULL); - g_signal_connect ( + e_signal_connect_notify ( buffer, "notify::cursor-position", G_CALLBACK (buffer_cursor_position), NULL); diff --git a/e-util/e-category-completion.c b/e-util/e-category-completion.c index cc8ed8936e..39e26e2edf 100644 --- a/e-util/e-category-completion.c +++ b/e-util/e-category-completion.c @@ -25,6 +25,8 @@ #include +#include "e-misc-utils.h" + #define E_CATEGORY_COMPLETION_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_CATEGORY_COMPLETION, ECategoryCompletionPrivate)) @@ -356,11 +358,11 @@ category_completion_track_entry (GtkEntryCompletion *completion) g_object_ref (priv->last_known_entry); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( priv->last_known_entry, "notify::cursor-position", G_CALLBACK (category_completion_update_prefix), completion); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( priv->last_known_entry, "notify::text", G_CALLBACK (category_completion_update_prefix), completion); diff --git a/e-util/e-charset-combo-box.c b/e-util/e-charset-combo-box.c index 240c28582f..2d67ceb749 100644 --- a/e-util/e-charset-combo-box.c +++ b/e-util/e-charset-combo-box.c @@ -276,7 +276,7 @@ charset_combo_box_constructed (GObject *object) e_action_combo_box_add_separator_after ( E_ACTION_COMBO_BOX (object), g_slist_length (group)); - g_signal_connect ( + e_signal_connect_notify ( object, "notify::charset", G_CALLBACK (charset_combo_box_notify_charset_cb), NULL); } diff --git a/e-util/e-filter-rule.c b/e-util/e-filter-rule.c index 721ed748a7..3211e166fe 100644 --- a/e-util/e-filter-rule.c +++ b/e-util/e-filter-rule.c @@ -33,6 +33,7 @@ #include "e-dialog-widgets.h" #include "e-filter-rule.h" #include "e-rule-context.h" +#include "e-misc-utils.h" #define E_FILTER_RULE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -903,10 +904,10 @@ filter_rule_get_widget (EFilterRule *rule, vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)); scrolledwindow = gtk_scrolled_window_new (hadj, vadj); - g_signal_connect ( + e_signal_connect_notify ( hadj, "notify::upper", G_CALLBACK (ensure_scrolled_width_cb), scrolledwindow); - g_signal_connect ( + e_signal_connect_notify ( vadj, "notify::upper", G_CALLBACK (ensure_scrolled_height_cb), scrolledwindow); diff --git a/e-util/e-interval-chooser.c b/e-util/e-interval-chooser.c index 5e27471942..df6805cd3d 100644 --- a/e-util/e-interval-chooser.c +++ b/e-util/e-interval-chooser.c @@ -21,6 +21,7 @@ #include #include "e-util-enums.h" +#include "e-misc-utils.h" #define E_INTERVAL_CHOOSER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -129,7 +130,7 @@ e_interval_chooser_init (EIntervalChooser *chooser) chooser->priv->spin_button = GTK_SPIN_BUTTON (widget); gtk_widget_show (widget); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( widget, "notify::value", G_CALLBACK (interval_chooser_notify_interval), chooser); @@ -144,7 +145,7 @@ e_interval_chooser_init (EIntervalChooser *chooser) chooser->priv->combo_box = GTK_COMBO_BOX (widget); gtk_widget_show (widget); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( widget, "notify::active", G_CALLBACK (interval_chooser_notify_interval), chooser); } diff --git a/e-util/e-menu-tool-button.c b/e-util/e-menu-tool-button.c index d181d5ee36..cffadd0f08 100644 --- a/e-util/e-menu-tool-button.c +++ b/e-util/e-menu-tool-button.c @@ -23,6 +23,7 @@ #endif #include "e-menu-tool-button.h" +#include "e-misc-utils.h" #define E_MENU_TOOL_BUTTON_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -241,7 +242,7 @@ e_menu_tool_button_init (EMenuToolButton *button) button->priv->prefer_item = NULL; - g_signal_connect ( + e_signal_connect_notify ( button, "notify::menu", G_CALLBACK (menu_tool_button_update_button), NULL); } diff --git a/e-util/e-misc-utils.c b/e-util/e-misc-utils.c index 3a52292af4..f7be7af5ac 100644 --- a/e-util/e-misc-utils.c +++ b/e-util/e-misc-utils.c @@ -2256,3 +2256,239 @@ e_binding_bind_object_text_property (gpointer source, e_binding_transform_text_non_null, NULL, NULL); } + +typedef struct _EConnectNotifyData { + GConnectFlags flags; + GValue *old_value; + + GCallback c_handler; + gpointer user_data; +} EConnectNotifyData; + +static EConnectNotifyData * +e_connect_notify_data_new (GCallback c_handler, + gpointer user_data, + guint32 connect_flags) +{ + EConnectNotifyData *connect_data; + + connect_data = g_new0 (EConnectNotifyData, 1); + connect_data->flags = connect_flags; + connect_data->c_handler = c_handler; + connect_data->user_data = user_data; + + return connect_data; +} + +static void +e_connect_notify_data_free (EConnectNotifyData *data) +{ + if (!data) + return; + + if (data->old_value) { + g_value_unset (data->old_value); + g_free (data->old_value); + } + g_free (data); +} + +static gboolean +e_value_equal (GValue *value1, + GValue *value2) +{ + if (value1 == value2) + return TRUE; + + if (!value1 || !value2) + return FALSE; + + #define testType(_uc,_lc) G_STMT_START { \ + if (G_VALUE_HOLDS_ ## _uc (value1)) \ + return g_value_get_ ## _lc (value1) == g_value_get_ ## _lc (value2); \ + } G_STMT_END + + testType (BOOLEAN, boolean); + testType (BOXED, boxed); + testType (CHAR, schar); + testType (DOUBLE, double); + testType (ENUM, enum); + testType (FLAGS, flags); + testType (FLOAT, float); + testType (GTYPE, gtype); + testType (INT, int); + testType (INT64, int64); + testType (LONG, long); + testType (OBJECT, object); + testType (POINTER, pointer); + testType (UCHAR, uchar); + testType (UINT, uint); + testType (UINT64, uint64); + testType (ULONG, ulong); + + #undef testType + + if (G_VALUE_HOLDS_PARAM (value1)) { + GParamSpec *param1, *param2; + + param1 = g_value_get_param (value1); + param2 = g_value_get_param (value2); + + return param1 && param2 && + g_strcmp0 (param1->name, param2->name) == 0 && + param1->flags == param2->flags && + param1->value_type == param2->value_type && + param1->owner_type == param2->owner_type; + } else if (G_VALUE_HOLDS_STRING (value1)) { + const gchar *string1, *string2; + + string1 = g_value_get_string (value1); + string2 = g_value_get_string (value2); + + return g_strcmp0 (string1, string2) == 0; + } else if (G_VALUE_HOLDS_VARIANT (value1)) { + GVariant *variant1, *variant2; + + variant1 = g_value_get_variant (value1); + variant2 = g_value_get_variant (value2); + + return variant1 == variant2 || + (variant1 && variant2 && g_variant_equal (variant1, variant2)); + } + + return FALSE; +} + +static void +e_signal_connect_notify_cb (gpointer instance, + GParamSpec *param, + gpointer user_data) +{ + EConnectNotifyData *connect_data = user_data; + GValue *value; + + g_return_if_fail (connect_data != NULL); + + value = g_new0 (GValue, 1); + g_value_init (value, param->value_type); + g_object_get_property (instance, param->name, value); + + if (!e_value_equal (connect_data->old_value, value)) { + typedef void (* NotifyCBType) (gpointer instance, GParamSpec *param, gpointer user_data); + NotifyCBType c_handler = (NotifyCBType) connect_data->c_handler; + + if (connect_data->old_value) { + g_value_unset (connect_data->old_value); + g_free (connect_data->old_value); + } + connect_data->old_value = value; + + if (connect_data->flags == G_CONNECT_SWAPPED) { + c_handler (connect_data->user_data, param, instance); + } else { + c_handler (instance, param, connect_data->user_data); + } + } else { + g_value_unset (value); + g_free (value); + } +} + +gulong +e_signal_connect_notify (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer user_data) +{ + EConnectNotifyData *connect_data; + + g_return_val_if_fail (g_str_has_prefix (notify_name, "notify::"), 0); + + connect_data = e_connect_notify_data_new (c_handler, user_data, 0); + + return g_signal_connect_data (instance, + notify_name, + G_CALLBACK (e_signal_connect_notify_cb), + connect_data, + (GClosureNotify) e_connect_notify_data_free, + 0); +} + +gulong +e_signal_connect_notify_after (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer user_data) +{ + EConnectNotifyData *connect_data; + + g_return_val_if_fail (g_str_has_prefix (notify_name, "notify::"), 0); + + connect_data = e_connect_notify_data_new (c_handler, user_data, G_CONNECT_AFTER); + + return g_signal_connect_data (instance, + notify_name, + G_CALLBACK (e_signal_connect_notify_cb), + connect_data, + (GClosureNotify) e_connect_notify_data_free, + G_CONNECT_AFTER); +} + +gulong +e_signal_connect_notify_swapped (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer user_data) +{ + EConnectNotifyData *connect_data; + + g_return_val_if_fail (g_str_has_prefix (notify_name, "notify::"), 0); + + connect_data = e_connect_notify_data_new (c_handler, user_data, G_CONNECT_SWAPPED); + + return g_signal_connect_data (instance, + notify_name, + G_CALLBACK (e_signal_connect_notify_cb), + connect_data, + (GClosureNotify) e_connect_notify_data_free, + 0); +} + +gulong +e_signal_connect_notify_object (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer gobject, + GConnectFlags connect_flags) +{ + EConnectNotifyData *connect_data; + GClosure *closure; + + g_return_val_if_fail (g_str_has_prefix (notify_name, "notify::"), 0); + + if (!gobject) { + if ((connect_flags & G_CONNECT_SWAPPED) != 0) + return e_signal_connect_notify_swapped (instance, notify_name, c_handler, gobject); + else if ((connect_flags & G_CONNECT_AFTER) != 0) + e_signal_connect_notify_after (instance, notify_name, c_handler, gobject); + else + g_warn_if_fail (connect_flags == 0); + + return e_signal_connect_notify (instance, notify_name, c_handler, gobject); + } + + g_return_val_if_fail (G_IS_OBJECT (gobject), 0); + + connect_data = e_connect_notify_data_new (c_handler, gobject, connect_flags & G_CONNECT_SWAPPED); + closure = g_cclosure_new ( + G_CALLBACK (e_signal_connect_notify_cb), + connect_data, + (GClosureNotify) e_connect_notify_data_free); + + g_object_watch_closure (G_OBJECT (gobject), closure); + + return g_signal_connect_closure (instance, + notify_name, + closure, + connect_flags & G_CONNECT_AFTER); +} diff --git a/e-util/e-misc-utils.h b/e-util/e-misc-utils.h index 33d8978a31..06de228899 100644 --- a/e-util/e-misc-utils.h +++ b/e-util/e-misc-utils.h @@ -211,6 +211,24 @@ GBinding * e_binding_bind_object_text_property const gchar *target_property, GBindingFlags flags); +gulong e_signal_connect_notify (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer user_data); +gulong e_signal_connect_notify_after (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer user_data); +gulong e_signal_connect_notify_swapped (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer user_data); +gulong e_signal_connect_notify_object (gpointer instance, + const gchar *notify_name, + GCallback c_handler, + gpointer gobject, + GConnectFlags connect_flags); + G_END_DECLS #endif /* E_MISC_UTILS_H */ diff --git a/e-util/e-online-button.c b/e-util/e-online-button.c index 0589c197f4..b2bd68792e 100644 --- a/e-util/e-online-button.c +++ b/e-util/e-online-button.c @@ -22,6 +22,8 @@ #include +#include "e-misc-utils.h" + #define E_ONLINE_BUTTON_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate)) @@ -154,11 +156,11 @@ e_online_button_init (EOnlineButton *button) button->priv->image = g_object_ref (widget); gtk_widget_show (widget); - g_signal_connect ( + e_signal_connect_notify ( button, "notify::online", G_CALLBACK (online_button_update_tooltip), NULL); - g_signal_connect ( + e_signal_connect_notify ( button, "notify::sensitive", G_CALLBACK (online_button_update_tooltip), NULL); } diff --git a/e-util/e-paned.c b/e-util/e-paned.c index f56a06796c..b4a0914163 100644 --- a/e-util/e-paned.c +++ b/e-util/e-paned.c @@ -26,6 +26,8 @@ #include +#include "e-misc-utils.h" + #define E_PANED_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_PANED, EPanedPrivate)) @@ -375,11 +377,11 @@ e_paned_init (EPaned *paned) paned->priv->proportion = 0.5; paned->priv->fixed_resize = TRUE; - g_signal_connect ( + e_signal_connect_notify ( paned, "notify::orientation", G_CALLBACK (paned_notify_orientation_cb), NULL); - g_signal_connect ( + e_signal_connect_notify ( paned, "notify::position", G_CALLBACK (paned_notify_position_cb), NULL); } @@ -471,6 +473,9 @@ e_paned_set_proportion (EPaned *paned, g_return_if_fail (E_IS_PANED (paned)); g_return_if_fail (CLAMP (proportion, 0.0, 1.0) == proportion); + if (paned->priv->proportion == proportion) + return; + paned->priv->proportion = proportion; paned->priv->sync_request = SYNC_REQUEST_PROPORTION; diff --git a/e-util/e-picture-gallery.c b/e-util/e-picture-gallery.c index 117602877b..71e48e01a0 100644 --- a/e-util/e-picture-gallery.c +++ b/e-util/e-picture-gallery.c @@ -25,6 +25,7 @@ #include "e-picture-gallery.h" #include "e-icon-factory.h" +#include "e-misc-utils.h" #define E_PICTURE_GALLERY_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -377,7 +378,7 @@ picture_gallery_constructed (GObject *object) gtk_target_table_free (targets, n_targets); gtk_target_list_unref (list); - g_signal_connect (object, "notify::visible", G_CALLBACK (visible_cb), NULL); + e_signal_connect_notify (object, "notify::visible", G_CALLBACK (visible_cb), NULL); } static void diff --git a/e-util/e-search-bar.c b/e-util/e-search-bar.c index 13b4ee6f87..d3ade3540d 100644 --- a/e-util/e-search-bar.c +++ b/e-util/e-search-bar.c @@ -28,6 +28,7 @@ #include #include "e-dialog-widgets.h" +#include "e-misc-utils.h" #define E_SEARCH_BAR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -235,7 +236,7 @@ search_bar_set_web_view (ESearchBar *search_bar, search_bar->priv->web_view = g_object_ref (web_view); - g_signal_connect ( + e_signal_connect_notify ( web_view, "notify::load-status", G_CALLBACK (web_view_load_status_changed_cb), search_bar); } diff --git a/e-util/e-source-config-dialog.c b/e-util/e-source-config-dialog.c index 507f8c459b..f5d1b72b16 100644 --- a/e-util/e-source-config-dialog.c +++ b/e-util/e-source-config-dialog.c @@ -26,6 +26,7 @@ #include "e-alert-bar.h" #include "e-alert-dialog.h" #include "e-alert-sink.h" +#include "e-misc-utils.h" #define E_SOURCE_CONFIG_DIALOG_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -275,7 +276,7 @@ source_config_dialog_constructed (GObject *object) priv->alert_bar = g_object_ref (widget); /* EAlertBar controls its own visibility. */ - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( priv->alert_bar, "notify::visible", G_CALLBACK (source_config_alert_bar_visible_cb), object); diff --git a/e-util/e-spell-entry.c b/e-util/e-spell-entry.c index cea403948b..75c7a6a9c8 100644 --- a/e-util/e-spell-entry.c +++ b/e-util/e-spell-entry.c @@ -26,6 +26,7 @@ #include #include +#include "e-misc-utils.h" #include "e-spell-entry.h" #define E_SPELL_ENTRY_GET_PRIVATE(obj) \ @@ -878,7 +879,7 @@ e_spell_entry_init (ESpellEntry *spell_entry) g_signal_connect ( spell_entry, "changed", G_CALLBACK (spell_entry_changed), NULL); - g_signal_connect ( + e_signal_connect_notify ( spell_entry, "notify::scroll-offset", G_CALLBACK (spell_entry_notify_scroll_offset), NULL); diff --git a/e-util/e-table-click-to-add.c b/e-util/e-table-click-to-add.c index b0af6eaac6..77422534c4 100644 --- a/e-util/e-table-click-to-add.c +++ b/e-util/e-table-click-to-add.c @@ -414,7 +414,7 @@ finish_editing (ETableClickToAdd *etcta) etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); - g_signal_connect ( + e_signal_connect_notify ( etcta->row, "notify::is-editing", G_CALLBACK (table_click_to_add_row_is_editing_changed_cb), etcta); @@ -472,7 +472,7 @@ etcta_event (GnomeCanvasItem *item, etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); - g_signal_connect ( + e_signal_connect_notify ( etcta->row, "notify::is-editing", G_CALLBACK (table_click_to_add_row_is_editing_changed_cb), etcta); diff --git a/e-util/e-table-group-leaf.c b/e-util/e-table-group-leaf.c index 4cb5f18374..88ea6b0e8d 100644 --- a/e-util/e-table-group-leaf.c +++ b/e-util/e-table-group-leaf.c @@ -368,7 +368,7 @@ etgl_realize (GnomeCanvasItem *item) etgl->item, "start_drag", G_CALLBACK (etgl_start_drag), etgl); - g_signal_connect ( + e_signal_connect_notify ( etgl->item, "notify::is-editing", G_CALLBACK (etgl_item_is_editing_changed_cb), etgl); diff --git a/e-util/e-table.c b/e-util/e-table.c index 0dd02a2422..096313549e 100644 --- a/e-util/e-table.c +++ b/e-util/e-table.c @@ -1147,7 +1147,7 @@ et_build_groups (ETable *et) g_signal_connect ( et->group, "start_drag", G_CALLBACK (group_start_drag), et); - g_signal_connect ( + e_signal_connect_notify ( et->group, "notify::is-editing", G_CALLBACK (group_is_editing_changed_cb), et); @@ -1529,7 +1529,7 @@ e_table_setup_table (ETable *e_table, g_signal_connect ( e_table->click_to_add, "cursor_change", G_CALLBACK (click_to_add_cursor_change), e_table); - g_signal_connect ( + e_signal_connect_notify ( e_table->click_to_add, "notify::is-editing", G_CALLBACK (click_to_add_is_editing_changed_cb), e_table); } @@ -2211,7 +2211,7 @@ et_set_property (GObject *object, etable->click_to_add, "cursor_change", G_CALLBACK (click_to_add_cursor_change), etable); - g_signal_connect ( + e_signal_connect_notify ( etable->click_to_add, "notify::is-editing", G_CALLBACK (click_to_add_is_editing_changed_cb), etable); } else { diff --git a/e-util/e-tree-view-frame.c b/e-util/e-tree-view-frame.c index d3f70c6283..bde8b9fafa 100644 --- a/e-util/e-tree-view-frame.c +++ b/e-util/e-tree-view-frame.c @@ -29,10 +29,16 @@ * extended through e_tree_view_frame_insert_toolbar_action(). **/ -#include "e-tree-view-frame.h" +#ifdef HAVE_CONFIG_H +#include +#endif #include +#include "e-misc-utils.h" + +#include "e-tree-view-frame.h" + #define E_TREE_VIEW_FRAME_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_TREE_VIEW_FRAME, ETreeViewFramePrivate)) @@ -937,13 +943,13 @@ e_tree_view_frame_set_tree_view (ETreeViewFrame *tree_view_frame, selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( tree_view, "notify::reorderable", G_CALLBACK (tree_view_frame_notify_reorderable_cb), tree_view_frame); tree_view_frame->priv->notify_reorderable_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( selection, "notify::mode", G_CALLBACK (tree_view_frame_notify_select_mode_cb), tree_view_frame); diff --git a/e-util/e-tree.c b/e-util/e-tree.c index d56456b4ad..30d20fc4c8 100644 --- a/e-util/e-tree.c +++ b/e-util/e-tree.c @@ -1165,7 +1165,7 @@ et_build_item (ETree *tree) g_signal_connect ( tree->priv->item, "start_drag", G_CALLBACK (item_start_drag), tree); - g_signal_connect ( + e_signal_connect_notify ( tree->priv->item, "notify::is-editing", G_CALLBACK (tree_item_is_editing_changed_cb), tree); } @@ -1283,7 +1283,7 @@ et_setup_table_canvas_vadjustment (ETree *tree) if (vadjustment) { tree->priv->table_canvas_vadjustment = g_object_ref (vadjustment); - g_signal_connect ( + e_signal_connect_notify ( vadjustment, "notify::value", G_CALLBACK (e_tree_table_canvas_scrolled_cb), tree); } @@ -1336,7 +1336,7 @@ e_tree_setup_table (ETree *tree) G_CALLBACK (tree_canvas_reflow), tree); et_setup_table_canvas_vadjustment (tree); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( tree->priv->table_canvas, "notify::vadjustment", G_CALLBACK (et_setup_table_canvas_vadjustment), tree); diff --git a/e-util/e-web-view-gtkhtml.c b/e-util/e-web-view-gtkhtml.c index 799240d45d..7963a1cbf9 100644 --- a/e-util/e-web-view-gtkhtml.c +++ b/e-util/e-web-view-gtkhtml.c @@ -1791,6 +1791,9 @@ e_web_view_gtkhtml_set_animate (EWebViewGtkHTML *web_view, g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (gtk_html_get_animate (GTK_HTML (web_view)) == animate) + return; + gtk_html_set_animate (GTK_HTML (web_view), animate); g_object_notify (G_OBJECT (web_view), "animate"); @@ -1817,6 +1820,9 @@ e_web_view_gtkhtml_set_caret_mode (EWebViewGtkHTML *web_view, g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (gtk_html_get_caret_mode (GTK_HTML (web_view)) == caret_mode) + return; + gtk_html_set_caret_mode (GTK_HTML (web_view), caret_mode); g_object_notify (G_OBJECT (web_view), "caret-mode"); @@ -1844,6 +1850,9 @@ e_web_view_gtkhtml_set_disable_printing (EWebViewGtkHTML *web_view, { g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (web_view->priv->disable_printing == disable_printing) + return; + web_view->priv->disable_printing = disable_printing; g_object_notify (G_OBJECT (web_view), "disable-printing"); @@ -1863,6 +1872,9 @@ e_web_view_gtkhtml_set_disable_save_to_disk (EWebViewGtkHTML *web_view, { g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (web_view->priv->disable_save_to_disk == disable_save_to_disk) + return; + web_view->priv->disable_save_to_disk = disable_save_to_disk; g_object_notify (G_OBJECT (web_view), "disable-save-to-disk"); @@ -1889,6 +1901,9 @@ e_web_view_gtkhtml_set_editable (EWebViewGtkHTML *web_view, g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (gtk_html_get_editable (GTK_HTML (web_view)) == editable) + return; + gtk_html_set_editable (GTK_HTML (web_view), editable); g_object_notify (G_OBJECT (web_view), "editable"); @@ -1915,6 +1930,9 @@ e_web_view_gtkhtml_set_inline_spelling (EWebViewGtkHTML *web_view, g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (gtk_html_get_inline_spelling (GTK_HTML (web_view)) == inline_spelling) + return; + gtk_html_set_inline_spelling (GTK_HTML (web_view), inline_spelling); g_object_notify (G_OBJECT (web_view), "inline-spelling"); @@ -1941,6 +1959,9 @@ e_web_view_gtkhtml_set_magic_links (EWebViewGtkHTML *web_view, g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (gtk_html_get_magic_links (GTK_HTML (web_view)) == magic_links) + return; + gtk_html_set_magic_links (GTK_HTML (web_view), magic_links); g_object_notify (G_OBJECT (web_view), "magic-links"); @@ -1967,6 +1988,9 @@ e_web_view_gtkhtml_set_magic_smileys (EWebViewGtkHTML *web_view, g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (gtk_html_get_magic_smileys (GTK_HTML (web_view)) == magic_smileys) + return; + gtk_html_set_magic_smileys (GTK_HTML (web_view), magic_smileys); g_object_notify (G_OBJECT (web_view), "magic-smileys"); @@ -1986,6 +2010,9 @@ e_web_view_gtkhtml_set_selected_uri (EWebViewGtkHTML *web_view, { g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (g_strcmp0 (web_view->priv->selected_uri, selected_uri) == 0) + return; + g_free (web_view->priv->selected_uri); web_view->priv->selected_uri = g_strdup (selected_uri); @@ -2006,6 +2033,9 @@ e_web_view_gtkhtml_set_cursor_image (EWebViewGtkHTML *web_view, { g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (web_view->priv->cursor_image == image) + return; + if (image != NULL) g_object_ref (image); @@ -2031,6 +2061,9 @@ e_web_view_gtkhtml_set_open_proxy (EWebViewGtkHTML *web_view, { g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (web_view->priv->open_proxy == open_proxy) + return; + if (open_proxy != NULL) { g_return_if_fail (GTK_IS_ACTION (open_proxy)); g_object_ref (open_proxy); @@ -2066,6 +2099,9 @@ e_web_view_gtkhtml_set_print_proxy (EWebViewGtkHTML *web_view, { g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (web_view->priv->print_proxy == print_proxy) + return; + if (print_proxy != NULL) { g_return_if_fail (GTK_IS_ACTION (print_proxy)); g_object_ref (print_proxy); @@ -2093,6 +2129,9 @@ e_web_view_gtkhtml_set_save_as_proxy (EWebViewGtkHTML *web_view, { g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (web_view)); + if (web_view->priv->save_as_proxy == save_as_proxy) + return; + if (save_as_proxy != NULL) { g_return_if_fail (GTK_IS_ACTION (save_as_proxy)); g_object_ref (save_as_proxy); diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c index bb02bd16f1..398540128d 100644 --- a/e-util/e-web-view.c +++ b/e-util/e-web-view.c @@ -1699,7 +1699,7 @@ e_web_view_init (EWebView *web_view) web_view, "document-load-finished", G_CALLBACK (style_updated_cb), NULL); - g_signal_connect ( + e_signal_connect_notify ( web_view, "notify::load-status", G_CALLBACK (web_view_load_status_changed_cb), NULL); diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c index 42605ea579..5578a786c4 100644 --- a/libemail-engine/e-mail-session.c +++ b/libemail-engine/e-mail-session.c @@ -816,7 +816,7 @@ mail_session_idle_refresh_cb (EMailSession *session) /* Listen for network state changes and force a * mail store refresh when coming back online. */ - g_signal_connect ( + e_signal_connect_notify ( session, "notify::online", G_CALLBACK (mail_session_force_refresh), NULL); @@ -1045,7 +1045,7 @@ mail_session_constructed (GObject *object) G_CALLBACK (mail_session_source_disabled_cb), session); session->priv->source_disabled_handler_id = handler_id; - handler_id = g_signal_connect ( + handler_id = e_signal_connect_notify ( registry, "notify::default-mail-account", G_CALLBACK (mail_session_default_mail_account_cb), session); session->priv->default_mail_account_handler_id = handler_id; diff --git a/mail/e-mail-config-assistant.c b/mail/e-mail-config-assistant.c index 5688494161..e1a4add3ed 100644 --- a/mail/e-mail-config-assistant.c +++ b/mail/e-mail-config-assistant.c @@ -733,7 +733,7 @@ mail_config_assistant_constructed (GObject *object) page, "email-address", G_BINDING_SYNC_CREATE); - g_signal_connect ( + e_signal_connect_notify ( page, "notify::active-backend", G_CALLBACK (mail_config_assistant_notify_account_backend), assistant); @@ -816,7 +816,7 @@ mail_config_assistant_constructed (GObject *object) page, "email-address", G_BINDING_SYNC_CREATE); - g_signal_connect ( + e_signal_connect_notify ( page, "notify::active-backend", G_CALLBACK (mail_config_assistant_notify_transport_backend), assistant); diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 837c9b3892..fe91faab9a 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -606,18 +606,18 @@ mail_display_plugin_widget_requested (WebKitWebView *web_view, /* When EAttachmentBar is expanded/collapsed it does not * emit size-allocate signal despite it changes it's height. */ - g_signal_connect ( + e_signal_connect_notify ( widget, "notify::expanded", G_CALLBACK (mail_display_plugin_widget_resize), display); - g_signal_connect ( + e_signal_connect_notify ( widget, "notify::active-view", G_CALLBACK (mail_display_plugin_widget_resize), display); /* Always hide an attachment bar without attachments */ store = e_attachment_bar_get_store (E_ATTACHMENT_BAR (widget)); - g_signal_connect ( + e_signal_connect_notify ( store, "notify::num-attachments", G_CALLBACK (mail_display_attachment_count_changed), box); @@ -668,11 +668,11 @@ mail_display_plugin_widget_requested (WebKitWebView *web_view, /* Show/hide the attachment when the EAttachmentButton * is expanded/collapsed or shown/hidden. */ - g_signal_connect ( + e_signal_connect_notify ( widget, "notify::expanded", G_CALLBACK (attachment_button_expanded), display); - g_signal_connect ( + e_signal_connect_notify ( widget, "notify::visible", G_CALLBACK (attachment_button_expanded), display); @@ -994,7 +994,7 @@ mail_display_frame_created (WebKitWebView *web_view, d (printf ("Frame %s created!\n", webkit_web_frame_get_name (frame))); /* Call bind_func of all parts written in this frame */ - g_signal_connect ( + e_signal_connect_notify ( frame, "notify::load-status", G_CALLBACK (mail_parts_bind_dom), NULL); } @@ -1523,7 +1523,7 @@ e_mail_display_init (EMailDisplay *display) g_signal_connect ( display, "frame-created", G_CALLBACK (mail_display_frame_created), NULL); - g_signal_connect ( + e_signal_connect_notify ( display, "notify::uri", G_CALLBACK (mail_display_uri_changed), NULL); g_signal_connect ( @@ -1547,7 +1547,7 @@ e_mail_display_init (EMailDisplay *display) e_web_view_update_fonts (E_WEB_VIEW (display)); main_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (display)); - g_signal_connect ( + e_signal_connect_notify ( main_frame, "notify::load-status", G_CALLBACK (mail_parts_bind_dom), NULL); @@ -1641,33 +1641,52 @@ e_mail_display_set_mode (EMailDisplay *display, display->priv->formatter = formatter; mail_display_update_formatter_colors (display); - g_signal_connect ( + e_signal_connect_notify ( formatter, "notify::image-loading-policy", G_CALLBACK (formatter_image_loading_policy_changed_cb), display); - g_object_connect ( - formatter, - "swapped-object-signal::notify::charset", - G_CALLBACK (e_mail_display_reload), display, - "swapped-object-signal::notify::image-loading-policy", - G_CALLBACK (e_mail_display_reload), display, - "swapped-object-signal::notify::mark-citations", - G_CALLBACK (e_mail_display_reload), display, - "swapped-object-signal::notify::show-sender-photo", - G_CALLBACK (e_mail_display_reload), display, - "swapped-object-signal::notify::show-real-date", - G_CALLBACK (e_mail_display_reload), display, - "swapped-object-signal::notify::animate-images", - G_CALLBACK (e_mail_display_reload), display, - "swapped-object-signal::notify::body-color", - G_CALLBACK (e_mail_display_update_colors), display, - "swapped-object-signal::notify::citation-color", - G_CALLBACK (e_mail_display_update_colors), display, - "swapped-object-signal::notify::frame-color", - G_CALLBACK (e_mail_display_update_colors), display, - "swapped-object-signal::notify::header-color", - G_CALLBACK (e_mail_display_update_colors), display, + e_signal_connect_notify_object ( + formatter, "notify::charset", + G_CALLBACK (e_mail_display_reload), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::image-loading-policy", + G_CALLBACK (e_mail_display_reload), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::mark-citations", + G_CALLBACK (e_mail_display_reload), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::show-sender-photo", + G_CALLBACK (e_mail_display_reload), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::show-real-date", + G_CALLBACK (e_mail_display_reload), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::animate-images", + G_CALLBACK (e_mail_display_reload), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::body-color", + G_CALLBACK (e_mail_display_update_colors), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::citation-color", + G_CALLBACK (e_mail_display_update_colors), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::frame-color", + G_CALLBACK (e_mail_display_update_colors), display, G_CONNECT_SWAPPED); + + e_signal_connect_notify_object ( + formatter, "notify::header-color", + G_CALLBACK (e_mail_display_update_colors), display, G_CONNECT_SWAPPED); + + g_object_connect (formatter, "swapped-object-signal::need-redraw", G_CALLBACK (e_mail_display_reload), display, NULL); diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 4c4c6b62eb..5d7cb9d67d 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -1059,7 +1059,7 @@ e_mail_paned_view_init (EMailPanedView *view) { view->priv = E_MAIL_PANED_VIEW_GET_PRIVATE (view); - g_signal_connect ( + e_signal_connect_notify ( view, "notify::group-by-threads", G_CALLBACK (mail_paned_view_notify_group_by_threads_cb), NULL); diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 5e2f951feb..cbc595a042 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -3972,7 +3972,7 @@ connect_signals: display, "key-press-event", G_CALLBACK (mail_reader_key_press_event_cb), reader); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( display, "notify::load-status", G_CALLBACK (mail_reader_load_status_changed_cb), reader); diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c index 9bfb032a7a..e13e1f95f0 100644 --- a/mail/em-filter-rule.c +++ b/mail/em-filter-rule.c @@ -659,7 +659,7 @@ get_widget (EFilterRule *fr, g_object_set_data (G_OBJECT (add), "scrolled-window", scrolledwindow); - g_signal_connect ( + e_signal_connect_notify ( vadj, "notify::upper", G_CALLBACK (ensure_scrolled_height_cb), scrolledwindow); diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c index 2d816c7c9e..9a84439bd3 100644 --- a/mail/em-subscription-editor.c +++ b/mail/em-subscription-editor.c @@ -1798,7 +1798,7 @@ em_subscription_editor_init (EMSubscriptionEditor *editor) G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); - g_signal_connect ( + e_signal_connect_notify ( widget, "notify::sensitive", G_CALLBACK (emse_notebook_sensitive_changed_cb), editor); diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c index 3703318c9b..b4080a9b6d 100644 --- a/modules/addressbook/e-book-shell-view-private.c +++ b/modules/addressbook/e-book-shell-view-private.c @@ -330,7 +330,7 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view, G_CALLBACK (contacts_removed), book_shell_view, G_CONNECT_SWAPPED); - g_signal_connect_object ( + e_signal_connect_notify_object ( model, "notify::query", G_CALLBACK (model_query_changed_cb), book_shell_view, G_CONNECT_SWAPPED); @@ -490,7 +490,7 @@ e_book_shell_view_private_init (EBookShellView *book_shell_view) priv->uid_to_view = uid_to_view; priv->preview_index = -1; - g_signal_connect ( + e_signal_connect_notify ( book_shell_view, "notify::view-id", G_CALLBACK (book_shell_view_notify_view_id_cb), NULL); } diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 8029cc8f0a..5d1066edf1 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -407,7 +407,7 @@ cal_shell_content_constructed (GObject *object) for (ii = 0; ii < GNOME_CAL_LAST_VIEW; ii++) { calendar_view = gnome_calendar_get_calendar_view (calendar, ii); - g_signal_connect ( + e_signal_connect_notify ( calendar_view, "notify::is-editing", G_CALLBACK (cal_shell_content_is_editing_changed_cb), shell_view); @@ -465,7 +465,7 @@ cal_shell_content_constructed (GObject *object) G_CALLBACK (e_cal_shell_view_taskpad_open_task), shell_view); - g_signal_connect ( + e_signal_connect_notify ( widget, "notify::is-editing", G_CALLBACK (cal_shell_content_is_editing_changed_cb), shell_view); @@ -511,7 +511,7 @@ cal_shell_content_constructed (GObject *object) G_CALLBACK (e_cal_shell_view_memopad_open_memo), shell_view); - g_signal_connect ( + e_signal_connect_notify ( widget, "notify::is-editing", G_CALLBACK (cal_shell_content_is_editing_changed_cb), shell_view); @@ -527,7 +527,7 @@ cal_shell_content_constructed (GObject *object) e_shell_view_set_view_instance (shell_view, view_instance); g_object_unref (view_instance); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( shell_view, "notify::view-id", G_CALLBACK (cal_shell_content_notify_view_id_cb), object); diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index bd3b943274..04c6c7a11f 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -431,7 +431,7 @@ cal_shell_view_notify_view_id_cb (EShellView *shell_view) void e_cal_shell_view_private_init (ECalShellView *cal_shell_view) { - g_signal_connect ( + e_signal_connect_notify ( cal_shell_view, "notify::view-id", G_CALLBACK (cal_shell_view_notify_view_id_cb), NULL); } diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 95be0dc7db..4b0c4b577f 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -533,7 +533,7 @@ memo_shell_content_constructed (GObject *object) G_CALLBACK (memo_shell_content_selection_change_cb), object); - g_signal_connect ( + e_signal_connect_notify ( priv->memo_table, "notify::is-editing", G_CALLBACK (memo_shell_content_is_editing_changed_cb), shell_view); diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c index a389c6686f..8a92ef5201 100644 --- a/modules/calendar/e-memo-shell-view-private.c +++ b/modules/calendar/e-memo-shell-view-private.c @@ -143,7 +143,7 @@ memo_shell_view_notify_view_id_cb (EShellView *shell_view) void e_memo_shell_view_private_init (EMemoShellView *memo_shell_view) { - g_signal_connect ( + e_signal_connect_notify ( memo_shell_view, "notify::view-id", G_CALLBACK (memo_shell_view_notify_view_id_cb), NULL); } diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index a7c2981849..aa31281433 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -530,7 +530,7 @@ task_shell_content_constructed (GObject *object) G_CALLBACK (task_shell_content_selection_change_cb), object); - g_signal_connect ( + e_signal_connect_notify ( priv->task_table, "notify::is-editing", G_CALLBACK (task_shell_content_is_editing_changed_cb), shell_view); diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index 6e2a8dac3c..863fd0136e 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -210,7 +210,7 @@ task_shell_view_notify_view_id_cb (EShellView *shell_view) void e_task_shell_view_private_init (ETaskShellView *task_shell_view) { - g_signal_connect ( + e_signal_connect_notify ( task_shell_view, "notify::view-id", G_CALLBACK (task_shell_view_notify_view_id_cb), NULL); } diff --git a/modules/composer-autosave/e-composer-autosave.c b/modules/composer-autosave/e-composer-autosave.c index f2aed787ca..33d6c0203e 100644 --- a/modules/composer-autosave/e-composer-autosave.c +++ b/modules/composer-autosave/e-composer-autosave.c @@ -172,7 +172,7 @@ composer_autosave_constructed (GObject *object) extensible = e_extension_get_extensible (E_EXTENSION (object)); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( extensible, "notify::changed", G_CALLBACK (composer_autosave_changed_cb), object); } diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index f1922273a6..02a0b29e55 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -567,7 +567,7 @@ mail_shell_view_search_filter_changed_cb (EMailShellView *mail_shell_view) void e_mail_shell_view_private_init (EMailShellView *mail_shell_view) { - g_signal_connect ( + e_signal_connect_notify ( mail_shell_view, "notify::view-id", G_CALLBACK (mail_shell_view_notify_view_id_cb), NULL); } diff --git a/modules/offline-alert/evolution-offline-alert.c b/modules/offline-alert/evolution-offline-alert.c index 153d518f59..db99dc15e8 100644 --- a/modules/offline-alert/evolution-offline-alert.c +++ b/modules/offline-alert/evolution-offline-alert.c @@ -115,11 +115,11 @@ offline_alert_window_added_cb (GtkApplication *application, /* Connect these signals after we have the first EShellWindow * to avoid false-positive signals during EShell initialization. */ - g_signal_connect ( + e_signal_connect_notify ( shell, "notify::online", G_CALLBACK (offline_alert_online_cb), extension); - g_signal_connect ( + e_signal_connect_notify ( shell, "notify::network-available", G_CALLBACK (offline_alert_network_available_cb), extension); diff --git a/modules/startup-wizard/e-mail-config-import-progress-page.c b/modules/startup-wizard/e-mail-config-import-progress-page.c index 14280b7c7b..7ec04c77f4 100644 --- a/modules/startup-wizard/e-mail-config-import-progress-page.c +++ b/modules/startup-wizard/e-mail-config-import-progress-page.c @@ -182,7 +182,7 @@ mail_config_import_progress_page_constructed (GObject *object) activity = e_mail_config_import_progress_page_get_activity (page); /* The activity state affects the "check-complete" result. */ - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( activity, "notify::state", G_CALLBACK (e_mail_config_page_changed), page); diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 71105d8fd6..065df232ad 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -791,7 +791,7 @@ do_manage_comp_idle (struct _manage_comp *mc) /* Force editor's title change */ comp_editor_title_changed (GTK_WIDGET (editor), NULL, mc); - g_signal_connect ( + e_signal_connect_notify ( editor, "notify::title", G_CALLBACK (comp_editor_title_changed), mc); g_signal_connect ( diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index b108cf7590..1eceaa0dd2 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -1009,7 +1009,7 @@ e_plugin_lib_enable (EPlugin *ep, g_signal_handlers_disconnect_by_func (shell, G_CALLBACK (online_state_changed), NULL); if (enable) { online = e_shell_get_online (shell); - g_signal_connect ( + e_signal_connect_notify ( shell, "notify::online", G_CALLBACK (online_state_changed), NULL); } diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index 191426e162..a4d6394660 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -33,6 +33,8 @@ #include #include +#include + #define E_SHELL_SWITCHER_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_SHELL_SWITCHER, EShellSwitcherPrivate)) @@ -377,7 +379,7 @@ shell_switcher_screen_changed (GtkWidget *widget, if (settings != NULL) { priv->settings = g_object_ref (settings); - priv->settings_handler_id = g_signal_connect_swapped ( + priv->settings_handler_id = e_signal_connect_notify_swapped ( settings, "notify::gtk-toolbar-style", G_CALLBACK (shell_switcher_toolbar_style_changed_cb), widget); diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index d00b8496b7..67612063e6 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -327,19 +327,19 @@ e_shell_window_private_constructed (EShellWindow *shell_window) /* Bunch of chores to do when the active view changes. */ - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (e_shell_window_update_icon), NULL); - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (e_shell_window_update_title), NULL); - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (e_shell_window_update_view_menu), NULL); - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (e_shell_window_update_search_menu), NULL); diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index 69eef7d40f..70187c954f 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -454,7 +454,7 @@ shell_window_construct_menubar (EShellWindow *shell_window) shell_window, "/main-menu"); gtk_widget_show (main_menu); - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (shell_window_menubar_update_new_menu), NULL); @@ -572,7 +572,7 @@ shell_window_construct_sidebar (EShellWindow *shell_window) shell_window->priv->sidebar_notebook = g_object_ref (notebook); gtk_widget_show (notebook); - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (shell_window_set_notebook_page), notebook); @@ -600,7 +600,7 @@ shell_window_construct_content (EShellWindow *shell_window) shell_window->priv->content_notebook = g_object_ref (widget); gtk_widget_show (widget); - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (shell_window_set_notebook_page), widget); @@ -665,7 +665,7 @@ shell_window_construct_taskbar (EShellWindow *shell_window) shell_window->priv->status_notebook = g_object_ref (notebook); gtk_widget_show (notebook); - g_signal_connect ( + e_signal_connect_notify ( shell_window, "notify::active-view", G_CALLBACK (shell_window_set_notebook_page), notebook); @@ -747,15 +747,15 @@ shell_window_create_shell_view (EShellWindow *shell_window, /* Listen for changes that affect the shell window. */ - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( action, "notify::icon-name", G_CALLBACK (e_shell_window_update_icon), shell_window); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( shell_view, "notify::title", G_CALLBACK (e_shell_window_update_title), shell_window); - g_signal_connect_swapped ( + e_signal_connect_notify_swapped ( shell_view, "notify::view-id", G_CALLBACK (e_shell_window_update_view_menu), shell_window); diff --git a/shell/e-shell.c b/shell/e-shell.c index 2c1ae2f83f..dc2d993de6 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1171,7 +1171,7 @@ e_shell_init (EShell *shell) icon_theme = gtk_icon_theme_get_default (); gtk_icon_theme_append_search_path (icon_theme, EVOLUTION_ICONDIR); - g_signal_connect ( + e_signal_connect_notify ( shell, "notify::online", G_CALLBACK (shell_notify_online_cb), NULL); diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index a955303087..b67577e43e 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -447,7 +447,7 @@ treeview_add_column (CertPage *cp, g_signal_connect ( item, "toggled", G_CALLBACK (header_popup_item_toggled), column); - g_signal_connect ( + e_signal_connect_notify ( column, "notify::visible", G_CALLBACK (treeview_column_visibility_changed), item); } -- cgit v1.2.3