Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 309669 Details for
Bug 412829
gnome-extra/evolution-data-server-3.2.3-r1: Adding events to Google Calendar is broken
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to calendar/backends/caldav/e-cal-backend-caldav.c
evolution-data-server-3.2.3-google-calendar.patch (text/plain), 3.11 KB, created by
Bernd Feige
on 2012-04-20 20:30:22 UTC
(
hide
)
Description:
Patch to calendar/backends/caldav/e-cal-backend-caldav.c
Filename:
MIME Type:
Creator:
Bernd Feige
Created:
2012-04-20 20:30:22 UTC
Size:
3.11 KB
patch
obsolete
>=== modified file 'calendar/backends/caldav/e-cal-backend-caldav.c' >--- calendar/backends/caldav/e-cal-backend-caldav.c 2012-04-20 17:41:01 +0000 >+++ calendar/backends/caldav/e-cal-backend-caldav.c 2012-04-20 17:34:47 +0000 >@@ -1535,6 +1535,41 @@ > g_object_unref (message); > } > >+static gchar * >+caldav_gen_file_from_uid_cal (ECalBackendCalDAV *cbdav, >+ icalcomponent *icalcomp) >+{ >+ icalcomponent_kind my_kind; >+ const gchar *uid = NULL; >+ gchar *filename, *res; >+ >+ g_return_val_if_fail (cbdav != NULL, NULL); >+ g_return_val_if_fail (icalcomp != NULL, NULL); >+ >+ my_kind = e_cal_backend_get_kind (E_CAL_BACKEND (cbdav)); >+ if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) { >+ icalcomponent *subcomp; >+ >+ for (subcomp = icalcomponent_get_first_component (icalcomp, my_kind); >+ subcomp; >+ subcomp = icalcomponent_get_next_component (icalcomp, my_kind)) { >+ uid = icalcomponent_get_uid (subcomp); >+ break; >+ } >+ } else if (icalcomponent_isa (icalcomp) == my_kind) { >+ uid = icalcomponent_get_uid (icalcomp); >+ } >+ >+ if (!uid) >+ return NULL; >+ >+ filename = g_strconcat (uid, ".ics", NULL); >+ res = soup_uri_encode (filename, NULL); >+ g_free (filename); >+ >+ return res; >+} >+ > static gboolean > caldav_server_put_object (ECalBackendCalDAV *cbdav, > CalDAVObject *object, >@@ -1601,7 +1636,7 @@ > } > > if (status_code_to_result (message, priv, perror)) { >- gboolean was_get = FALSE; >+ GError *local_error = NULL; > > hdr = soup_message_headers_get (message->response_headers, "ETag"); > if (hdr != NULL) { >@@ -1627,12 +1662,38 @@ > } > } > >- was_get = TRUE; >- >- if (caldav_server_get_object (cbdav, object, perror)) { >+ if (!caldav_server_get_object (cbdav, object, &local_error)) { >+ if (g_error_matches (local_error, E_DATA_CAL_ERROR, NoSuchCal)) { >+ gchar *file; >+ >+ /* OK, the event was properly created, but cannot be found on the place >+ where it was PUT - why didn't server tell us where it saved it? */ >+ g_clear_error (&local_error); >+ >+ /* try whether it's saved as its UID.ics file */ >+ file = caldav_gen_file_from_uid_cal (cbdav, icalcomp); >+ if (file) { >+ g_free (object->href); >+ object->href = file; >+ >+ if (!caldav_server_get_object (cbdav, object, &local_error)) { >+ if (g_error_matches (local_error, E_DATA_CAL_ERROR, NoSuchCal)) { >+ g_clear_error (&local_error); >+ >+ /* not sure what can happen, but do not need to guess for ever, >+ thus report success and update the calendar to get fresh info */ >+ cbdav->priv->slave_cmd = SLAVE_SHOULD_WORK; >+ g_cond_signal (cbdav->priv->cond); >+ } >+ } >+ } >+ } >+ } >+ >+ if (!local_error) { > icalcomponent *use_comp = NULL; > >- if (object->cdata && was_get) { >+ if (object->cdata) { > /* maybe server also modified component, thus rather store the server's */ > use_comp = icalparser_parse_string (object->cdata); > } >@@ -1644,6 +1705,8 @@ > > if (use_comp != icalcomp) > icalcomponent_free (use_comp); >+ } else { >+ g_propagate_error (perror, local_error); > } > } else if (message->status_code == 401) { > caldav_notify_auth_required (cbdav); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 412829
: 309669