diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-31 07:49:08 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-05-31 07:49:08 +0000 |
commit | 7ef3b0e2a5e5bc9bf928e989e4f66932be096824 (patch) | |
tree | d1b924b843f78b9d9de26becb36bb8e12f7fef44 /kresources/caldav/preferences.cpp | |
parent | f4a40d0495ff26b8767cf321fa8039e5ac633c12 (diff) | |
download | tdepim-7ef3b0e2a5e5bc9bf928e989e4f66932be096824.tar.gz tdepim-7ef3b0e2a5e5bc9bf928e989e4f66932be096824.zip |
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
Diffstat (limited to 'kresources/caldav/preferences.cpp')
-rw-r--r-- | kresources/caldav/preferences.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
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 ======================================================================== |