diff options
Diffstat (limited to 'kresources/caldav/preferences.cpp')
-rw-r--r-- | kresources/caldav/preferences.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kresources/caldav/preferences.cpp b/kresources/caldav/preferences.cpp index 8e27b9df0..d70a35193 100644 --- a/kresources/caldav/preferences.cpp +++ b/kresources/caldav/preferences.cpp @@ -232,5 +232,32 @@ TQString CalDavPrefs::getFullUrl() { return safeURL; } +TQString CalDavPrefs::getFullTasksUrl() { + if (useSTasks() == 0) + return TQString(); + + TQUrl t(tasksUrl()); + TQString safeURL; + int firstAt; + + t.setUser(username()); + t.setPassword(password()); + + 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 ======================================================================== |