summaryrefslogtreecommitdiffstats
path: root/kresources/caldav/preferences.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kresources/caldav/preferences.cpp')
-rw-r--r--kresources/caldav/preferences.cpp17
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 ========================================================================