[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepimlibs/akonadi/kmime
From: Andras Mantia <amantia () kde ! org>
Date: 2010-09-15 11:56:25
Message-ID: 20100915115625.81A7FAC888 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1175594 by amantia:
Add a standard Empty All Trash command to be used by mobile & desktop kmail.
M +1 -0 CMakeLists.txt
A emptytrashcommand.cpp [License: LGPL (v2.1+)]
A emptytrashcommand_p.h [License: LGPL (v2.1+)]
M +0 -1 movetotrashcommand.cpp
M +19 -1 standardmailactionmanager.cpp
M +2 -0 standardmailactionmanager.h
M +1 -0 util_p.h
--- trunk/KDE/kdepimlibs/akonadi/kmime/CMakeLists.txt #1175593:1175594
@@ -49,6 +49,7 @@
commandbase.cpp
util.cpp
+ emptytrashcommand.cpp
markascommand.cpp
movecommand.cpp
movetotrashcommand.cpp
--- trunk/KDE/kdepimlibs/akonadi/kmime/movetotrashcommand.cpp #1175593:1175594
@@ -28,7 +28,6 @@
#include <akonadi/kmime/specialmailcollections.h>
#include <akonadi/entitytreemodel.h>
-#define IMAP_RESOURCE_IDENTIFIER QString::fromLatin1("akonadi_imap_resource")
MoveToTrashCommand::MoveToTrashCommand(QAbstractItemModel* model, const \
Akonadi::Collection& sourceFolder, QObject* parent): CommandBase( parent ) {
the_trashCollectionFolder = -1;
--- trunk/KDE/kdepimlibs/akonadi/kmime/standardmailactionmanager.cpp #1175593:1175594
@@ -24,6 +24,8 @@
#include "standardmailactionmanager.h"
#include "movetotrashcommand_p.h"
#include "markascommand_p.h"
+#include "emptytrashcommand_p.h"
+#include "removeduplicatescommand_p.h"
#include <akonadi/subscriptiondialog_p.h>
#include <akonadi/agentfilterproxymodel.h>
@@ -43,7 +45,6 @@
#include <QtCore/QPointer>
#include <QtGui/QItemSelectionModel>
-#include "removeduplicatescommand_p.h"
using namespace Akonadi;
@@ -320,6 +321,15 @@
command->execute();
}
+ void slotEmptyAllTrash()
+ {
+ if ( mInterceptedActions.contains( StandardMailActionManager::EmptyAllTrash ) \
) + return;
+
+ EmptyTrashCommand *command = new EmptyTrashCommand( \
const_cast<QAbstractItemModel*>( mCollectionSelectionModel->model() ), mParent ); + \
command->execute(); + }
+
void slotMailLocalSubscription()
{
#ifndef Q_OS_WINCE
@@ -482,6 +492,13 @@
d->mActionCollection->addAction( QString::fromLatin1( \
"akonadi_remove_duplicates" ), action );
connect( action, SIGNAL( triggered( bool ) ), this, SLOT( \
slotRemoveDuplicates()) ); break;
+ case EmptyAllTrash:
+ action = new KAction( d->mParentWidget );
+ action->setText( i18n( "Empty All &Trash Folders" ) );
+ d->mActions.insert( EmptyAllTrash, action );
+ d->mActionCollection->addAction( QString::fromLatin1( \
"akonadi_empty_all_trash" ), action ); + connect( action, SIGNAL( triggered( \
bool ) ), this, SLOT( slotEmptyAllTrash() ) ); + break;
default:
Q_ASSERT( false ); // should never happen
break;
@@ -508,6 +525,7 @@
createAction( MoveToTrash );
createAction( MoveAllToTrash );
createAction( RemoveDuplicates );
+ createAction( EmptyAllTrash );
d->mGenericManager->createAllActions();
--- trunk/KDE/kdepimlibs/akonadi/kmime/standardmailactionmanager.h #1175593:1175594
@@ -64,6 +64,7 @@
MoveToTrash, ///< Move all selected \
messages and folders to trash.
MoveAllToTrash, ///< Move all messages of \
the current folder to trash.
RemoveDuplicates, ///< Removes all duplicated \
messages. + EmptyAllTrash, ///< Empties trash \
folders on all accounts
LastType ///< Marks last action.
};
@@ -203,6 +204,7 @@
Q_PRIVATE_SLOT( d, void slotMoveToTrash() )
Q_PRIVATE_SLOT( d, void slotMoveAllToTrash() )
Q_PRIVATE_SLOT( d, void slotRemoveDuplicates() )
+ Q_PRIVATE_SLOT( d, void slotEmptyAllTrash() )
Q_PRIVATE_SLOT( d, void slotMailLocalSubscription() )
//@endcond
};
--- trunk/KDE/kdepimlibs/akonadi/kmime/util_p.h #1175593:1175594
@@ -24,6 +24,7 @@
class OrgKdeAkonadiImapSettingsInterface;
class KJob;
class QString;
+#define IMAP_RESOURCE_IDENTIFIER QString::fromLatin1("akonadi_imap_resource")
namespace Util
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic