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 /calendar | |
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 'calendar')
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-cal-list-view.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 24 | ||||
-rw-r--r-- | calendar/gui/e-meeting-time-sel.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-task-table.c | 8 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 2 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 16 |
8 files changed, 30 insertions, 30 deletions
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); |