diff options
Diffstat (limited to 'kresources/caldav/preferences.cpp')
-rw-r--r-- | kresources/caldav/preferences.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/kresources/caldav/preferences.cpp b/kresources/caldav/preferences.cpp index d70a35193..6eb87e450 100644 --- a/kresources/caldav/preferences.cpp +++ b/kresources/caldav/preferences.cpp @@ -234,7 +234,7 @@ TQString CalDavPrefs::getFullUrl() { TQString CalDavPrefs::getFullTasksUrl() { if (useSTasks() == 0) - return TQString(); + return getFullUrl(); TQUrl t(tasksUrl()); TQString safeURL; @@ -259,5 +259,32 @@ TQString CalDavPrefs::getFullTasksUrl() { return safeURL; } +TQString CalDavPrefs::getFullJournalsUrl() { + if (useSJournals() == 0) + return getFullUrl(); + + TQUrl t(journalsUrl()); + 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 ======================================================================== |