akonadi
actionstatemanager.cpp
78 void ActionStateManager::updateState( const Collection::List &collections, const Item::List &items )
83 const bool atLeastOneCollectionSelected = ( singleCollectionSelected || multipleCollectionsSelected );
201 enableAction( StandardActionManager::CreateCollection, singleCollectionSelected && // we can create only inside one collection
214 enableAction( StandardActionManager::MoveCollectionsToTrash, atLeastOneCollectionSelected && canMoveCollections && !collectionsAreInTrash );
216 enableAction( StandardActionManager::RestoreCollectionsFromTrash, atLeastOneCollectionSelected && canMoveCollections && collectionsAreInTrash );
222 enableAction( StandardActionManager::CollectionProperties, singleCollectionSelected && // we can only configure one collection at a time
225 enableAction( StandardActionManager::SynchronizeCollections, atLeastOneCollectionCanHaveItems ); // it must be a valid folder collection
227 enableAction( StandardActionManager::SynchronizeCollectionsRecursive, atLeastOneCollectionSelected &&
230 enableAction( StandardActionManager::Paste, singleCollectionSelected && // we can paste only into a single collection
231 PasteHelper::canPaste( QApplication::clipboard()->mimeData(), collection ) ); // there must be data on the clipboard
239 enableAction( StandardActionManager::RemoveFromFavoriteCollections, canRemoveFromFavoriteCollections );
241 enableAction( StandardActionManager::RenameFavoriteCollection, singleCollectionSelected && // we can rename only one collection at a time
279 //updatePluralLabel( StandardActionManager::MoveToTrashRestoreCollectionAlternative, collectionCount );
283 enableAction( StandardActionManager::MoveToTrashRestoreCollection, atLeastOneCollectionSelected && canMoveCollections );
304 enableAction( StandardActionManager::CopyItems, atLeastOneItemSelected ); // we need items to work with
306 enableAction( StandardActionManager::CutItems, atLeastOneItemSelected && // we need items to work with
309 enableAction( StandardActionManager::DeleteItems, atLeastOneItemSelected && // we need items to work with
312 enableAction( StandardActionManager::CopyItemToMenu, atLeastOneItemSelected ); // we need items to work with
314 enableAction( StandardActionManager::MoveItemToMenu, atLeastOneItemSelected && // we need items to work with
317 enableAction( StandardActionManager::MoveItemsToTrash, atLeastOneItemSelected && canDeleteItems && !itemsAreInTrash );
319 enableAction( StandardActionManager::RestoreItemsFromTrash, atLeastOneItemSelected && itemsAreInTrash );
321 enableAction( StandardActionManager::CopyItemToDialog, atLeastOneItemSelected ); // we need items to work with
323 enableAction( StandardActionManager::MoveItemToDialog, atLeastOneItemSelected && // we need items to work with
332 enableAction( StandardActionManager::MoveToTrashRestoreItem, atLeastOneItemSelected && // we need items to work with
384 bool ActionStateManager::hasResourceCapability( const Collection &collection, const QString &capability ) const
386 const Akonadi::AgentInstance instance = AgentManager::self()->instance( collection.resource() );
393 return !( collection.contentMimeTypes() == ( QStringList() << QLatin1String( "inode/directory" ) ) ||
403 QMetaObject::invokeMethod( mReceiver, "enableAction", Qt::DirectConnection, Q_ARG( int, action ), Q_ARG( bool, state ) );
412 QMetaObject::invokeMethod( mReceiver, "updatePluralLabel", Qt::DirectConnection, Q_ARG( int, action ), Q_ARG( int, count ) );
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Fri Jan 17 2014 22:12:29 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Fri Jan 17 2014 22:12:29 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.