aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-client
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-09-01 01:21:14 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-09-01 01:21:14 +0800
commit8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980 (patch)
treeee014e97032812255cebfd1f73d216fb3df33153 /calendar/cal-client
parent72f85e235d8d49582709d912ba52f326e5dfddaa (diff)
downloadgsoc2013-evolution-8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980.tar
gsoc2013-evolution-8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980.tar.gz
gsoc2013-evolution-8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980.tar.bz2
gsoc2013-evolution-8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980.tar.lz
gsoc2013-evolution-8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980.tar.xz
gsoc2013-evolution-8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980.tar.zst
gsoc2013-evolution-8ed9d08a53d1f5dca45ad0bab8f34cb4b41b4980.zip
Implement delete option (recurrence_toggled): Make an ugly hack to get the
2000-08-31 JP Rosevear <jpr@helixcode.com> * gui/event-editor.c (file_delete_cb): Implement delete option (recurrence_toggled): Make an ugly hack to get the recurrence pages showing properly since we don't yet implement all of the recurrence rule stuff. * cal-client/cal-client.c (cal_client_object_exists): New function to see if an object exists and is obtainable from the backend * cal-client/cal-client.h: Add prototype svn path=/trunk/; revision=5143
Diffstat (limited to 'calendar/cal-client')
-rw-r--r--calendar/cal-client/cal-client.c31
-rw-r--r--calendar/cal-client/cal-client.h1
2 files changed, 32 insertions, 0 deletions
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index 65c0c4aea4..d64026d6b2 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -605,6 +605,37 @@ cal_client_get_n_objects (CalClient *client, CalObjType type)
}
/**
+ * cal_client_object_exists:
+ * @client: A calendar client
+ * @uid: Unique identifier for a calendar component
+ *
+ * Checks to see if a uid exists in the backend
+ *
+ * Return value: True or false if uid exists and can be obtained
+ **/
+gboolean
+cal_client_object_exists (CalClient *client, const char *uid)
+{
+ CalComponent *comp;
+ CalClientGetStatus status;
+
+ status = cal_client_get_object (client, uid, &comp);
+
+ switch (status) {
+ case CAL_CLIENT_GET_SUCCESS:
+ gtk_object_unref (GTK_OBJECT (comp));
+ return TRUE;
+
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_NOT_FOUND:
+ return FALSE;
+
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+/**
* cal_client_get_object:
* @client: A calendar client.
* @uid: Unique identifier for a calendar component.
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index 6747c7488e..bc08b2497a 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -88,6 +88,7 @@ gboolean cal_client_is_loaded (CalClient *client);
int cal_client_get_n_objects (CalClient *client, CalObjType type);
+gboolean cal_client_object_exists (CalClient *client, const char *uid);
CalClientGetStatus cal_client_get_object (CalClient *client,
const char *uid,
CalComponent **comp);