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 /libkcal/resourcelocaldir.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 'libkcal/resourcelocaldir.cpp')
-rw-r--r-- | libkcal/resourcelocaldir.cpp | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/libkcal/resourcelocaldir.cpp b/libkcal/resourcelocaldir.cpp index 1d5c9caa8..f1e00f327 100644 --- a/libkcal/resourcelocaldir.cpp +++ b/libkcal/resourcelocaldir.cpp @@ -128,7 +128,7 @@ bool ResourceLocalDir::doLoad() TQString dirName = mURL.path(); if ( !( KStandardDirs::exists( dirName ) || KStandardDirs::exists( dirName + "/") ) ) { - kdDebug(5800) << "ResourceLocalDir::load(): Directory '" << dirName + kdDebug(5800) << "ResourceLocalDir::load(): Directory '" << dirName << "' doesn't exist yet. Creating it..." << endl; // Create the directory. Use 0775 to allow group-writable if the umask // allows it (permissions will be 0775 & ~umask). This is desired e.g. for @@ -139,7 +139,7 @@ bool ResourceLocalDir::doLoad() // The directory exists. Now try to open (the files in) it. kdDebug(5800) << "ResourceLocalDir::load(): '" << dirName << "'" << endl; TQFileInfo dirInfo( dirName ); - if ( !( dirInfo.isDir() && dirInfo.isReadable() && + if ( !( dirInfo.isDir() && dirInfo.isReadable() && ( dirInfo.isWritable() || readOnly() ) ) ) return false; @@ -193,6 +193,11 @@ bool ResourceLocalDir::doSave() bool ResourceLocalDir::doSave( Incidence *incidence ) { + if ( mDeletedIncidences.contains( incidence ) ) { + mDeletedIncidences.remove( incidence ); + return true; + } + mDirWatch.stopScan(); // do prohibit the dirty() signal and a following reload() TQString fileName = mURL.path() + "/" + incidence->uid(); @@ -231,28 +236,46 @@ void ResourceLocalDir::reload( const TQString &file ) bool ResourceLocalDir::deleteEvent(Event *event) { kdDebug(5800) << "ResourceLocalDir::deleteEvent" << endl; - if ( deleteIncidenceFile(event) ) - return( mCalendar.deleteEvent( event ) ); - else - return( false ); + if ( deleteIncidenceFile(event) ) { + if ( mCalendar.deleteEvent( event ) ) { + mDeletedIncidences.append( event ); + return true; + } else { + return false; + } + } else { + return false; + } } bool ResourceLocalDir::deleteTodo(Todo *todo) { - if ( deleteIncidenceFile(todo) ) - return( mCalendar.deleteTodo( todo ) ); - else - return( false ); + if ( deleteIncidenceFile(todo) ) { + if ( mCalendar.deleteTodo( todo ) ) { + mDeletedIncidences.append( todo ); + return true; + } else { + return false; + } + } else { + return false; + } } bool ResourceLocalDir::deleteJournal( Journal *journal ) { - if ( deleteIncidenceFile( journal ) ) - return( mCalendar.deleteJournal( journal ) ); - else - return( false ); + if ( deleteIncidenceFile( journal ) ) { + if ( mCalendar.deleteJournal( journal ) ) { + mDeletedIncidences.append( journal ); + return true; + } else { + return false; + } + } else { + return false; + } } |