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() ...@@ -42,21 +42,29 @@ ExpireAccountTrashFolderConfigWidget::~ExpireAccountTrashFolderConfigWidget()
} }
void ExpireAccountTrashFolderConfigWidget::save() void ExpireAccountTrashFolderConfigWidget::save(bool saveSettings, bool expireNow)
{ {
const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings(); const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings();
const Akonadi::AgentInstance::List agents = Akonadi::AgentManager::self()->instances(); const Akonadi::AgentInstance::List agents = Akonadi::AgentManager::self()->instances();
QList<Akonadi::Collection::Id> mListCollection;
for (const Akonadi::AgentInstance &agent : agents) { for (const Akonadi::AgentInstance &agent : agents) {
Akonadi::Collection trashCol = Akonadi::SpecialMailCollections::self()->collection(Akonadi::SpecialMailCollections::Trash, agent); Akonadi::Collection trashCol = Akonadi::SpecialMailCollections::self()->collection(Akonadi::SpecialMailCollections::Trash, agent);
if (mListCollection.contains(trashCol.id())) {
continue;
}
mListCollection.append(trashCol.id());
if (trashCol.isValid()) { if (trashCol.isValid()) {
mCollectionExpiryWidget->save(settings, trashCol, true, true); mCollectionExpiryWidget->save(settings, trashCol, saveSettings, expireNow);
} }
} }
} }
void ExpireAccountTrashFolderConfigWidget::save()
{
save(true, false);
}
void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested() void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested()
{ {
qWarning() << " void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested() not implement yet"; save(true, true);
//mCollectionExpiryWidget->save(collection, saveSettings, expireNow);
//TODO
} }
...@@ -34,6 +34,7 @@ public: ...@@ -34,6 +34,7 @@ public:
~ExpireAccountTrashFolderConfigWidget(); ~ExpireAccountTrashFolderConfigWidget();
void save(); void save();
private: private:
void save(bool saveSettings, bool expireNow);
void slotSaveAndExpireRequested(); void slotSaveAndExpireRequested();
MailCommon::CollectionExpiryWidget *mCollectionExpiryWidget = nullptr; 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