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

Fix store valid collection id

parent b9befc7f
Pipeline #29601 failed with stage
in 60 minutes and 26 seconds
......@@ -18,6 +18,7 @@
*/
#include "expireaccounttrashfolderconfigwidget.h"
#include "libexpireaccounttrashfolderconfig_debug.h"
#include <MailCommon/CollectionExpiryWidget>
#include <AkonadiCore/AgentManager>
#include <akonadi/kmime/specialmailcollections.h>
......@@ -49,11 +50,14 @@ void ExpireAccountTrashFolderConfigWidget::save(bool saveSettings, bool expireNo
QList<Akonadi::Collection::Id> mListCollection;
for (const Akonadi::AgentInstance &agent : agents) {
Akonadi::Collection trashCol = Akonadi::SpecialMailCollections::self()->collection(Akonadi::SpecialMailCollections::Trash, agent);
if (mListCollection.contains(trashCol.id())) {
continue;
}
mListCollection.append(trashCol.id());
const auto trashColId = trashCol.id();
//qCDebug(LIBEXPIREACCOUNTTRASHFOLDERCONFIG_PLUGIN_LOG) << "Trash collection found " << trashCol;
if (trashCol.isValid()) {
qCDebug(LIBEXPIREACCOUNTTRASHFOLDERCONFIG_PLUGIN_LOG) << "Trash collection valid found " << trashCol;
if (mListCollection.contains(trashColId)) {
continue;
}
mListCollection.append(trashColId);
mCollectionExpiryWidget->save(settings, trashCol, saveSettings, expireNow);
}
}
......
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