Akonadi
actionstatemanager.cpp
27 if (!collection.contentMimeTypes().contains(Collection::mimeType()) && !collection.contentMimeTypes().contains(Collection::virtualMimeType())) {
41 && ((collection.contentMimeTypes().at(0) == Collection::mimeType()) || (collection.contentMimeTypes().at(0) == Collection::virtualMimeType()))) {
53void ActionStateManager::updateState(const Collection::List &collections, const Collection::List &favoriteCollections, const Item::List &items)
58 const bool atLeastOneCollectionSelected = (singleCollectionSelected || multipleCollectionsSelected);
189 enableAction(StandardActionManager::MoveCollectionsToTrash, atLeastOneCollectionSelected && canMoveCollections && !collectionsAreInTrash);
191 enableAction(StandardActionManager::RestoreCollectionsFromTrash, atLeastOneCollectionSelected && canMoveCollections && collectionsAreInTrash);
201 enableAction(StandardActionManager::SynchronizeCollections, atLeastOneCollectionCanHaveItems); // it must be a valid folder collection
208 PasteHelper::canPaste(QApplication::clipboard()->mimeData(), collection, Qt::CopyAction)); // there must be data on the clipboard
217 enableAction(StandardActionManager::RemoveFromFavoriteCollections, canRemoveFromFavoriteCollections);
219 enableAction(StandardActionManager::RenameFavoriteCollection, favoriteCollections.count() == 1); // we can rename only one collection at a time
257 // updatePluralLabel( StandardActionManager::MoveToTrashRestoreCollectionAlternative, collectionCount );
261 enableAction(StandardActionManager::MoveToTrashRestoreCollection, atLeastOneCollectionSelected && canMoveCollections);
282 enableAction(StandardActionManager::CopyItems, atLeastOneItemSelected); // we need items to work with
292 enableAction(StandardActionManager::CopyItemToMenu, atLeastOneItemSelected); // we need items to work with
298 enableAction(StandardActionManager::MoveItemsToTrash, atLeastOneItemSelected && canDeleteItems && !itemsAreInTrash);
300 enableAction(StandardActionManager::RestoreItemsFromTrash, atLeastOneItemSelected && itemsAreInTrash);
302 enableAction(StandardActionManager::CopyItemToDialog, atLeastOneItemSelected); // we need items to work with
344 return (CollectionUtils::isFolder(collection) || CollectionUtils::isResource(collection) || CollectionUtils::isStructural(collection));
359 QMetaObject::invokeMethod(mReceiver, "isFavoriteCollection", Qt::DirectConnection, Q_RETURN_ARG(bool, result), Q_ARG(Akonadi::Collection, collection));
364bool ActionStateManager::hasResourceCapability(const Collection &collection, const QString &capability) const
373 return !(collection.contentMimeTypes() == (QStringList() << QStringLiteral("inode/directory")) || CollectionUtils::isStructural(collection));
382 QMetaObject::invokeMethod(mReceiver, "enableAction", Qt::DirectConnection, Q_ARG(int, action), Q_ARG(bool, state));
391 QMetaObject::invokeMethod(mReceiver, "updatePluralLabel", Qt::DirectConnection, Q_ARG(int, action), Q_ARG(int, count));
400 QMetaObject::invokeMethod(mReceiver, "updateAlternatingAction", Qt::DirectConnection, Q_ARG(int, action));
QStringList capabilities() const
Returns the list of supported capabilities of the agent type.
bool hasAttribute(const QByteArray &name) const
Returns true if the collection has an attribute of the given type name, false otherwise.
Definition collection.cpp:161
static QString virtualMimeType()
Returns the mimetype used for virtual collections.
Definition collection.cpp:297
Collection parentCollection() const
Returns the parent collection of this object.
Definition collection.cpp:195
An Attribute that marks that an entity was marked as deleted.
Definition entitydeletedattribute.h:35
An Attribute that stores the special collection type of a collection.
Definition specialcollectionattribute.h:29
@ MoveToTrashRestoreItem
Move Item to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:159
@ RemoveFromFavoriteCollections
Remove the collection from the favorite collections model.
Definition standardactionmanager.h:134
@ CopyCollectionToDialog
Copy a collection into another collection, select the target in a dialog.
Definition standardactionmanager.h:147
@ MoveCollectionToDialog
Move a collection into another collection, select the target in a dialog.
Definition standardactionmanager.h:148
@ CopyItemToMenu
Menu allowing to quickly copy an item into a collection.
Definition standardactionmanager.h:137
@ RenameFavoriteCollection
Rename the collection of the favorite collections model.
Definition standardactionmanager.h:135
@ MoveToTrashRestoreCollection
Move Collection to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:156
@ CopyCollectionToMenu
Menu allowing to quickly copy a collection into another collection.
Definition standardactionmanager.h:136
@ AddToFavoriteCollections
Add the collection to the favorite collections model.
Definition standardactionmanager.h:133
@ SynchronizeCollectionsRecursive
Synchronizes collections in a recursive way.
Definition standardactionmanager.h:151
@ MoveItemsToTrash
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
Definition standardactionmanager.h:153
@ MoveToTrashRestoreCollectionAlternative
Helper type for MoveToTrashRestoreCollection, do not create directly.
Definition standardactionmanager.h:157
@ RestoreItemsFromTrash
Restores the selected items from trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:155
@ MoveToTrashRestoreItemAlternative
Helper type for MoveToTrashRestoreItem, do not create directly.
Definition standardactionmanager.h:160
@ RestoreCollectionsFromTrash
Restores the selected collection from trash, needs EntityDeletedAttribute.
Definition standardactionmanager.h:154
@ MoveCollectionToMenu
Menu allowing to move a collection into another collection.
Definition standardactionmanager.h:139
@ MoveItemToDialog
Move an item into a collection, select the target in a dialog.
Definition standardactionmanager.h:150
@ CopyItemToDialog
Copy an item into a collection, select the target in a dialog.
Definition standardactionmanager.h:149
@ MoveCollectionsToTrash
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
Definition standardactionmanager.h:152
Helper integration between Akonadi and Qt.
QClipboard * clipboard()
const_reference at(qsizetype i) const const
qsizetype count() const const
bool isEmpty() const const
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
DirectConnection
CopyAction
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.