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
ExpireAccountTrashFolderConfigDialog::~ExpireAccountTrashFolderConfigDialog()
{
mExpireAccountTrashFolderConfig->save();
writeConfig();
}
......
......@@ -19,6 +19,8 @@
#include "expireaccounttrashfolderconfigwidget.h"
#include <MailCommon/CollectionExpiryWidget>
#include <AkonadiCore/AgentManager>
#include <akonadi/kmime/specialmailcollections.h>
#include <QVBoxLayout>
ExpireAccountTrashFolderConfigWidget::ExpireAccountTrashFolderConfigWidget(QWidget *parent)
......@@ -43,12 +45,18 @@ ExpireAccountTrashFolderConfigWidget::~ExpireAccountTrashFolderConfigWidget()
void ExpireAccountTrashFolderConfigWidget::save()
{
const MailCommon::CollectionExpirySettings settings = mCollectionExpiryWidget->settings();
//mCollectionExpiryWidget->
//TODO
const Akonadi::AgentInstance::List agents = Akonadi::AgentManager::self()->instances();
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()
{
qWarning() << " void ExpireAccountTrashFolderConfigWidget::slotSaveAndExpireRequested() not implement yet";
//mCollectionExpiryWidget->save(collection, saveSettings, expireNow);
//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