File indexing completed on 2024-11-10 04:40:19
0001 /* 0002 SPDX-FileCopyrightText: 2019 David Faure <faure@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "fakeintervalcheck.h" 0008 0009 using namespace Akonadi::Server; 0010 0011 FakeIntervalCheck::FakeIntervalCheck(ItemRetrievalManager &retrievalManager) 0012 : IntervalCheck(retrievalManager) 0013 { 0014 } 0015 0016 void FakeIntervalCheck::waitForInit() 0017 { 0018 m_initCalled.acquire(); 0019 } 0020 0021 void FakeIntervalCheck::init() 0022 { 0023 IntervalCheck::init(); 0024 m_initCalled.release(); 0025 } 0026 0027 bool FakeIntervalCheck::shouldScheduleCollection(const Collection &collection) 0028 { 0029 return (collection.syncPref() == Collection::True) || ((collection.syncPref() == Collection::Undefined) && collection.enabled()); 0030 } 0031 0032 bool FakeIntervalCheck::hasChanged(const Collection &collection, const Collection &changed) 0033 { 0034 Q_ASSERT(collection.id() == changed.id()); 0035 return collection.cachePolicyCheckInterval() != changed.cachePolicyCheckInterval(); 0036 } 0037 0038 int FakeIntervalCheck::collectionScheduleInterval(const Collection &collection) 0039 { 0040 return collection.cachePolicyCheckInterval(); 0041 } 0042 0043 void FakeIntervalCheck::collectionExpired(const Collection &collection) 0044 { 0045 Q_UNUSED(collection) 0046 // Nothing here. The granularity is in whole minutes, we don't have time to wait for that in a unittest. 0047 } 0048 0049 #include "moc_fakeintervalcheck.cpp"