aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-calendar-table.c15
-rw-r--r--calendar/gui/e-day-view.c49
-rw-r--r--calendar/gui/e-week-view.c40
3 files changed, 55 insertions, 49 deletions
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 6f31455fb8..c55875d943 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -109,8 +109,6 @@ static void selection_get (GtkWidget *invisible,
guint info,
guint time_stamp,
ECalendarTable *cal_table);
-static void invisible_destroyed (GtkWidget *invisible,
- ECalendarTable *cal_table);
static struct tm e_calendar_table_get_current_time (ECellDateEdit *ecde,
gpointer data);
static void mark_row_complete_cb (int model_row, gpointer data);
@@ -534,8 +532,6 @@ e_calendar_table_init (ECalendarTable *cal_table)
G_CALLBACK (selection_clear_event), cal_table);
g_signal_connect (cal_table->invisible, "selection_received",
G_CALLBACK (selection_received), cal_table);
- g_signal_connect_after (cal_table->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), cal_table);
cal_table->clipboard_selection = NULL;
}
@@ -588,8 +584,10 @@ e_calendar_table_destroy (GtkObject *object)
cal_table->model = NULL;
}
- if (cal_table->invisible)
+ if (cal_table->invisible) {
gtk_widget_destroy (cal_table->invisible);
+ cal_table->invisible = NULL;
+ }
if (cal_table->clipboard_selection) {
g_free (cal_table->clipboard_selection);
cal_table->clipboard_selection = NULL;
@@ -1174,13 +1172,6 @@ e_calendar_table_save_state (ECalendarTable *cal_table,
filename);
}
-
-static void
-invisible_destroyed (GtkWidget *invisible, ECalendarTable *cal_table)
-{
- cal_table->invisible = NULL;
-}
-
static void
selection_get (GtkWidget *invisible,
GtkSelectionData *selection_data,
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 9c29b00356..6764085741 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -465,7 +465,6 @@ static void selection_get (GtkWidget *invisible,
guint info,
guint time_stamp,
EDayView *day_view);
-static void invisible_destroyed (GtkWidget *invisible, EDayView *day_view);
static void e_day_view_queue_layout (EDayView *day_view);
static void e_day_view_cancel_layout (EDayView *day_view);
@@ -843,8 +842,6 @@ e_day_view_init (EDayView *day_view)
G_CALLBACK (selection_clear_event), (gpointer) day_view);
g_signal_connect (day_view->invisible, "selection_received",
G_CALLBACK (selection_received), (gpointer) day_view);
- g_signal_connect_after (day_view->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), (gpointer) day_view);
day_view->clipboard_selection = NULL;
@@ -920,21 +917,41 @@ e_day_view_destroy (GtkObject *object)
day_view->default_category = NULL;
}
- gdk_cursor_destroy (day_view->normal_cursor);
- gdk_cursor_destroy (day_view->move_cursor);
- gdk_cursor_destroy (day_view->resize_width_cursor);
- gdk_cursor_destroy (day_view->resize_height_cursor);
+
+ if (day_view->normal_cursor) {
+ gdk_cursor_unref (day_view->normal_cursor);
+ day_view->normal_cursor = NULL;
+ }
+ if (day_view->move_cursor) {
+ gdk_cursor_unref (day_view->move_cursor);
+ day_view->move_cursor = NULL;
+ }
+ if (day_view->resize_width_cursor) {
+ gdk_cursor_unref (day_view->resize_width_cursor);
+ day_view->resize_width_cursor = NULL;
+ }
+ if (day_view->resize_height_cursor) {
+ gdk_cursor_unref (day_view->resize_height_cursor);
+ day_view->resize_height_cursor = NULL;
+ }
- e_day_view_free_events (day_view);
- g_array_free (day_view->long_events, TRUE);
- day_view->long_events = NULL;
+ if (day_view->long_events) {
+ e_day_view_free_events (day_view);
+ g_array_free (day_view->long_events, TRUE);
+ day_view->long_events = NULL;
+ }
+
for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) {
- g_array_free (day_view->events[day], TRUE);
- day_view->events[day] = NULL;
+ if (day_view->events[day]) {
+ g_array_free (day_view->events[day], TRUE);
+ day_view->events[day] = NULL;
+ }
}
- if (day_view->invisible)
+ if (day_view->invisible) {
gtk_widget_destroy (day_view->invisible);
+ day_view->invisible = NULL;
+ }
if (day_view->clipboard_selection) {
g_free (day_view->clipboard_selection);
day_view->clipboard_selection = NULL;
@@ -7572,12 +7589,6 @@ e_day_view_get_time_string_width (EDayView *day_view)
}
static void
-invisible_destroyed (GtkWidget *invisible, EDayView *day_view)
-{
- day_view->invisible = NULL;
-}
-
-static void
selection_get (GtkWidget *invisible,
GtkSelectionData *selection_data,
guint info,
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 2ca52c8ca7..2e83b2c6c7 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -218,7 +218,6 @@ static gboolean e_week_view_remove_event_cb (EWeekView *week_view,
gpointer data);
static gboolean e_week_view_recalc_display_start_day (EWeekView *week_view);
-static void invisible_destroyed (GtkWidget *invisible, EWeekView *week_view);
static void selection_get (GtkWidget *invisible,
GtkSelectionData *selection_data,
guint info,
@@ -434,8 +433,6 @@ e_week_view_init (EWeekView *week_view)
G_CALLBACK (selection_clear_event), (gpointer) week_view);
g_signal_connect (week_view->invisible, "selection_received",
G_CALLBACK (selection_received), (gpointer) week_view);
- g_signal_connect_after (week_view->invisible, "destroy",
- G_CALLBACK (invisible_destroyed), (gpointer) week_view);
week_view->clipboard_selection = NULL;
@@ -469,10 +466,12 @@ e_week_view_destroy (GtkObject *object)
e_week_view_cancel_layout (week_view);
- e_week_view_free_events (week_view);
- g_array_free (week_view->events, TRUE);
- week_view->events = NULL;
-
+ if (week_view->events) {
+ e_week_view_free_events (week_view);
+ g_array_free (week_view->events, TRUE);
+ week_view->events = NULL;
+ }
+
if (week_view->client) {
g_signal_handlers_disconnect_matched (week_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, week_view);
g_object_unref (week_view->client);
@@ -501,12 +500,23 @@ e_week_view_destroy (GtkObject *object)
week_view->default_category = NULL;
}
- gdk_cursor_destroy (week_view->normal_cursor);
- gdk_cursor_destroy (week_view->move_cursor);
- gdk_cursor_destroy (week_view->resize_width_cursor);
-
- if (week_view->invisible)
+ if (week_view->normal_cursor) {
+ gdk_cursor_unref (week_view->normal_cursor);
+ week_view->normal_cursor = NULL;
+ }
+ if (week_view->move_cursor) {
+ gdk_cursor_unref (week_view->move_cursor);
+ week_view->move_cursor = NULL;
+ }
+ if (week_view->resize_width_cursor) {
+ gdk_cursor_unref (week_view->resize_width_cursor);
+ week_view->resize_width_cursor = NULL;
+ }
+
+ if (week_view->invisible) {
gtk_widget_destroy (week_view->invisible);
+ week_view->invisible = NULL;
+ }
if (week_view->clipboard_selection) {
g_free (week_view->clipboard_selection);
week_view->clipboard_selection = NULL;
@@ -4218,12 +4228,6 @@ e_week_view_get_time_string_width (EWeekView *week_view)
}
static void
-invisible_destroyed (GtkWidget *invisible, EWeekView *week_view)
-{
- week_view->invisible = NULL;
-}
-
-static void
selection_get (GtkWidget *invisible,
GtkSelectionData *selection_data,
guint info,