Re: [Evolution-hackers] [PATCH 2/2] Fix comparison of URI in e_cal_new_from_uri().
On Fri, 2011-04-15 at 12:37 +0100, David Woodhouse wrote: > If the URI only had a relative_uri property, it should build the full > URI > for comparison rather than just skipping it. We have the opposite problem in the file backend, in the hack that sets the cache dir for the system source to "system" instead of the uid: source_dir = e_source_peek_relative_uri (source); if (!source_dir || !g_str_equal (source_dir, "system")) source_dir = e_source_peek_uid (source); But if we fix that, we risk changing the storage directory of existing sources. So I suppose that has to remain as it was. -- David WoodhouseOpen Source Technology Centre david.woodho...@intel.com Intel Corporation ___ evolution-hackers mailing list evolution-hackers@gnome.org To change your list options or unsubscribe, visit ... http://mail.gnome.org/mailman/listinfo/evolution-hackers
[Evolution-hackers] [PATCH 2/2] Fix comparison of URI in e_cal_new_from_uri().
If the URI only had a relative_uri property, it should build the full URI for comparison rather than just skipping it. --- calendar/libecal/e-cal.c | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c index 69ff9c7..a60abfb 100644 --- a/calendar/libecal/e-cal.c +++ b/calendar/libecal/e-cal.c @@ -988,8 +988,17 @@ check_uri (ESource *source, gpointer uri) g_return_val_if_fail (uri != NULL, FALSE); suri = e_source_peek_absolute_uri (source); + if (suri) + return !g_ascii_strcasecmp (suri, uri); + else { + gboolean ret; + gchar *suri2; - return suri && g_ascii_strcasecmp (suri, uri) == 0; + suri2 = e_source_get_uri (source); + ret = !g_ascii_strcasecmp (suri2, uri); + g_free (suri2); + return ret; + } } /** -- 1.7.4.2 ___ evolution-hackers mailing list evolution-hackers@gnome.org To change your list options or unsubscribe, visit ... http://mail.gnome.org/mailman/listinfo/evolution-hackers