Changeset View
Changeset View
Standalone View
Standalone View
src/server/collectionscheduler.cpp
Show First 20 Lines • Show All 296 Lines • ▼ Show 20 Line(s) | 294 | { | |||
---|---|---|---|---|---|
297 | mScheduler = new PauseableTimer(); | 297 | mScheduler = new PauseableTimer(); | ||
298 | mScheduler->setSingleShot(true); | 298 | mScheduler->setSingleShot(true); | ||
299 | connect(mScheduler, &QTimer::timeout, | 299 | connect(mScheduler, &QTimer::timeout, | ||
300 | this, &CollectionScheduler::schedulerTimeout); | 300 | this, &CollectionScheduler::schedulerTimeout); | ||
301 | 301 | | |||
302 | // Only retrieve enabled collections and referenced collections, we don't care | 302 | // Only retrieve enabled collections and referenced collections, we don't care | ||
303 | // about anything else | 303 | // about anything else | ||
304 | SelectQueryBuilder<Collection> qb; | 304 | SelectQueryBuilder<Collection> qb; | ||
305 | Query::Condition orCondition(Query::Or); | | |||
306 | orCondition.addValueCondition(Collection::syncPrefFullColumnName(), Query::Equals, (int)Akonadi::Tristate::True); | | |||
307 | Query::Condition andCondition(Query::And); | | |||
308 | andCondition.addValueCondition(Collection::syncPrefFullColumnName(), Query::Equals, (int)Akonadi::Tristate::Undefined); | | |||
309 | andCondition.addValueCondition(Collection::enabledFullColumnName(), Query::Equals, true); | | |||
310 | orCondition.addCondition(andCondition); | | |||
311 | qb.addCondition(orCondition); | | |||
312 | if (!qb.exec()) { | 305 | if (!qb.exec()) { | ||
313 | qCWarning(AKONADISERVER_LOG) << "Failed to query initial collections for scheduler!"; | 306 | qCWarning(AKONADISERVER_LOG) << "Failed to query initial collections for scheduler!"; | ||
314 | qCWarning(AKONADISERVER_LOG) << "Not a fatal error, no collections will be scheduled for sync or cache expiration!"; | 307 | qCWarning(AKONADISERVER_LOG) << "Not a fatal error, no collections will be scheduled for sync or cache expiration!"; | ||
315 | } | 308 | } | ||
316 | 309 | | |||
317 | const Collection::List collections = qb.result(); | 310 | const Collection::List collections = qb.result(); | ||
318 | for (const Collection &collection : collections) { | 311 | for (const Collection &collection : collections) { | ||
319 | scheduleCollection(collection); | 312 | scheduleCollection(collection); | ||
Show All 27 Lines |