Commit 82e2af04 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Return IntervalChecker by reference

parent 1a8407a3
......@@ -220,10 +220,7 @@ bool AkonadiServer::init()
mPreprocessorManager->setEnabled(false);
}
if (settings.value(QStringLiteral("Cache/EnableCleaner"), true).toBool()) {
mCacheCleaner = std::make_unique<CacheCleaner>();
}
mCacheCleaner = std::make_unique<CacheCleaner>();
mIntervalCheck = std::make_unique<IntervalCheck>(*this);
mStorageJanitor = std::make_unique<StorageJanitor>(*this);
mItemRetrieval = std::make_unique<ItemRetrievalManager>();
......@@ -407,9 +404,9 @@ CacheCleaner *AkonadiServer::cacheCleaner()
return mCacheCleaner.get();
}
IntervalCheck *AkonadiServer::intervalChecker()
IntervalCheck &AkonadiServer::intervalChecker()
{
return mIntervalCheck.get();
return *mIntervalCheck.get();
}
ResourceManager &AkonadiServer::resourceManager()
......
......@@ -64,7 +64,7 @@ public:
/**
* Returns the IntervalCheck instance. Never nullptr.
*/
IntervalCheck *intervalChecker();
IntervalCheck &intervalChecker();
ResourceManager &resourceManager();
......
......@@ -726,7 +726,7 @@ void ItemFetchHelper::triggerOnDemandFetch()
return;
}
mConnection->akonadi().intervalChecker()->requestCollectionSync(collection);
mConnection->akonadi().intervalChecker().requestCollectionSync(collection);
}
QVector<Protocol::Ancestor> ItemFetchHelper::ancestorsForItem(Collection::Id parentColId)
......
......@@ -140,7 +140,7 @@ void NotificationCollector::collectionAdded(const Collection &collection,
if (auto cleaner = mAkonadi.cacheCleaner()) {
cleaner->collectionAdded(collection.id());
}
mAkonadi.intervalChecker()->collectionAdded(collection.id());
mAkonadi.intervalChecker().collectionAdded(collection.id());
collectionNotification(Protocol::CollectionChangeNotification::Add, collection, collection.parentId(), -1, resource);
}
......@@ -151,7 +151,7 @@ void NotificationCollector::collectionChanged(const Collection &collection,
if (auto cleaner = mAkonadi.cacheCleaner()) {
cleaner->collectionChanged(collection.id());
}
mAkonadi.intervalChecker()->collectionChanged(collection.id());
mAkonadi.intervalChecker().collectionChanged(collection.id());
if (changes.contains(AKONADI_PARAM_ENABLED)) {
mAkonadi.collectionStatistics().invalidateCollection(collection);
}
......@@ -167,7 +167,7 @@ void NotificationCollector::collectionMoved(const Collection &collection,
if (auto cleaner = mAkonadi.cacheCleaner()) {
cleaner->collectionChanged(collection.id());
}
mAkonadi.intervalChecker()->collectionChanged(collection.id());
mAkonadi.intervalChecker().collectionChanged(collection.id());
collectionNotification(Protocol::CollectionChangeNotification::Move, collection, source.id(), collection.parentId(), resource, QSet<QByteArray>(), destResource);
}
......@@ -177,7 +177,7 @@ void NotificationCollector::collectionRemoved(const Collection &collection,
if (auto cleaner = mAkonadi.cacheCleaner()) {
cleaner->collectionRemoved(collection.id());
}
mAkonadi.intervalChecker()->collectionRemoved(collection.id());
mAkonadi.intervalChecker().collectionRemoved(collection.id());
mAkonadi.collectionStatistics().invalidateCollection(collection);
collectionNotification(Protocol::CollectionChangeNotification::Remove, collection, collection.parentId(), -1, resource);
}
......@@ -188,9 +188,7 @@ void NotificationCollector::collectionSubscribed(const Collection &collection,
if (auto cleaner = mAkonadi.cacheCleaner()) {
cleaner->collectionAdded(collection.id());
}
if (auto checker = mAkonadi.intervalChecker()) {
checker->collectionAdded(collection.id());
}
mAkonadi.intervalChecker().collectionAdded(collection.id());
collectionNotification(Protocol::CollectionChangeNotification::Subscribe, collection, collection.parentId(), -1, resource, QSet<QByteArray>());
}
......@@ -200,7 +198,7 @@ void NotificationCollector::collectionUnsubscribed(const Collection &collection,
if (auto cleaner = mAkonadi.cacheCleaner()) {
cleaner->collectionRemoved(collection.id());
}
mAkonadi.intervalChecker()->collectionRemoved(collection.id());
mAkonadi.intervalChecker().collectionRemoved(collection.id());
mAkonadi.collectionStatistics().invalidateCollection(collection);
collectionNotification(Protocol::CollectionChangeNotification::Unsubscribe, collection, collection.parentId(), -1, resource, QSet<QByteArray>());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment