diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /kresources/lib/kcal_resourcegroupwarebase.cpp | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/lib/kcal_resourcegroupwarebase.cpp')
-rw-r--r-- | kresources/lib/kcal_resourcegroupwarebase.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/kresources/lib/kcal_resourcegroupwarebase.cpp b/kresources/lib/kcal_resourcegroupwarebase.cpp index 7499b224d..823943c2b 100644 --- a/kresources/lib/kcal_resourcegroupwarebase.cpp +++ b/kresources/lib/kcal_resourcegroupwarebase.cpp @@ -39,13 +39,13 @@ using namespace KCal; ResourceGroupwareBase::ResourceGroupwareBase() - : ResourceCached( 0 ), mPrefs(0), mFolderLister(0), + : ResourceCached( 0 ), mPrefs(0), mFolderLister(0), mLock( true ), mAdaptor(0), mDownloadJob(0), mUploadJob(0) { } ResourceGroupwareBase::ResourceGroupwareBase( const KConfig *config ) - : ResourceCached( config ), mPrefs(0), mFolderLister(0), + : ResourceCached( config ), mPrefs(0), mFolderLister(0), mLock( true ), mAdaptor(0), mDownloadJob(0), mUploadJob(0) { if ( config ) readConfig( config ); @@ -69,7 +69,7 @@ bool ResourceGroupwareBase::addEvent( Event *event ) { if ( adaptor() && ( adaptor()->supports( KPIM::FolderLister::Event ) || adaptor()->supports( KPIM::FolderLister::All ) ) ) { - return ResourceCached::addEvent( event ); + return ResourceCached::addEvent( event, TQString() ); } else return false; } @@ -77,7 +77,7 @@ bool ResourceGroupwareBase::addTodo( Todo *todo ) { if ( adaptor() && ( adaptor()->supports( KPIM::FolderLister::Todo ) || adaptor()->supports( KPIM::FolderLister::All ) ) ) { - return ResourceCached::addTodo( todo ); + return ResourceCached::addTodo( todo, TQString() ); } else return false; } @@ -85,30 +85,30 @@ bool ResourceGroupwareBase::addJournal( Journal *journal ) { if ( adaptor() && ( adaptor()->supports( KPIM::FolderLister::Journal ) || adaptor()->supports( KPIM::FolderLister::All ) ) ) { - return ResourceCached::addJournal( journal ); + return ResourceCached::addJournal( journal, TQString() ); } else return false; } -KPIM::GroupwareDownloadJob *ResourceGroupwareBase::createDownloadJob( +KPIM::GroupwareDownloadJob *ResourceGroupwareBase::createDownloadJob( CalendarAdaptor *adaptor ) { return new KPIM::GroupwareDownloadJob( adaptor ); } -KPIM::GroupwareUploadJob *ResourceGroupwareBase::createUploadJob( +KPIM::GroupwareUploadJob *ResourceGroupwareBase::createUploadJob( CalendarAdaptor *adaptor ) { return new KPIM::GroupwareUploadJob( adaptor ); } -void ResourceGroupwareBase::setPrefs( KPIM::GroupwarePrefsBase *newprefs ) +void ResourceGroupwareBase::setPrefs( KPIM::GroupwarePrefsBase *newprefs ) { if ( !newprefs ) return; if ( mPrefs ) delete mPrefs; mPrefs = newprefs; mPrefs->addGroupPrefix( identifier() ); - + mPrefs->readConfig(); if ( mFolderLister ) mFolderLister->readConfig( mPrefs ); } @@ -236,7 +236,7 @@ void ResourceGroupwareBase::doClose() ResourceCached::doClose(); if ( mDownloadJob ) mDownloadJob->kill(); - if ( adaptor() && + if ( adaptor() && adaptor()->flags() & KPIM::GroupwareDataAdaptor::GWResNeedsLogoff ) { KIO::Job *logoffJob = adaptor()->createLogoffJob( prefs()->url(), prefs()->user(), prefs()->password() ); connect( logoffJob, TQT_SIGNAL( result( KIO::Job * ) ), @@ -267,7 +267,7 @@ bool ResourceGroupwareBase::doLoad() kdWarning() << "Download still in progress" << endl; return false; } - + mCalendar.close(); clearChanges(); disableChangeNotification(); @@ -292,7 +292,7 @@ void ResourceGroupwareBase::slotDownloadJobResult( KPIM::GroupwareJob *job ) mIsShowingError = false; } else { kdDebug(5800) << "Successfully downloaded data" << endl; - + clearChanges(); saveCache(); enableChangeNotification(); @@ -318,9 +318,9 @@ bool ResourceGroupwareBase::doSave() // to upload only certain changes and discard the rest. This is // particularly important for resources like the blogging resource, // where uploading would mean a republication of the blog, not only - // a modifications. + // a modifications. if ( !confirmSave() ) return false; - + mUploadJob = createUploadJob( adaptor() ); connect( mUploadJob, TQT_SIGNAL( result( KPIM::GroupwareJob * ) ), TQT_SLOT( slotUploadJobResult( KPIM::GroupwareJob * ) ) ); @@ -331,20 +331,20 @@ bool ResourceGroupwareBase::doSave() inc = addedIncidences(); for( it = inc.begin(); it != inc.end(); ++it ) { - addedItems.append( adaptor()->newUploadItem( *it, + addedItems.append( adaptor()->newUploadItem( *it, KPIM::GroupwareUploadItem::Added ) ); } // TODO: Check if the item has changed on the server... - // In particular, check if the version we based our change on is still current + // In particular, check if the version we based our change on is still current // on the server inc = changedIncidences(); for( it = inc.begin(); it != inc.end(); ++it ) { - changedItems.append( adaptor()->newUploadItem( *it, + changedItems.append( adaptor()->newUploadItem( *it, KPIM::GroupwareUploadItem::Changed ) ); } inc = deletedIncidences(); for( it = inc.begin(); it != inc.end(); ++it ) { - deletedItems.append( adaptor()->newUploadItem( *it, + deletedItems.append( adaptor()->newUploadItem( *it, KPIM::GroupwareUploadItem::Deleted ) ); } @@ -368,10 +368,10 @@ void ResourceGroupwareBase::slotUploadJobResult( KPIM::GroupwareJob *job ) mIsShowingError = false; } else { kdDebug(5800) << "Successfully uploaded data" << endl; - /* + /* * After the put the server might have expanded recurring events and will * also change the uids of the uploaded events. Remove them from the cache - * and get the fresh delta and download. + * and get the fresh delta and download. */ if ( !mDownloadJob ) { |