Commit 93656cf3 authored by Laurent Montel's avatar Laurent Montel 😁

Fix expire trash

parent 5f58c6f2
Pipeline #29564 failed with stage
in 102 minutes and 8 seconds
......@@ -42,21 +42,29 @@ ExpireAccountTrashFolderConfigWidget::~ExpireAccountTrashFolderConfigWidget()
}
void ExpireAccountTrashFolderConfigWidget::save()
void ExpireAccountTrashFolderConfigWidget::save(bool saveSettings, bool expireNow)
{
const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings();
const Akonadi::AgentInstance::List agents = Akonadi::AgentManager::self()->instances();
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());
if (trashCol.isValid()) {
mCollectionExpiryWidget->save(settings, trashCol, true, true);
mCollectionExpiryWidget->save(settings, trashCol, saveSettings, expireNow);
}
}
}
void ExpireAccountTrashFolderConfigWidget::save()
{
save(true, false);
}
void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested()
{
qWarning() << " void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested() not implement yet";
//mCollectionExpiryWidget->save(collection, saveSettings, expireNow);
//TODO
save(true, true);
}
......@@ -34,6 +34,7 @@ public:
~ExpireAccountTrashFolderConfigWidget();
void save();
private:
void save(bool saveSettings, bool expireNow);
void slotSaveAndExpireRequested();
MailCommon::CollectionExpiryWidget *mCollectionExpiryWidget = nullptr;
};
......
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