Changeset View
Changeset View
Standalone View
Standalone View
autotests/server/fakecollectionscheduler.cpp
Show All 31 Lines | |||||
32 | } | 32 | } | ||
33 | 33 | | |||
34 | void FakeCollectionScheduler::init() | 34 | void FakeCollectionScheduler::init() | ||
35 | { | 35 | { | ||
36 | CollectionScheduler::init(); | 36 | CollectionScheduler::init(); | ||
37 | m_initCalled.release(); | 37 | m_initCalled.release(); | ||
38 | } | 38 | } | ||
39 | 39 | | |||
40 | bool FakeCollectionScheduler::shouldScheduleCollection(const Collection &collection) | ||||
41 | { | ||||
42 | return (collection.syncPref() == Collection::True) || ((collection.syncPref() == Collection::Undefined) && collection.enabled()); | ||||
43 | } | ||||
44 | | ||||
40 | bool FakeCollectionScheduler::hasChanged(const Collection &collection, const Collection &changed) | 45 | bool FakeCollectionScheduler::hasChanged(const Collection &collection, const Collection &changed) | ||
41 | { | 46 | { | ||
42 | Q_ASSERT(collection.id() == changed.id()); | 47 | Q_ASSERT(collection.id() == changed.id()); | ||
43 | return collection.cachePolicyCheckInterval() != changed.cachePolicyCheckInterval(); | 48 | return collection.cachePolicyCheckInterval() != changed.cachePolicyCheckInterval(); | ||
44 | } | 49 | } | ||
45 | 50 | | |||
46 | int FakeCollectionScheduler::collectionScheduleInterval(const Collection &collection) | 51 | int FakeCollectionScheduler::collectionScheduleInterval(const Collection &collection) | ||
47 | { | 52 | { | ||
48 | return collection.cachePolicyCheckInterval(); | 53 | return collection.cachePolicyCheckInterval(); | ||
49 | } | 54 | } | ||
50 | 55 | | |||
51 | void FakeCollectionScheduler::collectionExpired(const Collection &collection) | 56 | void FakeCollectionScheduler::collectionExpired(const Collection &collection) | ||
52 | { | 57 | { | ||
53 | Q_UNUSED(collection); | 58 | Q_UNUSED(collection); | ||
54 | // Nothing here. The granularity is in whole minutes, we don't have time to wait for that in a unittest. | 59 | // Nothing here. The granularity is in whole minutes, we don't have time to wait for that in a unittest. | ||
55 | } | 60 | } |