aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/event-editor.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-09-01 10:55:13 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-09-01 10:55:13 +0800
commit3441e17ab919b707fea1920feef7cc43874fec2e (patch)
treee75bf13fd2bd4d403d7db77aa34f17b6958adecb /calendar/gui/event-editor.c
parente60c558b2552803e624a5cef4fccdd645f2021e0 (diff)
downloadgsoc2013-evolution-3441e17ab919b707fea1920feef7cc43874fec2e.tar
gsoc2013-evolution-3441e17ab919b707fea1920feef7cc43874fec2e.tar.gz
gsoc2013-evolution-3441e17ab919b707fea1920feef7cc43874fec2e.tar.bz2
gsoc2013-evolution-3441e17ab919b707fea1920feef7cc43874fec2e.tar.lz
gsoc2013-evolution-3441e17ab919b707fea1920feef7cc43874fec2e.tar.xz
gsoc2013-evolution-3441e17ab919b707fea1920feef7cc43874fec2e.tar.zst
gsoc2013-evolution-3441e17ab919b707fea1920feef7cc43874fec2e.zip
No need to spit a warning if removal fails. (event_editor_destroy): Free
2000-08-31 Federico Mena Quintero <federico@helixcode.com> * gui/event-editor.c (file_delete_cb): No need to spit a warning if removal fails. (event_editor_destroy): Free the exception clist data. Unref the calendar client here. (close_dialog): Just call gtk_object_destroy() on the event editor; the destroy handler will free everything else. * cal-client/cal-client.c (cal_client_object_exists): Removed function; this is not useful because we operate asynchronously. * gui/e-day-view.c (e_day_view_on_delete_appointment): No need to spit a warning if removal fails. * gui/e-week-view.c (e_week_view_on_delete_appointment): Likewise. * gui/calendar-model.c (calendar_model_delete_task): Likewise. svn path=/trunk/; revision=5155
Diffstat (limited to 'calendar/gui/event-editor.c')
-rw-r--r--calendar/gui/event-editor.c67
1 files changed, 30 insertions, 37 deletions
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index 615395fdc1..b0202493f2 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -198,6 +198,23 @@ event_editor_init (EventEditor *ee)
ee->priv = priv;
}
+/* Frees the rows and the row data in the recurrence exceptions GtkCList */
+static void
+free_exception_clist_data (GtkCList *clist)
+{
+ int i;
+
+ for (i = 0; i < clist->rows; i++) {
+ gpointer data;
+
+ data = gtk_clist_get_row_data (clist, i);
+ g_free (data);
+ gtk_clist_set_row_data (clist, i, NULL);
+ }
+
+ gtk_clist_clear (clist);
+}
+
/* Destroy handler for the event editor */
static void
event_editor_destroy (GtkObject *object)
@@ -216,6 +233,8 @@ event_editor_destroy (GtkObject *object)
priv->uih = NULL;
}
+ free_exception_clist_data (GTK_CLIST (priv->recurrence_exceptions_list));
+
if (priv->app) {
gtk_signal_disconnect_by_data (GTK_OBJECT (priv->app), ee);
gtk_widget_destroy (priv->app);
@@ -227,6 +246,12 @@ event_editor_destroy (GtkObject *object)
priv->comp = NULL;
}
+ if (priv->client) {
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), ee);
+ gtk_object_unref (GTK_OBJECT (priv->client));
+ priv->client = NULL;
+ }
+
if (priv->xml) {
gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
@@ -455,23 +480,6 @@ recur_options_get (GtkWidget *widget)
static const int month_pos_map[] = { 0, 1, 2, 3, 4, -1 };
static const int weekday_map[] = { 0, 1, 2, 3, 4, 5, 6, -1 };
-/* Frees the rows and the row data in the recurrence exceptions GtkCList */
-static void
-free_exception_clist_data (GtkCList *clist)
-{
- int i;
-
- for (i = 0; i < clist->rows; i++) {
- gpointer data;
-
- data = gtk_clist_get_row_data (clist, i);
- g_free (data);
- gtk_clist_set_row_data (clist, i, NULL);
- }
-
- gtk_clist_clear (clist);
-}
-
/* Hooks the widget signals */
static void
init_widgets (EventEditor *ee)
@@ -1084,23 +1092,6 @@ close_dialog (EventEditor *ee)
g_assert (priv->app != NULL);
- free_exception_clist_data (GTK_CLIST (priv->recurrence_exceptions_list));
-
- gtk_widget_destroy (priv->app);
- priv->app = NULL;
-
- if (priv->comp) {
- gtk_object_unref (GTK_OBJECT (priv->comp));
- priv->comp = NULL;
- }
-
- if (priv->client) {
- gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), ee);
- gtk_object_unref (GTK_OBJECT (priv->client));
- priv->client = NULL;
- }
-
-
gtk_object_destroy (GTK_OBJECT (ee));
}
@@ -1133,9 +1124,11 @@ file_delete_cb (GtkWidget *widget, gpointer data)
g_return_if_fail (priv->comp);
cal_component_get_uid (priv->comp, &uid);
- if (cal_client_object_exists (priv->client, uid))
- if (!cal_client_remove_object (priv->client, uid))
- g_message ("file_delete_cb (): Could not remove the object!");
+
+ /* We don't check the return value; FALSE can mean the object was not in
+ * the server anyways.
+ */
+ cal_client_remove_object (priv->client, uid);
close_dialog (ee);
}