ActiveSync: implemented TestingSyncSource::deleteAll()
The default implementation removes one VEVENT after the other, which is slow for large merged events. Directly removing the entire event series is faster.
This commit is contained in:
parent
67668d585b
commit
be6e640286
|
@ -639,6 +639,14 @@ void ActiveSyncCalendarSource::deleteItem(const string &luid)
|
|||
}
|
||||
}
|
||||
|
||||
void ActiveSyncCalendarSource::removeAllItems()
|
||||
{
|
||||
BOOST_FOREACH(const EventCache::value_type &entry, m_cache) {
|
||||
ActiveSyncSource::deleteItem(entry.first);
|
||||
}
|
||||
m_cache.clear();
|
||||
}
|
||||
|
||||
std::string ActiveSyncCalendarSource::createLUID(const std::string &uid, const std::string &subid)
|
||||
{
|
||||
std::string luid = m_escape.escape(uid);
|
||||
|
|
|
@ -69,6 +69,9 @@ class ActiveSyncCalendarSource : public ActiveSyncCalFormatSource
|
|||
/** split luid into uid (first) and rid (second) */
|
||||
static StringPair splitLUID(const std::string &luid);
|
||||
|
||||
// more efficient implementation than in TestingSyncSource
|
||||
virtual void removeAllItems();
|
||||
|
||||
private:
|
||||
/** compose luid from mainid and subid */
|
||||
static std::string createLUID(const std::string &uid, const std::string &rid);
|
||||
|
|
Loading…
Reference in New Issue