Index: plugins/caldav/ChangeLog
===================================================================
--- plugins/caldav/ChangeLog	(revision 36825)
+++ plugins/caldav/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-12-02  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #562990
+
+	* caldav-source.c: (user_changed), (oge_caldav): Use 'username'
+	property of the ESource to read/write user name, not the uri.
+
 2008-11-28  Milan Crha  <mcrha@redhat.com>
 
 	** Part of fix for bug #503662
Index: plugins/caldav/caldav-source.c
===================================================================
--- plugins/caldav/caldav-source.c	(revision 36825)
+++ plugins/caldav/caldav-source.c	(working copy)
@@ -190,16 +190,15 @@ user_changed (GtkEntry *editable, ESourc
 
 	euri = e_uri_new (uri);
 	g_free (euri->user);
+	euri->user = NULL;
 
 	if (user != NULL && *user) {
-		euri->user = g_strdup (user);
 		e_source_set_property (source, "auth", "1");
 	} else {
 		e_source_set_property (source, "auth", NULL);
-		euri->user = NULL;
 	}
 
-	e_source_set_property (source, "username", euri->user);
+	e_source_set_property (source, "username", user);
 	ruri = print_uri_noproto (euri);
 	e_source_set_relative_uri (source, ruri);
 	g_free (ruri);
@@ -328,10 +327,12 @@ oge_caldav  (EPlugin                    
 		return NULL;
 	}
 
-	username = euri->user;
+	g_free (euri->user);
 	euri->user = NULL;
 	uri = e_uri_to_string (euri, FALSE);
 
+	username = e_source_get_duped_property (source, "username");
+
 	ssl_prop = e_source_get_property (source, "ssl");
 	if (ssl_prop && ssl_prop[0] == '1') {
 		ssl_enabled = TRUE;
