Changeset View
Changeset View
Standalone View
Standalone View
src/server/storagejanitor.cpp
Show First 20 Lines • Show All 303 Lines • ▼ Show 20 Line(s) | 303 | if (!orphans.isEmpty()) { | |||
---|---|---|---|---|---|
304 | inform(QLatin1Literal("Found ") + QString::number(orphans.size()) + QLatin1Literal(" orphan items.")); | 304 | inform(QLatin1Literal("Found ") + QString::number(orphans.size()) + QLatin1Literal(" orphan items.")); | ||
305 | // Attach to lost+found collection | 305 | // Attach to lost+found collection | ||
306 | Transaction transaction(DataStore::self(), QStringLiteral("JANITOR ORPHANS")); | 306 | Transaction transaction(DataStore::self(), QStringLiteral("JANITOR ORPHANS")); | ||
307 | QueryBuilder qb(PimItem::tableName(), QueryBuilder::Update); | 307 | QueryBuilder qb(PimItem::tableName(), QueryBuilder::Update); | ||
308 | qint64 col = lostAndFoundCollection(); | 308 | qint64 col = lostAndFoundCollection(); | ||
309 | if (col == -1) { | 309 | if (col == -1) { | ||
310 | return; | 310 | return; | ||
311 | } | 311 | } | ||
312 | qb.setColumnValue(PimItem::collectionIdFullColumnName(), col); | 312 | qb.setColumnValue(PimItem::collectionIdColumn(), col); | ||
313 | QVector<ImapSet::Id> imapIds; | 313 | QVector<ImapSet::Id> imapIds; | ||
314 | imapIds.reserve(orphans.count()); | 314 | imapIds.reserve(orphans.count()); | ||
315 | for (const PimItem &item : qAsConst(orphans)) { | 315 | for (const PimItem &item : qAsConst(orphans)) { | ||
316 | imapIds.append(item.id()); | 316 | imapIds.append(item.id()); | ||
317 | } | 317 | } | ||
318 | ImapSet set; | 318 | ImapSet set; | ||
319 | set.add(imapIds); | 319 | set.add(imapIds); | ||
320 | QueryHelper::setToQuery(set, PimItem::idFullColumnName(), qb); | 320 | QueryHelper::setToQuery(set, PimItem::idFullColumnName(), qb); | ||
▲ Show 20 Lines • Show All 520 Lines • Show Last 20 Lines |