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

Allow to expire trash

parent e9a5da7f
Pipeline #29518 failed with stage
in 60 minutes and 1 second
...@@ -51,6 +51,7 @@ ExpireAccountTrashFolderConfigDialog::ExpireAccountTrashFolderConfigDialog(QWidg ...@@ -51,6 +51,7 @@ ExpireAccountTrashFolderConfigDialog::ExpireAccountTrashFolderConfigDialog(QWidg
ExpireAccountTrashFolderConfigDialog::~ExpireAccountTrashFolderConfigDialog() ExpireAccountTrashFolderConfigDialog::~ExpireAccountTrashFolderConfigDialog()
{ {
mExpireAccountTrashFolderConfig->save();
writeConfig(); writeConfig();
} }
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "expireaccounttrashfolderconfigwidget.h" #include "expireaccounttrashfolderconfigwidget.h"
#include <MailCommon/CollectionExpiryWidget> #include <MailCommon/CollectionExpiryWidget>
#include <AkonadiCore/AgentManager>
#include <akonadi/kmime/specialmailcollections.h>
#include <QVBoxLayout> #include <QVBoxLayout>
ExpireAccountTrashFolderConfigWidget::ExpireAccountTrashFolderConfigWidget(QWidget *parent) ExpireAccountTrashFolderConfigWidget::ExpireAccountTrashFolderConfigWidget(QWidget *parent)
...@@ -43,12 +45,18 @@ ExpireAccountTrashFolderConfigWidget::~ExpireAccountTrashFolderConfigWidget() ...@@ -43,12 +45,18 @@ ExpireAccountTrashFolderConfigWidget::~ExpireAccountTrashFolderConfigWidget()
void ExpireAccountTrashFolderConfigWidget::save() void ExpireAccountTrashFolderConfigWidget::save()
{ {
const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings(); const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings();
//mCollectionExpiryWidget-> const Akonadi::AgentInstance::List agents = Akonadi::AgentManager::self()->instances();
//TODO for (const Akonadi::AgentInstance &agent : agents) {
Akonadi::Collection trashCol = Akonadi::SpecialMailCollections::self()->collection(Akonadi::SpecialMailCollections::Trash, agent);
if (trashCol.isValid()) {
mCollectionExpiryWidget->save(settings, trashCol, true, true);
}
}
} }
void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested() void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested()
{ {
qWarning() << " void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested() not implement yet";
//mCollectionExpiryWidget->save(collection, saveSettings, expireNow); //mCollectionExpiryWidget->save(collection, saveSettings, expireNow);
//TODO //TODO
} }
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