Summary: | Option delete trashcan after close doesn't have an effect | ||
---|---|---|---|
Product: | [Applications] KMail Mobile | Reporter: | Ludwig Reiter <ludwig.reiter> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Windows CE | ||
OS: | Microsoft Windows CE | ||
Latest Commit: | Version Fixed In: |
Description
Ludwig Reiter
2010-12-23 10:54:28 UTC
commit 4f43a240652fc3bfd93a212d9be059876f53cd94 branch master Author: Tobias Koenig <tokoe@kde.org> Date: Thu Dec 23 15:44:31 2010 +0100 Implement 'Empty trash on exit' functionality BUG: 261055 diff --git a/mobile/mail/mainview.cpp b/mobile/mail/mainview.cpp index 6fd855a..5a2d07c 100644 --- a/mobile/mail/mainview.cpp +++ b/mobile/mail/mainview.cpp @@ -159,6 +159,24 @@ MainView::MainView(QWidget* parent) MainView::~MainView() { delete m_grouperComparator; + + const Akonadi::Collection trashCollection = CommonKernel->trashCollectionFolder(); + if ( trashCollection.isValid() ) { + if ( Settings::self()->miscEmptyTrashAtExit() ) { + if ( trashCollection.statistics().count() > 0 ) { + qDebug( "Emptying trash..." ); + Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( trashCollection, this ); + if ( job->exec() ) { + const Akonadi::Item::List items = job->items(); + if ( !items.isEmpty() ) { + Akonadi::ItemDeleteJob *deleteJob = new Akonadi::ItemDeleteJob( items, this ); + deleteJob->exec(); + qDebug( "done" ); + } + } + } + } + } } void MainView::setConfigWidget( ConfigWidget *configWidget ) test of description version 2011-01-16 git-4d1bc61 test passed. Closed. |