Commit f3029493 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent ccbca148
Pipeline #29201 failed with stage
in 38 minutes and 41 seconds
......@@ -73,6 +73,7 @@ MboxResource::MboxResource(const QString &id)
setSupportedMimetypes(mimeTypes, QStringLiteral("message-rfc822"));
// Register the list of deleted items as an attribute of the collection.
AttributeFactory::registerAttribute<DeletedItemsAttribute>();
setName(mSettings->displayName());
}
MboxResource::~MboxResource()
......@@ -103,8 +104,7 @@ void MboxResource::retrieveItems(const Akonadi::Collection &col)
reloadFile();
KMBox::MBoxEntry::List entryList;
if (col.hasAttribute<DeletedItemsAttribute>()) {
const DeletedItemsAttribute *attr = col.attribute<DeletedItemsAttribute>();
if (const DeletedItemsAttribute *attr = col.attribute<DeletedItemsAttribute>()) {
entryList = mMBox->entries(attr->deletedItemEntries());
} else { // No deleted items (yet)
entryList = mMBox->entries();
......@@ -113,8 +113,8 @@ void MboxResource::retrieveItems(const Akonadi::Collection &col)
// readEntryHeaders() call.
Item::List items;
QString colId = QString::number(col.id());
QString colRid = col.remoteId();
const QString colId = QString::number(col.id());
const QString colRid = col.remoteId();
double count = 1;
const int entryListSize(entryList.size());
items.reserve(entryListSize);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment