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:
Patrick Ohly 2011-11-17 09:05:43 +01:00
parent 67668d585b
commit be6e640286
2 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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);