Changeset View
Changeset View
Standalone View
Standalone View
src/server/storage/notificationcollector.cpp
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Line(s) | 148 | void NotificationCollector::collectionChanged(const Collection &collection, | |||
---|---|---|---|---|---|
150 | const QByteArray &resource) | 150 | const QByteArray &resource) | ||
151 | { | 151 | { | ||
152 | if (auto cleaner = AkonadiServer::instance()->cacheCleaner()) { | 152 | if (auto cleaner = AkonadiServer::instance()->cacheCleaner()) { | ||
153 | cleaner->collectionChanged(collection.id()); | 153 | cleaner->collectionChanged(collection.id()); | ||
154 | } | 154 | } | ||
155 | if (auto checker = AkonadiServer::instance()->intervalChecker()) { | 155 | if (auto checker = AkonadiServer::instance()->intervalChecker()) { | ||
156 | checker->collectionChanged(collection.id()); | 156 | checker->collectionChanged(collection.id()); | ||
157 | } | 157 | } | ||
158 | if (changes.contains(AKONADI_PARAM_ENABLED) || changes.contains(AKONADI_PARAM_REFERENCED)) { | 158 | if (changes.contains(AKONADI_PARAM_ENABLED)) { | ||
159 | CollectionStatistics::self()->invalidateCollection(collection); | 159 | CollectionStatistics::self()->invalidateCollection(collection); | ||
160 | } | 160 | } | ||
161 | collectionNotification(Protocol::CollectionChangeNotification::Modify, collection, collection.parentId(), | 161 | collectionNotification(Protocol::CollectionChangeNotification::Modify, collection, collection.parentId(), | ||
162 | -1, resource, changes | toQSet); | 162 | -1, resource, changes | toQSet); | ||
163 | } | 163 | } | ||
164 | 164 | | |||
165 | void NotificationCollector::collectionMoved(const Collection &collection, | 165 | void NotificationCollector::collectionMoved(const Collection &collection, | ||
166 | const Collection &source, | 166 | const Collection &source, | ||
▲ Show 20 Lines • Show All 235 Lines • ▼ Show 20 Line(s) | 399 | if (auto mgr = AkonadiServer::instance()->notificationManager()) { | |||
402 | if (!fetchScope->fetchIdOnly() && msgCollection.name().isEmpty()) { | 402 | if (!fetchScope->fetchIdOnly() && msgCollection.name().isEmpty()) { | ||
403 | const auto col = Collection::retrieveById(msgCollection.id()); | 403 | const auto col = Collection::retrieveById(msgCollection.id()); | ||
404 | const auto mts = col.mimeTypes(); | 404 | const auto mts = col.mimeTypes(); | ||
405 | QStringList mimeTypes; | 405 | QStringList mimeTypes; | ||
406 | mimeTypes.reserve(mts.size()); | 406 | mimeTypes.reserve(mts.size()); | ||
407 | for (const auto &mt : mts) { | 407 | for (const auto &mt : mts) { | ||
408 | mimeTypes.push_back(mt.name()); | 408 | mimeTypes.push_back(mt.name()); | ||
409 | } | 409 | } | ||
410 | msgCollection = HandlerHelper::fetchCollectionsResponse(col, {}, false, 0, {}, {}, false, mimeTypes); | 410 | msgCollection = HandlerHelper::fetchCollectionsResponse(col, {}, false, 0, {}, {}, mimeTypes); | ||
411 | } | 411 | } | ||
412 | // Get up-to-date statistics | 412 | // Get up-to-date statistics | ||
413 | if (fetchScope->fetchStatistics()) { | 413 | if (fetchScope->fetchStatistics()) { | ||
414 | Collection col; | 414 | Collection col; | ||
415 | col.setId(msgCollection.id()); | 415 | col.setId(msgCollection.id()); | ||
416 | const auto stats = CollectionStatistics::self()->statistics(col); | 416 | const auto stats = CollectionStatistics::self()->statistics(col); | ||
417 | msgCollection.setStatistics(Protocol::FetchCollectionStatsResponse(stats.count, stats.count - stats.read, stats.size)); | 417 | msgCollection.setStatistics(Protocol::FetchCollectionStatsResponse(stats.count, stats.count - stats.read, stats.size)); | ||
418 | } | 418 | } | ||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |