[evolution-data-server/email-factory] Bug 647873 [1/2] - Fix comparison of URI in e_cal_new_from_uri().



commit 993cec6fe2a8046cebdf3492e764957d2f060891
Author: David Woodhouse <David Woodhouse intel com>
Date:   Fri Apr 15 12:20:04 2011 +0100

    Bug 647873 [1/2] - Fix comparison of URI in e_cal_new_from_uri().
    
    If the URI only had a relative_uri property, we should build the full URI
    for comparison rather than just skipping it. Otherwise we get false
    mismatches.
    (cherry picked from commit 05c0b7b4bd06c9df459626e09713746d5efa2169)

 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 9adb7a6..d38f3e4 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -984,8 +984,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;
+	}
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]