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/kolab/kcal/resourcekolab.h | |
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/kolab/kcal/resourcekolab.h')
-rw-r--r-- | kresources/kolab/kcal/resourcekolab.h | 64 |
1 files changed, 55 insertions, 9 deletions
diff --git a/kresources/kolab/kcal/resourcekolab.h b/kresources/kolab/kcal/resourcekolab.h index e68c2c6bf..dda5ba32a 100644 --- a/kresources/kolab/kcal/resourcekolab.h +++ b/kresources/kolab/kcal/resourcekolab.h @@ -70,8 +70,9 @@ public: void doClose(); // The libkcal functions. See the resource for descriptions - bool addEvent( KCal::Event* anEvent ); - bool deleteEvent( KCal::Event* ); + KDE_DEPRECATED bool addEvent( KCal::Event *event ); + bool addEvent( KCal::Event *event, const TQString &subResource ); + bool deleteEvent( KCal::Event * ); KCal::Event* event( const TQString &UniqueStr ); KCal::Event::List rawEvents( EventSortField sortField = EventSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); KCal::Event::List rawEventsForDate( @@ -82,15 +83,17 @@ public: KCal::Event::List rawEvents( const TQDate& start, const TQDate& end, bool inclusive = false ); - bool addTodo( KCal::Todo* todo ); - bool deleteTodo( KCal::Todo* ); - KCal::Todo* todo( const TQString& uid ); + KDE_DEPRECATED bool addTodo( KCal::Todo * todo ); + bool addTodo( KCal::Todo *todo, const TQString &subResource ); + bool deleteTodo( KCal::Todo * ); + KCal::Todo* todo( const TQString &uid ); KCal::Todo::List rawTodos( TodoSortField sortField = TodoSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); KCal::Todo::List rawTodosForDate( const TQDate& date ); - bool addJournal( KCal::Journal* ); - bool deleteJournal( KCal::Journal* ); - KCal::Journal* journal( const TQString& uid ); + KDE_DEPRECATED bool addJournal( KCal::Journal * ); + bool addJournal( KCal::Journal *, const TQString &subResource ); + bool deleteJournal( KCal::Journal * ); + KCal::Journal* journal( const TQString &uid ); KCal::Journal::List rawJournals( JournalSortField sortField = JournalSortUnsorted, SortDirection sortDirection = SortDirectionAscending ); KCal::Journal::List rawJournalsForDate( const TQDate &date ); @@ -128,6 +131,9 @@ public: /** (De)activate the subresource */ virtual void setSubresourceActive( const TQString &, bool ); + /** Is this subresource writable? */ + bool subresourceWritable( const TQString& ) const; + /** What is the label for this subresource? */ virtual const TQString labelForSubresource( const TQString& resource ) const; @@ -140,10 +146,16 @@ public: KABC::Lock* lock(); + void beginAddingIncidences(); + + void endAddingIncidences(); + signals: void useGlobalMode(); protected slots: void slotEmitResourceChanged(); + void writeConfig(); + protected: /** * Return list of alarms which are relevant for the current user. These @@ -157,7 +169,11 @@ private: void addIncidence( const char* mimetype, const TQString& xml, const TQString& subResource, Q_UINT32 sernum ); - bool addIncidence( KCal::Incidence* i, const TQString& subresource, + + /** + Caller guarantees i is not null. + */ + bool addIncidence( KCal::Incidence *i, const TQString& subresource, Q_UINT32 sernum ); void addEvent( const TQString& xml, const TQString& subresource, @@ -215,6 +231,36 @@ private: */ TQMap<TQString, TQString> mNewIncidencesMap; int mProgressDialogIncidenceLimit; + + /** + * If a user has a subresource for viewing another user's folder then it can happen + * that addIncidence(...) adds an incidence with an already existing UID. + * + * When this happens, addIncidence(...) sets a new random UID and stores the + * original UID using incidence->setSchedulingID(uid) because KCal doesn't + * allow two incidences to have the same UID. + * + * This map keeps track of the generated UIDs (which are local) so we can delete the + * right incidence inside fromKMailDelIncidence(...) whenever we sync. + * + * The key is originalUID,subResource and the value is the fake UID. + */ + TQMap< QPair<TQString, TQString>, TQString > mOriginalUID2fakeUID; + + bool mBatchAddingInProgress; + TQMap<Kolab::ResourceType,TQString> mLastUsedResources; + + /** + Indexed by uid, it holds the last known revision of an incidence. + If we receive an update where the incidence still has the same + revision as the last known, we ignore it and don't send it to kmail, + because shortly after, IncidenceChanger will increment the revision + and that will trigger another update. + + If we didn't discard the first update, kmail would have been updated twice. + */ + TQMap<TQString,int> mLastKnownRevisions; + }; struct TemporarySilencer { |