summaryrefslogtreecommitdiffstats
path: root/kresources/caldav/resource.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-30 04:23:41 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-30 04:23:41 +0000
commit5572a114be163aeae75648f8e82ce692d4a77517 (patch)
tree2da72faeaf863704e8b030424cf8090e33137bcb /kresources/caldav/resource.cpp
parent66f01dde7cd5e36d9623428f70a008c9e8abe1d3 (diff)
downloadtdepim-5572a114be163aeae75648f8e82ce692d4a77517.tar.gz
tdepim-5572a114be163aeae75648f8e82ce692d4a77517.zip
Separated event and task reads into two separate jobs
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1169762 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/caldav/resource.cpp')
-rw-r--r--kresources/caldav/resource.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/kresources/caldav/resource.cpp b/kresources/caldav/resource.cpp
index f3835b180..59865f41a 100644
--- a/kresources/caldav/resource.cpp
+++ b/kresources/caldav/resource.cpp
@@ -394,9 +394,8 @@ void ResourceCalDav::loadFinished() {
loadError(TQString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString());
}
} else {
- log("successful load");
+ log("successful event load");
TQString data = loader->data();
- TQString tasksData = loader->tasksData();
if (!data.isNull() && !data.isEmpty()) {
// TODO: I don't know why, but some schedules on http://caldav-test.ioda.net/ (I used it for testing)
@@ -417,6 +416,34 @@ void ResourceCalDav::loadFinished() {
emit resourceLoaded(this);
}
}
+ }
+
+ if (loader->tasksError()) {
+ if (loader->tasksErrorNumber() == -401) {
+ if (NULL != mPrefs) {
+// TQCString newpass;
+// if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) {
+// log("load error: " + loader->tasksErrorString() );
+// loadError(TQString("[%1] ").arg(abs(loader->tasksErrorNumber())) + loader->tasksErrorString());
+// }
+// else {
+// // Set new password and try again
+// mPrefs->setPassword(TQString(newpass));
+// startLoading(mPrefs->getFullUrl(), mPrefs->getFullTasksUrl());
+// }
+ }
+ else {
+ log("load error: " + loader->tasksErrorString() );
+ loadError(TQString("[%1] ").arg(abs(loader->tasksErrorNumber())) + loader->tasksErrorString());
+ }
+ }
+ else {
+ log("load error: " + loader->tasksErrorString() );
+ loadError(TQString("[%1] ").arg(abs(loader->tasksErrorNumber())) + loader->tasksErrorString());
+ }
+ } else {
+ log("successful tasks load");
+ TQString tasksData = loader->tasksData();
if (!tasksData.isNull() && !tasksData.isEmpty()) {
// TODO: I don't know why, but some schedules on http://caldav-test.ioda.net/ (I used it for testing)