summaryrefslogtreecommitdiffstats
path: root/kresources/caldav/preferences.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-28 01:04:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-28 01:04:18 +0000
commit75502cb30b6b56c4ab65ef7f3e315c3298408937 (patch)
treeac69c6b9094c7c03bde546308c4f43459c34ee21 /kresources/caldav/preferences.cpp
parentcfa6b4114cea52b167caaaeb417f98f83edd690f (diff)
downloadtdepim-75502cb30b6b56c4ab65ef7f3e315c3298408937.tar.gz
tdepim-75502cb30b6b56c4ab65ef7f3e315c3298408937.zip
Added tasks support to CalDAV resource
This nearly completes Zimbra integration git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1168963 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/caldav/preferences.cpp')
-rw-r--r--kresources/caldav/preferences.cpp27
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 ========================================================================