aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-itip-control.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@src.gnome.org>2003-08-08 00:38:20 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-08-08 00:38:20 +0800
commitdc84df9871b3171a21d62feec988160f3c608103 (patch)
tree29f8dfbfa57dc43ae07fe645a1664fc5b1222086 /calendar/gui/e-itip-control.c
parent64222beb23056f789551b79e78fa721d32408e9e (diff)
downloadgsoc2013-evolution-dc84df9871b3171a21d62feec988160f3c608103.tar
gsoc2013-evolution-dc84df9871b3171a21d62feec988160f3c608103.tar.gz
gsoc2013-evolution-dc84df9871b3171a21d62feec988160f3c608103.tar.bz2
gsoc2013-evolution-dc84df9871b3171a21d62feec988160f3c608103.tar.lz
gsoc2013-evolution-dc84df9871b3171a21d62feec988160f3c608103.tar.xz
gsoc2013-evolution-dc84df9871b3171a21d62feec988160f3c608103.tar.zst
gsoc2013-evolution-dc84df9871b3171a21d62feec988160f3c608103.zip
Merge new-calendar-branch into HEAD
svn path=/trunk/; revision=22129
Diffstat (limited to 'calendar/gui/e-itip-control.c')
-rw-r--r--calendar/gui/e-itip-control.c79
1 files changed, 47 insertions, 32 deletions
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 2e1ff4cb67..91a355f269 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -304,13 +304,13 @@ find_server (GPtrArray *servers, CalComponent *comp)
cal_component_get_uid (comp, &uid);
for (i = 0; i < servers->len; i++) {
CalClient *client;
- CalComponent *found_comp;
+ icalcomponent *icalcomp;
CalClientGetStatus status;
client = g_ptr_array_index (servers, i);
- status = cal_client_get_object (client, uid, &found_comp);
+ status = cal_client_get_object (client, uid, &icalcomp);
if (status == CAL_CLIENT_GET_SUCCESS) {
- g_object_unref (found_comp);
+ icalcomponent_free (icalcomp);
g_object_ref (client);
return client;
@@ -1248,6 +1248,7 @@ get_real_item (EItipControl *itip)
{
EItipControlPrivate *priv;
CalComponent *comp;
+ icalcomponent *icalcomp;
CalComponentVType type;
CalClientGetStatus status = CAL_CLIENT_GET_NOT_FOUND;
const char *uid;
@@ -1260,11 +1261,11 @@ get_real_item (EItipControl *itip)
switch (type) {
case CAL_COMPONENT_EVENT:
if (priv->event_client != NULL)
- status = cal_client_get_object (priv->event_client, uid, &comp);
+ status = cal_client_get_object (priv->event_client, uid, &icalcomp);
break;
case CAL_COMPONENT_TODO:
if (priv->task_client != NULL)
- status = cal_client_get_object (priv->task_client, uid, &comp);
+ status = cal_client_get_object (priv->task_client, uid, &icalcomp);
break;
default:
status = CAL_CLIENT_GET_NOT_FOUND;
@@ -1273,6 +1274,13 @@ get_real_item (EItipControl *itip)
if (status != CAL_CLIENT_GET_SUCCESS)
return NULL;
+ comp = cal_component_new ();
+ if (!cal_component_set_icalcomponent (comp, icalcomp)) {
+ g_object_unref (comp);
+ icalcomponent_free (icalcomp);
+ return NULL;
+ }
+
return comp;
}
@@ -1936,6 +1944,7 @@ update_attendee_status (EItipControl *itip)
CalClient *client;
CalClientGetStatus status;
CalComponent *comp = NULL;
+ icalcomponent *icalcomp = NULL;
CalComponentVType type;
const char *uid;
GtkWidget *dialog;
@@ -1957,41 +1966,47 @@ update_attendee_status (EItipControl *itip)
/* Obtain our version */
cal_component_get_uid (priv->comp, &uid);
- status = cal_client_get_object (client, uid, &comp);
+ status = cal_client_get_object (client, uid, &icalcomp);
if (status == CAL_CLIENT_GET_SUCCESS) {
GSList *attendees;
- cal_component_get_attendee_list (priv->comp, &attendees);
- if (attendees != NULL) {
- CalComponentAttendee *a = attendees->data;
- icalproperty *prop;
+ comp = cal_component_new ();
+ if (!cal_component_set_icalcomponent (comp, icalcomp)) {
+ icalcomponent_free (icalcomp);
- prop = find_attendee (cal_component_get_icalcomponent (comp),
- itip_strip_mailto (a->value));
-
- if (prop == NULL) {
- dialog = gnome_question_dialog_modal (_("This response is not from a current "
- "attendee. Add as an attendee?"),
- NULL, NULL);
- if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == GNOME_YES) {
- change_status (cal_component_get_icalcomponent (comp),
+ dialog = gnome_warning_dialog (_("Object is invalid and cannot be updated\n"));
+ } else {
+ cal_component_get_attendee_list (priv->comp, &attendees);
+ if (attendees != NULL) {
+ CalComponentAttendee *a = attendees->data;
+ icalproperty *prop;
+
+ prop = find_attendee (icalcomp, itip_strip_mailto (a->value));
+
+ if (prop == NULL) {
+ dialog = gnome_question_dialog_modal (_("This response is not from a current "
+ "attendee. Add as an attendee?"),
+ NULL, NULL);
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == GNOME_YES) {
+ change_status (icalcomp,
+ itip_strip_mailto (a->value),
+ a->status);
+ cal_component_rescan (comp);
+ } else {
+ goto cleanup;
+ }
+ } else if (a->status == ICAL_PARTSTAT_NONE || a->status == ICAL_PARTSTAT_X) {
+ dialog = gnome_warning_dialog (_("Attendee status could "
+ "not be updated because "
+ "of an invalid status!\n"));
+ goto cleanup;
+ } else {
+ change_status (icalcomp,
itip_strip_mailto (a->value),
a->status);
- cal_component_rescan (comp);
- } else {
- goto cleanup;
+ cal_component_rescan (comp);
}
- } else if (a->status == ICAL_PARTSTAT_NONE || a->status == ICAL_PARTSTAT_X) {
- dialog = gnome_warning_dialog (_("Attendee status could "
- "not be updated because "
- "of an invalid status!\n"));
- goto cleanup;
- } else {
- change_status (cal_component_get_icalcomponent (comp),
- itip_strip_mailto (a->value),
- a->status);
- cal_component_rescan (comp);
}
}