aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-12 15:10:41 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-12 15:10:41 (GMT)
commit6d544f0c9091e92f47a765bf3de4ebf436d69215 (patch)
treead42952dc278a2c31d9efc23f0f9362a21085859
parent9d8179dc2167bba97613cdf60080efae253b4b8e (diff)
Use isEmpty
-rw-r--r--src/server/storagejanitor.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/storagejanitor.cpp b/src/server/storagejanitor.cpp
index ec0746c..bc36cb0 100644
--- a/src/server/storagejanitor.cpp
+++ b/src/server/storagejanitor.cpp
@@ -226,9 +226,10 @@ void StorageJanitor::findOrphanedResources()
}
//qCDebug(AKONADISERVER_LOG) << "SQL:" << qbres.query().lastQuery();
const Resource::List orphanResources = qbres.result();
- if (orphanResources.size() > 0) {
+ const int orphanResourcesSize(orphanResources.size());
+ if (orphanResourcesSize > 0) {
QStringList resourceNames;
- resourceNames.reserve(orphanResources.size());
+ resourceNames.reserve(orphanResourcesSize);
Q_FOREACH (const Resource &resource, orphanResources) {
resourceNames.append(resource.name());
}
@@ -289,7 +290,7 @@ void StorageJanitor::findOrphanedItems()
return;
}
const PimItem::List orphans = qb.result();
- if (orphans.size() > 0) {
+ if (!orphans.isEmpty()) {
inform(QLatin1Literal("Found ") + QString::number(orphans.size()) + QLatin1Literal(" orphan items."));
// Attach to lost+found collection
Transaction transaction(DataStore::self());
@@ -325,7 +326,7 @@ void StorageJanitor::findOrphanedParts()
return;
}
const Part::List orphans = qb.result();
- if (orphans.size() > 0) {
+ if (!orphans.isEmpty()) {
inform(QLatin1Literal("Found ") + QString::number(orphans.size()) + QLatin1Literal(" orphan parts."));
// TODO: create lost+found items for those? delete?
}