From 7ef3b0e2a5e5bc9bf928e989e4f66932be096824 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 31 May 2010 07:49:08 +0000 Subject: Added new carddav resource for kaddressbook Lots of bugfixes for korganizer caldav resource git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1132701 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kresources/caldav/preferences.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'kresources/caldav/preferences.cpp') diff --git a/kresources/caldav/preferences.cpp b/kresources/caldav/preferences.cpp index 04ca22389..4be55e509 100644 --- a/kresources/caldav/preferences.cpp +++ b/kresources/caldav/preferences.cpp @@ -210,11 +210,26 @@ void CalDavPrefs::readConfig() { QString CalDavPrefs::getFullUrl() { QUrl t(url()); + QString safeURL; + int firstAt; t.setUser(username()); t.setPassword(password()); - return t.toString(); + safeURL = t.toString(); + + firstAt = safeURL.find("@") + 1; + while (safeURL.find("@", firstAt) != -1) { + safeURL.replace(safeURL.find("@", firstAt), 1, "%40"); + } + + // Unencode the username, as Zimbra stupidly rejects the %40 + safeURL.replace("%40", "@"); + + // Encode any spaces, as libcaldav stupidly fails otherwise + safeURL.replace(" ", "%20"); + + return safeURL; } // EOF ======================================================================== -- cgit v1.2.1