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()))) {
53 void 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));
364 bool 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));
bool isEmpty() const const
int count(const T &value) const const
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
@ MoveToTrashRestoreCollectionAlternative
Helper type for MoveToTrashRestoreCollection, do not create directly.
Definition: standardactionmanager.h:157
@ CopyCollectionToDialog
Copy a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:147
@ RemoveFromFavoriteCollections
Remove the collection from the favorite collections model.
Definition: standardactionmanager.h:134
AgentInstance instance(const QString &identifier) const
Returns the agent instance with the given identifier or an invalid agent instance if the identifier d...
Definition: core/agentmanager.cpp:385
QClipboard * clipboard()
QStringList capabilities() const
Returns the list of supported capabilities of the agent type.
Definition: core/agenttype.cpp:63
@ RestoreCollectionsFromTrash
Restores the selected collection from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:154
@ SynchronizeCollectionsRecursive
Synchronizes collections in a recursive way.
Definition: standardactionmanager.h:151
@ RestoreItemsFromTrash
Restores the selected items from trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:155
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
const T & at(int i) const const
@ AddToFavoriteCollections
Add the collection to the favorite collections model.
Definition: standardactionmanager.h:133
static QString virtualMimeType()
Returns the mimetype used for virtual collections.
Definition: collection.cpp:297
DirectConnection
@ CopyItemToDialog
Copy an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:149
bool isEmpty() const const
An Attribute that stores the special collection type of a collection.
Definition: specialcollectionattribute.h:28
@ CopyCollectionToMenu
Menu allowing to quickly copy a collection into another collection.
Definition: standardactionmanager.h:136
Collection parentCollection() const
Returns the parent collection of this object.
Definition: collection.cpp:187
CopyAction
An Attribute that marks that an entity was marked as deleted.
Definition: entitydeletedattribute.h:34
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
@ MoveItemToDialog
Move an item into a collection, select the target in a dialog.
Definition: standardactionmanager.h:150
static AgentManager * self()
Returns the global instance of the agent manager.
Definition: core/agentmanager.cpp:355
int count(const T &value) const const
@ MoveToTrashRestoreCollection
Move Collection to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:156
@ CopyItemToMenu
Menu allowing to quickly copy an item into a collection.
Definition: standardactionmanager.h:137
@ MoveCollectionToMenu
Menu allowing to move a collection into another collection.
Definition: standardactionmanager.h:139
@ MoveToTrashRestoreItemAlternative
Helper type for MoveToTrashRestoreItem, do not create directly.
Definition: standardactionmanager.h:160
@ MoveToTrashRestoreItem
Move Item to Trash or Restore it from Trash, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:159
@ RenameFavoriteCollection
Rename the collection of the favorite collections model.
Definition: standardactionmanager.h:135
@ MoveCollectionsToTrash
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:152
@ MoveItemsToTrash
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:153
@ MoveCollectionToDialog
Move a collection into another collection, select the target in a dialog.
Definition: standardactionmanager.h:148
@ MoveItemToMenu
Menu allowing to move item into a collection.
Definition: standardactionmanager.h:138
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:00:31 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:00:31 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.