aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/caldav/caldav-source.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-04-28 23:02:53 +0800
committerMilan Crha <mcrha@redhat.com>2009-04-28 23:02:53 +0800
commit8da802661961ff0356088abfcb9217cef8ef2446 (patch)
tree447b1621447e15980c8a6d029331f3be4cac0215 /plugins/caldav/caldav-source.c
parentc868ace2e93942aef027085353bff2bd736584b3 (diff)
downloadgsoc2013-evolution-8da802661961ff0356088abfcb9217cef8ef2446.tar.gz
gsoc2013-evolution-8da802661961ff0356088abfcb9217cef8ef2446.tar.zst
gsoc2013-evolution-8da802661961ff0356088abfcb9217cef8ef2446.zip
Store username in a source URL in CalDAV
** Fix for bug #578335 * caldav-source.c: (user_changed), (location_changed): Revert part of bug #562990, as EPassword requires username as part of an URL to store passwords properly to a keyring.
Diffstat (limited to 'plugins/caldav/caldav-source.c')
-rw-r--r--plugins/caldav/caldav-source.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c
index 46e510367f..5df807a691 100644
--- a/plugins/caldav/caldav-source.c
+++ b/plugins/caldav/caldav-source.c
@@ -124,11 +124,22 @@ location_changed (GtkEntry *editable, ESource *source)
{
EUri *euri;
char *ruri;
- const char *uri;
+ const char *uri, *username;
uri = gtk_entry_get_text (GTK_ENTRY (editable));
euri = e_uri_new (uri);
+ g_return_if_fail (euri != NULL);
+
+ username = e_source_get_property (source, "username");
+ if (username && !*username)
+ username = NULL;
+
+ if ((!euri->user && username) || (euri->user && username && !g_str_equal (euri->user, username))) {
+ g_free (euri->user);
+ euri->user = g_strdup (username);
+ }
+
ruri = print_uri_noproto (euri);
e_source_set_relative_uri (source, ruri);
g_free (ruri);
@@ -163,6 +174,7 @@ user_changed (GtkEntry *editable, ESource *source)
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);