aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/comp-util.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-09-21 03:36:54 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-09-21 03:36:54 +0800
commitac3b4c71ffbd70f791f70962daeadf4ce99d5f5b (patch)
tree625a02ab4091d326b2f6e808bed87a2d19f4ecb0 /calendar/gui/comp-util.c
parent5c128c7bddf6df35f6b5b8f7598ac8d5287da6f2 (diff)
downloadgsoc2013-evolution-ac3b4c71ffbd70f791f70962daeadf4ce99d5f5b.tar
gsoc2013-evolution-ac3b4c71ffbd70f791f70962daeadf4ce99d5f5b.tar.gz
gsoc2013-evolution-ac3b4c71ffbd70f791f70962daeadf4ce99d5f5b.tar.bz2
gsoc2013-evolution-ac3b4c71ffbd70f791f70962daeadf4ce99d5f5b.tar.lz
gsoc2013-evolution-ac3b4c71ffbd70f791f70962daeadf4ce99d5f5b.tar.xz
gsoc2013-evolution-ac3b4c71ffbd70f791f70962daeadf4ce99d5f5b.tar.zst
gsoc2013-evolution-ac3b4c71ffbd70f791f70962daeadf4ce99d5f5b.zip
check to see if the component is already on the server or not
2002-09-20 JP Rosevear <jpr@ximian.com> * gui/comp-util.c (cal_comp_is_on_server): check to see if the component is already on the server or not * gui/comp-util.h: change proto * gui/e-week-view.c (e_week_view_on_editing_stopped): only delete the event if the summary is empty and the component is not already on the server * gui/e-day-view.c (e_day_view_on_editing_stopped): same Fixes #14111 svn path=/trunk/; revision=18138
Diffstat (limited to 'calendar/gui/comp-util.c')
-rw-r--r--calendar/gui/comp-util.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index 6b3c0b0594..46331fa265 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -205,19 +205,17 @@ cal_comp_util_compare_event_timezones (CalComponent *comp,
* was on the server and the user deleted it, or whether the
* user cancelled the deletion.
**/
-ConfirmDeleteEmptyCompResult
-cal_comp_confirm_delete_empty_comp (CalComponent *comp, CalClient *client, GtkWidget *widget)
+gboolean
+cal_comp_is_on_server (CalComponent *comp, CalClient *client)
{
const char *uid;
CalClientGetStatus status;
CalComponent *server_comp;
- g_return_val_if_fail (comp != NULL, EMPTY_COMP_DO_NOT_REMOVE);
- g_return_val_if_fail (IS_CAL_COMPONENT (comp), EMPTY_COMP_DO_NOT_REMOVE);
- g_return_val_if_fail (client != NULL, EMPTY_COMP_DO_NOT_REMOVE);
- g_return_val_if_fail (IS_CAL_CLIENT (client), EMPTY_COMP_DO_NOT_REMOVE);
- g_return_val_if_fail (widget != NULL, EMPTY_COMP_DO_NOT_REMOVE);
- g_return_val_if_fail (GTK_IS_WIDGET (widget), EMPTY_COMP_DO_NOT_REMOVE);
+ g_return_val_if_fail (comp != NULL, FALSE);
+ g_return_val_if_fail (IS_CAL_COMPONENT (comp), FALSE);
+ g_return_val_if_fail (client != NULL, FALSE);
+ g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE);
/* See if the component is on the server. If it is not, then it likely
* means that the appointment is new, only in the day view, and we
@@ -232,30 +230,22 @@ cal_comp_confirm_delete_empty_comp (CalComponent *comp, CalClient *client, GtkWi
switch (status) {
case CAL_CLIENT_GET_SUCCESS:
gtk_object_unref (GTK_OBJECT (server_comp));
- /* Will handle confirmation below */
- break;
+ return TRUE;
case CAL_CLIENT_GET_SYNTAX_ERROR:
g_message ("confirm_delete_empty_appointment(): Syntax error when getting "
"object `%s'",
uid);
- /* However, the object *is* in the server, so confirm */
- break;
+ return TRUE;
case CAL_CLIENT_GET_NOT_FOUND:
- return EMPTY_COMP_REMOVE_LOCALLY;
+ return FALSE;
default:
g_assert_not_reached ();
}
-
- /* The event exists in the server, so confirm whether to delete it */
-
- if (delete_component_dialog (comp, TRUE, 1, CAL_COMPONENT_EVENT, widget)) {
- cal_client_remove_object (client, uid);
- return EMPTY_COMP_REMOVED_FROM_SERVER;
- } else
- return EMPTY_COMP_DO_NOT_REMOVE;
+
+ return FALSE;
}
/**