aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-04-28 23:02:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-01 03:14:32 +0800
commitfd94ba8cde63d761fc84a3724874529caa266f09 (patch)
tree34fe7a9e10c8a6b707a44b048ec30b9648230216 /plugins
parentc967f89205a219dbee10fd4431f27c60e8717900 (diff)
downloadgsoc2013-evolution-fd94ba8cde63d761fc84a3724874529caa266f09.tar
gsoc2013-evolution-fd94ba8cde63d761fc84a3724874529caa266f09.tar.gz
gsoc2013-evolution-fd94ba8cde63d761fc84a3724874529caa266f09.tar.bz2
gsoc2013-evolution-fd94ba8cde63d761fc84a3724874529caa266f09.tar.lz
gsoc2013-evolution-fd94ba8cde63d761fc84a3724874529caa266f09.tar.xz
gsoc2013-evolution-fd94ba8cde63d761fc84a3724874529caa266f09.tar.zst
gsoc2013-evolution-fd94ba8cde63d761fc84a3724874529caa266f09.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')
-rw-r--r--plugins/caldav/ChangeLog8
-rw-r--r--plugins/caldav/caldav-source.c14
2 files changed, 21 insertions, 1 deletions
diff --git a/plugins/caldav/ChangeLog b/plugins/caldav/ChangeLog
index 5f28deb6b3..9a9bae7398 100644
--- a/plugins/caldav/ChangeLog
+++ b/plugins/caldav/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-28 Milan Crha <mcrha@redhat.com>
+
+ ** 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.
+
2009-04-24 Milan Crha <mcrha@redhat.com>
** Part of fix for bug #569652
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);