aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-06-05 17:47:13 +0800
committerMilan Crha <mcrha@redhat.com>2014-06-05 17:47:13 +0800
commit2e71c861438a25ceac5811d9d3aa528691e71410 (patch)
tree88acf6b67904de4caae1034cebb7c040f3fab804 /calendar/gui/e-week-view.c
parent2f3fbdd6c6ff42a6c71ebe1d1d78108affe59d0f (diff)
downloadgsoc2013-evolution-2e71c861438a25ceac5811d9d3aa528691e71410.tar
gsoc2013-evolution-2e71c861438a25ceac5811d9d3aa528691e71410.tar.gz
gsoc2013-evolution-2e71c861438a25ceac5811d9d3aa528691e71410.tar.bz2
gsoc2013-evolution-2e71c861438a25ceac5811d9d3aa528691e71410.tar.lz
gsoc2013-evolution-2e71c861438a25ceac5811d9d3aa528691e71410.tar.xz
gsoc2013-evolution-2e71c861438a25ceac5811d9d3aa528691e71410.tar.zst
gsoc2013-evolution-2e71c861438a25ceac5811d9d3aa528691e71410.zip
Properly disconnect signal handlers added with e_signal_connect_notify*()
This is a follow-up for the previous commit, where e_signal_connect_notify*() functions had been added. Due to a different callback and user data being attached to the 'notify' signal, the g_signal_handlers_*() functions do not work properly, thus these e_signal_connect_notify*() functions need a different way for a signal handler disconnect. A side-change was done in e-settings-web-view-gtkhtml.c, checking for a real key change from GSettings.
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r--calendar/gui/e-week-view.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 21ec0229f4..f3343d9e5d 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -102,6 +102,8 @@ struct _EWeekViewPrivate {
* week_start_day, but if the Sat & Sun are compressed and the
* week starts on Sunday then we have to use Saturday. */
GDateWeekday display_start_day;
+
+ gulong notify_week_start_day_id;
};
typedef struct {
@@ -724,8 +726,10 @@ week_view_dispose (GObject *object)
e_week_view_cancel_layout (week_view);
- if (model)
+ if (model) {
g_signal_handlers_disconnect_by_data (model, object);
+ e_signal_disconnect_notify_handler (model, &week_view->priv->notify_week_start_day_id);
+ }
if (week_view->events) {
e_week_view_free_events (week_view);
@@ -761,18 +765,20 @@ week_view_dispose (GObject *object)
static void
week_view_constructed (GObject *object)
{
+ EWeekView *week_view;
ECalModel *model;
ECalendarView *calendar_view;
/* Chain up to parent's constructed() method. */
G_OBJECT_CLASS (e_week_view_parent_class)->constructed (object);
+ week_view = E_WEEK_VIEW (object);
calendar_view = E_CALENDAR_VIEW (object);
model = e_calendar_view_get_model (calendar_view);
e_week_view_recalc_display_start_day (E_WEEK_VIEW (object));
- e_signal_connect_notify_swapped (
+ week_view->priv->notify_week_start_day_id = e_signal_connect_notify_swapped (
model, "notify::week-start-day",
G_CALLBACK (week_view_notify_week_start_day_cb), object);