Akonadi
standardactionmanager.cpp
78 {"akonadi_collection_create", kli18n("&New Folder..."), kli18n("New"), "folder-new", nullptr, 0, SLOT(slotCreateCollection()), NormalAction},
79 {"akonadi_collection_copy", KLazyLocalizedString(), KLazyLocalizedString(), "edit-copy", nullptr, 0, SLOT(slotCopyCollections()), NormalAction},
80 {"akonadi_collection_delete", kli18n("&Delete Folder"), kli18n("Delete"), "edit-delete", nullptr, 0, SLOT(slotDeleteCollection()), NormalAction},
97 {"akonadi_item_copy", KLazyLocalizedString(), KLazyLocalizedString(), "edit-copy", nullptr, 0, SLOT(slotCopyItems()), NormalAction},
98 {"akonadi_paste", kli18n("&Paste"), kli18n("Paste"), "edit-paste", nullptr, Qt::CTRL | Qt::Key_V, SLOT(slotPaste()), NormalAction},
99 {"akonadi_item_delete", KLazyLocalizedString(), KLazyLocalizedString(), "edit-delete", nullptr, 0, SLOT(slotDeleteItems()), NormalAction},
124 {"akonadi_collection_rename_favorite", kli18n("Rename Favorite..."), kli18n("Rename"), "edit-rename", nullptr, 0, SLOT(slotRenameFavorite()), NormalAction},
133 {"akonadi_item_copy_to_menu", kli18n("Copy Item To..."), kli18n("Copy To"), "edit-copy", nullptr, 0, SLOT(slotCopyItemTo(QAction *)), MenuAction},
134 {"akonadi_item_move_to_menu", kli18n("Move Item To..."), kli18n("Move To"), "edit-move", "go-jump", 0, SLOT(slotMoveItemTo(QAction *)), MenuAction},
143 {"akonadi_item_cut", kli18n("&Cut Item"), kli18n("Cut"), "edit-cut", nullptr, Qt::CTRL | Qt::Key_X, SLOT(slotCutItems()), NormalAction},
144 {"akonadi_collection_cut", kli18n("&Cut Folder"), kli18n("Cut"), "edit-cut", nullptr, Qt::CTRL | Qt::Key_X, SLOT(slotCutCollections()), NormalAction},
145 {"akonadi_resource_create", kli18n("Create Resource"), KLazyLocalizedString(), "folder-new", nullptr, 0, SLOT(slotCreateResource()), NormalAction},
146 {"akonadi_resource_delete", kli18n("Delete Resource"), KLazyLocalizedString(), "edit-delete", nullptr, 0, SLOT(slotDeleteResource()), NormalAction},
163 {"akonadi_work_offline", kli18n("Work Offline"), KLazyLocalizedString(), "user-offline", nullptr, 0, SLOT(slotToggleWorkOffline(bool)), ToggleAction},
164 {"akonadi_collection_copy_to_dialog", kli18n("Copy Folder To..."), kli18n("Copy To"), "edit-copy", nullptr, 0, SLOT(slotCopyCollectionTo()), NormalAction},
173 {"akonadi_item_copy_to_dialog", kli18n("Copy Item To..."), kli18n("Copy To"), "edit-copy", nullptr, 0, SLOT(slotCopyItemTo()), NormalAction},
174 {"akonadi_item_move_to_dialog", kli18n("Move Item To..."), kli18n("Move To"), "edit-move", "go-jump", 0, SLOT(slotMoveItemTo()), NormalAction},
223 {nullptr, kli18n("&Restore Collection From Trash"), kli18n("Restore Collection From Trash"), "view-refresh", nullptr, 0, nullptr, ActionAlternative},
232 {nullptr, kli18n("&Restore Item From Trash"), kli18n("Restore Item From Trash"), "view-refresh", nullptr, 0, nullptr, ActionAlternative},
251 static const int numStandardActionData = sizeof standardActionData / sizeof *standardActionData;
256 return QIcon::fromTheme(QString::fromLatin1(data.icon), QIcon::fromTheme(QString::fromLatin1(data.altIcon)));
261 static_assert(numStandardActionData == StandardActionManager::LastType, "StandardActionData table does not match StandardActionManager types");
291 // try harder for selected rows that don't span the full row for some reason (e.g. due to buggy column adding proxy models etc)
328 pluralLabels.insert(StandardActionManager::CopyCollections, ki18np("&Copy Folder", "&Copy %1 Folders"));
330 pluralLabels.insert(StandardActionManager::CutItems, ki18ncp("@action", "&Cut Item", "&Cut %1 Items"));
331 pluralLabels.insert(StandardActionManager::CutCollections, ki18ncp("@action", "&Cut Folder", "&Cut %1 Folders"));
332 pluralLabels.insert(StandardActionManager::DeleteItems, ki18np("&Delete Item", "&Delete %1 Items"));
333 pluralLabels.insert(StandardActionManager::DeleteCollections, ki18ncp("@action", "&Delete Folder", "&Delete %1 Folders"));
334 pluralLabels.insert(StandardActionManager::SynchronizeCollections, ki18ncp("@action", "&Synchronize Folder", "&Synchronize %1 Folders"));
335 pluralLabels.insert(StandardActionManager::DeleteResources, ki18np("&Delete Resource", "&Delete %1 Resources"));
336 pluralLabels.insert(StandardActionManager::SynchronizeResources, ki18np("&Synchronize Resource", "&Synchronize %1 Resources"));
338 pluralIconLabels.insert(StandardActionManager::CopyCollections, ki18np("Copy Folder", "Copy %1 Folders"));
339 pluralIconLabels.insert(StandardActionManager::CopyItems, ki18np("Copy Item", "Copy %1 Items"));
341 pluralIconLabels.insert(StandardActionManager::CutCollections, ki18np("Cut Folder", "Cut %1 Folders"));
342 pluralIconLabels.insert(StandardActionManager::DeleteItems, ki18np("Delete Item", "Delete %1 Items"));
343 pluralIconLabels.insert(StandardActionManager::DeleteCollections, ki18np("Delete Folder", "Delete %1 Folders"));
344 pluralIconLabels.insert(StandardActionManager::SynchronizeCollections, ki18np("Synchronize Folder", "Synchronize %1 Folders"));
345 pluralIconLabels.insert(StandardActionManager::DeleteResources, ki18ncp("@action", "Delete Resource", "Delete %1 Resources"));
346 pluralIconLabels.insert(StandardActionManager::SynchronizeResources, ki18ncp("@action", "Synchronize Resource", "Synchronize %1 Resources"));
348 setContextText(StandardActionManager::CreateCollection, StandardActionManager::DialogTitle, i18nc("@title:window", "New Folder"));
349 setContextText(StandardActionManager::CreateCollection, StandardActionManager::DialogText, i18nc("@label:textbox name of Akonadi folder", "Name"));
350 setContextText(StandardActionManager::CreateCollection, StandardActionManager::ErrorMessageText, ki18n("Could not create folder: %1"));
351 setContextText(StandardActionManager::CreateCollection, StandardActionManager::ErrorMessageTitle, i18n("Folder creation failed"));
356 ki18np("Do you really want to delete this folder and all its sub-folders?", "Do you really want to delete %1 folders and all their sub-folders?"));
360 setContextText(StandardActionManager::DeleteCollections, StandardActionManager::ErrorMessageText, ki18n("Could not delete folder: %1"));
361 setContextText(StandardActionManager::DeleteCollections, StandardActionManager::ErrorMessageTitle, i18n("Folder deletion failed"));
363 setContextText(StandardActionManager::CollectionProperties, StandardActionManager::DialogTitle, ki18nc("@title:window", "Properties of Folder %1"));
367 ki18np("Do you really want to delete the selected item?", "Do you really want to delete %1 items?"));
368 setContextText(StandardActionManager::DeleteItems, StandardActionManager::MessageBoxTitle, ki18ncp("@title:window", "Delete item?", "Delete items?"));
369 setContextText(StandardActionManager::DeleteItems, StandardActionManager::ErrorMessageText, ki18n("Could not delete item: %1"));
370 setContextText(StandardActionManager::DeleteItems, StandardActionManager::ErrorMessageTitle, i18n("Item deletion failed"));
372 setContextText(StandardActionManager::RenameFavoriteCollection, StandardActionManager::DialogTitle, i18nc("@title:window", "Rename Favorite"));
373 setContextText(StandardActionManager::RenameFavoriteCollection, StandardActionManager::DialogText, i18nc("@label:textbox name of the folder", "Name:"));
375 setContextText(StandardActionManager::CreateResource, StandardActionManager::DialogTitle, i18nc("@title:window", "New Resource"));
376 setContextText(StandardActionManager::CreateResource, StandardActionManager::ErrorMessageText, ki18n("Could not create resource: %1"));
377 setContextText(StandardActionManager::CreateResource, StandardActionManager::ErrorMessageTitle, i18n("Resource creation failed"));
381 ki18np("Do you really want to delete this resource?", "Do you really want to delete %1 resources?"));
386 setContextText(StandardActionManager::Paste, StandardActionManager::ErrorMessageText, ki18n("Could not paste data: %1"));
387 setContextText(StandardActionManager::Paste, StandardActionManager::ErrorMessageTitle, i18n("Paste failed"));
412 // get rid of the submenus, they are re-created in enableAction. clear() is not enough, doesn't remove the submenu object instances.
426 q->connect(menu, SIGNAL(triggered(QAction *)), standardActionData[type].slot); // clazy:exclude=old-style-connect
443 const StandardActionManager::Type type = static_cast<StandardActionManager::Type>(menu->property("actionType").toInt());
445 QPointer<RecentCollectionAction> recentCollection = new RecentCollectionAction(type, selectedCollectionsList, collectionSelectionModel->model(), menu);
448 fillFoldersMenu(selectedCollectionsList, mimeTypes, type, menu, collectionSelectionModel->model(), QModelIndex());
453 if (type == StandardActionManager::CopyCollectionToMenu || type == StandardActionManager::CopyItemToMenu
454 || type == StandardActionManager::MoveItemToMenu || type == StandardActionManager::MoveCollectionToMenu) {
455 new RecentCollectionAction(type, Akonadi::Collection::List(), collectionSelectionModel->model(), menu);
458 fillFoldersMenu(selectedCollectionsList, mimeTypes, type, menu, collectionSelectionModel->model(), QModelIndex());
475 * The same action is stored at the ActionWithAlternative indexes as well as the corresponding ActionAlternative indexes in the actions array.
478 if ((standardActionData[type].actionType == ActionWithAlternative) || (standardActionData[type].actionType == ActionAlternative)) {
514 void updatePluralLabel(StandardActionManager::Type type, int count) // private slot, called by ActionStateManager
522 bool isFavoriteCollection(const Akonadi::Collection &collection) const // private slot, called by ActionStateManager
562 const auto parentCollection = index.data(EntityTreeModel::ParentCollectionRole).value<Collection>();
602 const auto parentCollection = index.data(EntityTreeModel::ParentCollectionRole).value<Collection>();
609 mActionStateManager.updateState(selectedCollectionsList, selectedFavoriteCollectionsList, selectedItems);
611 enableAction(StandardActionManager::SynchronizeFavoriteCollections, (favoritesModel->rowCount() > 0));
613 Q_EMIT q->selectionsChanged(selectedCollectionsList, selectedFavoriteCollectionsList, selectedItems);
626 QItemSelection mapToEntityTreeModel(const QAbstractItemModel *model, const QItemSelection &selection) const
636 QItemSelection mapFromEntityTreeModel(const QAbstractItemModel *model, const QItemSelection &selection) const
647 // RAII class for setting insideSelectionSlot to true on entering, and false on exiting, the two slots below.
700 collectionSelectionModel->select(selection, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
702 // Also set the current index. This will trigger KMMainWidget::slotFolderChanged in kmail, which we want.
704 collectionSelectionModel->setCurrentIndex(selection.indexes().first(), QItemSelectionModel::NoUpdate);
739 KMessageBox::error(parentWidget, i18n("We can not add \"/\" in folder name."), i18n("Create new folder error"));
743 KMessageBox::error(parentWidget, i18n("We can not add \".\" at begin or end of folder name."), i18n("Create new folder error"));
751 const QStringList mts = actions[StandardActionManager::CreateCollection]->property("ContentMimeTypes").toStringList();
804 const QString text = contextText(StandardActionManager::DeleteCollections, StandardActionManager::MessageBoxText, collections.count(), collectionName);
809 contextText(StandardActionManager::DeleteCollections, StandardActionManager::MessageBoxTitle, collections.count(), collectionName),
978 Akonadi::AgentInstance instance = Akonadi::AgentManager::self()->instance(collection.resource());
982 i18n("Before syncing folder \"%1\" it is necessary to have the resource online. Do you want to make it online?", collection.displayName()),
1028 auto dlg = new CollectionPropertiesDialog(collection, mCollectionPropertiesPageNames, parentWidget);
1029 dlg->setWindowTitle(contextText(StandardActionManager::CollectionProperties, StandardActionManager::DialogTitle, collection.displayName()));
1059 model->dropMimeData(mimeData, isCutAction(mimeData) ? Qt::MoveAction : Qt::CopyAction, -1, -1, index);
1096 contextText(StandardActionManager::DeleteItems, StandardActionManager::MessageBoxText, items.count(), QString()),
1097 contextText(StandardActionManager::DeleteItems, StandardActionManager::MessageBoxTitle, items.count(), QString()),
1173 new RenameFavoriteDialog(favoritesModel->favoriteLabel(collection), favoritesModel->defaultFavoriteLabel(collection), parentWidget));
1195 pasteTo(collectionSelectionModel, collectionSelectionModel->model(), StandardActionManager::CopyCollectionToMenu, Qt::CopyAction);
1200 pasteTo(itemSelectionModel, collectionSelectionModel->model(), StandardActionManager::CopyItemToMenu, Qt::CopyAction);
1205 pasteTo(collectionSelectionModel, collectionSelectionModel->model(), StandardActionManager::MoveCollectionToMenu, Qt::MoveAction);
1210 pasteTo(itemSelectionModel, collectionSelectionModel->model(), StandardActionManager::MoveItemToMenu, Qt::MoveAction);
1270 dlg->setWindowTitle(contextText(StandardActionManager::CreateResource, StandardActionManager::DialogTitle));
1304 contextText(StandardActionManager::DeleteResources, StandardActionManager::MessageBoxText, instances.count(), instances.first().name()),
1305 contextText(StandardActionManager::DeleteResources, StandardActionManager::MessageBoxTitle, instances.count(), instances.first().name()),
1355 void pasteTo(QItemSelectionModel *selectionModel, const QAbstractItemModel *model, StandardActionManager::Type type, Qt::DropAction dropAction)
1362 if (type == StandardActionManager::CopyItemToMenu || type == StandardActionManager::MoveItemToMenu) {
1364 } else if (type == StandardActionManager::CopyCollectionToMenu || type == StandardActionManager::MoveCollectionToMenu) {
1369 const QModelIndex index = EntityTreeModel::modelIndexForCollection(collectionSelectionModel->model(), dlg->selectedCollection());
1375 const QMimeData *mimeData = selectionModel->model()->mimeData(safeSelectedRows(selectionModel));
1407 QMapIterator<StandardActionManager::Type, QPointer<RecentCollectionAction>> item(mRecentCollectionsMenu);
1420 contextText(StandardActionManager::CreateCollection, StandardActionManager::ErrorMessageText, job->errorString()),
1421 contextText(StandardActionManager::CreateCollection, StandardActionManager::ErrorMessageTitle));
1429 contextText(StandardActionManager::DeleteCollections, StandardActionManager::ErrorMessageText, job->errorString()),
1430 contextText(StandardActionManager::DeleteCollections, StandardActionManager::ErrorMessageTitle));
1438 contextText(StandardActionManager::MoveCollectionsToTrash, StandardActionManager::ErrorMessageText, job->errorString()),
1439 contextText(StandardActionManager::MoveCollectionsToTrash, StandardActionManager::ErrorMessageTitle));
1447 contextText(StandardActionManager::MoveItemsToTrash, StandardActionManager::ErrorMessageText, job->errorString()),
1448 contextText(StandardActionManager::MoveItemsToTrash, StandardActionManager::ErrorMessageTitle));
1456 contextText(StandardActionManager::DeleteItems, StandardActionManager::ErrorMessageText, job->errorString()),
1465 contextText(StandardActionManager::CreateResource, StandardActionManager::ErrorMessageText, job->errorString()),
1474 contextText(StandardActionManager::Paste, StandardActionManager::ErrorMessageText, job->errorString()),
1487 const bool isItemAction = (type == StandardActionManager::CopyItemToMenu || type == StandardActionManager::MoveItemToMenu);
1488 const bool isCollectionAction = (type == StandardActionManager::CopyCollectionToMenu || type == StandardActionManager::MoveCollectionToMenu);
1504 const auto mimeTypesResult = AgentManager::self()->instance(collection.resource()).type().mimeTypes();
1515 bool isWritableTargetCollectionForMimeTypes(const Collection &collection, const QSet<QString> &mimeTypes, StandardActionManager::Type type) const
1521 const bool isItemAction = (type == StandardActionManager::CopyItemToMenu || type == StandardActionManager::MoveItemToMenu);
1522 const bool isCollectionAction = (type == StandardActionManager::CopyCollectionToMenu || type == StandardActionManager::MoveCollectionToMenu);
1525 const QSet<QString> contentMimeTypesSet = QSet<QString>(contentMimeTypesList.cbegin(), contentMimeTypesList.cend());
1532 collection.contentMimeTypes().contains(Collection::mimeType()) || collection.contentMimeTypes().contains(Collection::virtualMimeType());
1534 const auto mimeTypesList{AgentManager::self()->instance(collection.resource()).type().mimeTypes()};
1535 const QSet<QString> mimeTypesListSet = QSet<QString>(mimeTypesList.cbegin(), mimeTypesList.cend());
1538 const bool isReadOnlyForItems = (isItemAction && (!canCreateNewItems || !canContainRequiredMimeTypes));
1539 const bool isReadOnlyForCollections = (isCollectionAction && (!canCreateNewCollections || !canContainCollections || !resourceAllowsRequiredMimeTypes));
1541 return !(CollectionUtils::isStructural(collection) || isReadOnlyForItems || isReadOnlyForCollections);
1555 const auto collection = model->data(index, EntityTreeModel::CollectionRole).value<Collection>();
1575 const bool moveAction = (type == StandardActionManager::MoveCollectionToMenu || type == StandardActionManager::MoveItemToMenu);
1585 QAction *action = popup->addAction(moveAction ? i18n("Move to This Folder") : i18n("Copy to This Folder"));
1647 const QByteArray data = mimeData->data(QStringLiteral("application/x-kde.akonadi-cutselection"));
1655 void setContextText(StandardActionManager::Type type, StandardActionManager::TextContext context, const QString &data)
1663 void setContextText(StandardActionManager::Type type, StandardActionManager::TextContext context, const KLocalizedString &data)
1671 QString contextText(StandardActionManager::Type type, StandardActionManager::TextContext context) const
1676 QString contextText(StandardActionManager::Type type, StandardActionManager::TextContext context, const QString &value) const
1686 QString contextText(StandardActionManager::Type type, StandardActionManager::TextContext context, int count, const QString &value) const
1734 StandardActionManager::StandardActionManager(KActionCollection *actionCollection, QWidget *parent)
1768 void StandardActionManager::setFavoriteCollectionsModel(FavoriteCollectionsModel *favoritesModel)
1799 createAction(static_cast<Type>(type + 1)); // ensure that alternative actions are initialized when not created by createAllActions
1827 d->actionCollection->setDefaultShortcut(action, QKeySequence(standardActionData[type].shortcut));
1836 connect(action, SIGNAL(triggered()), standardActionData[type].slot); // clazy:exclude=old-style-connect
1840 connect(actionMenu->menu(), SIGNAL(triggered(QAction *)), standardActionData[type].slot); // clazy:exclude=old-style-connect
1844 connect(action, SIGNAL(triggered(bool)), standardActionData[type].slot); // clazy:exclude=old-style-connect
1854 disconnect(action, SIGNAL(triggered(bool)), this, standardActionData[type].slot); // clazy:exclude=old-style-connect
1856 connect(action, SIGNAL(triggered(bool)), this, standardActionData[type].slot); // clazy:exclude=old-style-connect
1865 if ((standardActionData[type].actionType == ActionWithAlternative) && (standardActionData[type + 1].actionType == ActionAlternative)) {
1866 createAction(static_cast<Type>(type + 1)); // ensure that alternative actions are initialized when not created by createAllActions
1903 disconnect(action, SIGNAL(triggered()), this, standardActionData[type].slot); // clazy:exclude=old-style-connect
1905 connect(action, SIGNAL(triggered()), standardActionData[type].slot); // clazy:exclude=old-style-connect
1946 void StandardActionManager::setContextText(Type type, TextContext context, const QString &text)
1951 void StandardActionManager::setContextText(Type type, TextContext context, const KLocalizedString &text)
QByteArray data(const QString &mimeType) const const
T & first()
void setActionText(Type type, const KLocalizedString &text)
Sets the label of the action type to text, which is used during updating the action state and substit...
Definition: standardactionmanager.cpp:1885
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const const
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
QAction * action(Type type) const
Returns the action of the given type, 0 if it has not been created (yet).
Definition: standardactionmanager.cpp:1879
bool isEmpty() const const
KGuiItem del()
QModelIndex toModelIndex() const const
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
void synchronizeCollection(const Collection &collection)
Trigger a synchronization of the given collection by its owning resource agent.
Definition: core/agentmanager.cpp:395
bool isValid() const const
DecorationRole
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Job that deletes items from the Akonadi storage.
Definition: itemdeletejob.h:47
virtual int rowCount(const QModelIndex &parent) const const=0
const QList< QKeySequence > & shortcut(StandardShortcut id)
const QItemSelection selection() const const
KLocalizedString KI18N_EXPORT ki18nc(const char *context, const char *text)
@ SynchronizeFavoriteCollections
Synchronize favorite collections.
Definition: standardactionmanager.h:162
const QAbstractItemModel * model() const const
virtual Q_SCRIPTABLE void start()=0
void setData(const QString &mimeType, const QByteArray &data)
void setIsOnline(bool online)
Sets online status of the agent instance.
Definition: core/agentinstance.cpp:87
void result(KJob *job)
Manages generic actions for collection and item views.
Definition: standardactionmanager.h:116
virtual QVariant data(const QModelIndex &index, int role) const const=0
A generic and extensible dialog for collection properties.
Definition: collectionpropertiesdialog.h:42
int count(const T &value) const const
T value() const const
void setMimeTypeFilter(const QStringList &mimeTypes)
Sets the mime type filter that will be used when creating new resources.
Definition: standardactionmanager.cpp:1956
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
QString trimmed() const const
void createActionFolderMenu(QMenu *menu, Type type)
Create a popup menu.
Definition: standardactionmanager.cpp:1971
QIcon fromTheme(const QString &name)
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
Definition: item.cpp:170
QVector< AgentInstance > List
Describes a list of agent instances.
Definition: core/agentinstance.h:55
void setShortcut(const QKeySequence &shortcut)
void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
qlonglong toLongLong(bool *ok) const const
@ ToggleWorkOffline
Toggles the work offline state of all resources.
Definition: standardactionmanager.h:146
KIOFILEWIDGETS_EXPORT QStringList list(const QString &fileClass)
QString toString() const
bool intersects(const QSet< T > &other) const const
T & first()
QAction * createAction(Type type)
Creates the action of the given type and adds it to the action collection specified in the constructo...
Definition: standardactionmanager.cpp:1783
void setIconText(const QString &text)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
char at(int i) const const
void reserve(int alloc)
Akonadi::Item::List selectedItems() const
Returns the list of items that are currently selected.
Definition: standardactionmanager.cpp:1928
void setCollectionPropertiesPageNames(const QStringList &names)
Sets the page names of the config pages that will be used by the built-in collection properties dialo...
Definition: standardactionmanager.cpp:1966
ClearAndSelect
void setContextText(Type type, TextContext context, const QString &text)
Sets the text of the action type for the given context.
Definition: standardactionmanager.cpp:1946
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
void removeInstance(const AgentInstance &instance)
Removes the given agent instance.
Definition: core/agentmanager.cpp:390
QClipboard * clipboard()
QVariant data(int role) const const
ButtonCode questionYesNo(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Notify)
void setIcon(const QIcon &icon)
Dangerous
QModelIndexList indexes() const const
void setCollectionSelectionModel(QItemSelectionModel *selectionModel)
Sets the collection selection model based on which the collection related actions should operate.
Definition: standardactionmanager.cpp:1750
typedef ItemFlags
StandardActionManager(KActionCollection *actionCollection, QWidget *parent=nullptr)
Creates a new standard action manager.
Definition: standardactionmanager.cpp:1734
QString i18n(const char *text, const TYPE &arg...)
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
void changed(QClipboard::Mode mode)
void synchronize()
Triggers the agent instance to start synchronization.
Definition: core/agentinstance.cpp:97
char * toString(const T &value)
void timeout()
bool isEmpty() const const
void setFavoriteSelectionModel(QItemSelectionModel *selectionModel)
Sets the favorite collection selection model based on which the favorite collection related actions s...
Definition: standardactionmanager.cpp:1774
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
Akonadi::Collection::List selectedCollections() const
Returns the list of collections that are currently selected.
Definition: standardactionmanager.cpp:1909
void setText(const QString &text)
QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
static QString virtualMimeType()
Returns the mimetype used for virtual collections.
Definition: collection.cpp:297
int toInt(bool *ok) const const
bool contains(const T &value) const const
QueuedConnection
bool isEmpty() const const
KLocalizedString KI18N_EXPORT ki18n(const char *text)
void setContentMimeTypes(const QStringList &types)
Sets the list of possible content mime types.
Definition: collection.cpp:245
KLocalizedString subs(const KLocalizedString &a, int fieldWidth=0, QChar fillChar=QLatin1Char(' ')) const
void setCapabilityFilter(const QStringList &capabilities)
Sets the capability filter that will be used when creating new resources.
Definition: standardactionmanager.cpp:1961
Accepted
Key_F5
KSharedConfigPtr config()
bool isValid() const const
~StandardActionManager() override
Destroys the standard action manager.
void reserve(int size)
Mode
KGuiItem ok()
bool contains(const T &value) const const
QString name() const
Returns the user visible name of the agent instance.
Definition: core/agentinstance.cpp:52
QString & replace(int position, int n, QChar after)
@ CopyCollectionToMenu
Menu allowing to quickly copy a collection into another collection.
Definition: standardactionmanager.h:136
void synchronizeCollectionTree()
Triggers a synchronization of the collection tree by the given agent instance.
Definition: core/agentinstance.cpp:102
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
QVariant data() const const
void setData(const QVariant &userData)
QString label(StandardShortcut id)
const QMimeData * mimeData(QClipboard::Mode mode) const const
void createAllActions()
Convenience method to create all standard actions.
Definition: standardactionmanager.cpp:1872
bool setProperty(const char *name, const QVariant &value)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
MoveAction
bool isEmpty() const const
void addRecentCollection(Akonadi::Collection::Id id) const
Add a collection to the global recent collection list.
Definition: standardactionmanager.cpp:1976
Job that deletes a collection in the Akonadi storage.
Definition: collectiondeletejob.h:50
void setVirtual(bool isVirtual)
Sets whether the collection is virtual or not.
Definition: collection.cpp:352
int count() const const
void setEnabled(bool)
A model that lists a set of favorite collections.
Definition: favoritecollectionsmodel.h:52
bool isOnline() const
Returns whether the agent instance is online currently.
Definition: core/agentinstance.cpp:82
QModelIndexList selectedRows(int column) const const
QString & insert(int position, QChar ch)
bool hasAttribute(const QByteArray &name) const
Returns true if the item has an attribute of the given type name, false otherwise.
Definition: item.cpp:128
An Attribute that marks that an entity was marked as deleted.
Definition: entitydeletedattribute.h:34
QString fromLatin1(const char *str, int size)
QString name(StandardShortcut id)
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)
CTRL
TextContext
Describes the text context that can be customized.
Definition: standardactionmanager.h:170
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
QStringList mimeTypes(Mode mode=Writing)
KLocalizedString KI18N_EXPORT ki18np(const char *singular, const char *plural)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void setMimeData(QMimeData *src, QClipboard::Mode mode)
static AgentManager * self()
Returns the global instance of the agent manager.
Definition: core/agentmanager.cpp:355
int count(const T &value) const const
static QModelIndex modelIndexForCollection(const QAbstractItemModel *model, const Collection &collection)
Returns a QModelIndex in model which points to collection.
Definition: entitytreemodel.cpp:1057
@ CopyItemToMenu
Menu allowing to quickly copy an item into a collection.
Definition: standardactionmanager.h:137
AgentInstance::List instances() const
Returns the list of all available agent instances.
Definition: core/agentmanager.cpp:380
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
Definition: collection.cpp:204
@ MoveCollectionToMenu
Menu allowing to move a collection into another collection.
Definition: standardactionmanager.h:139
Job that creates a new collection in the Akonadi storage.
Definition: collectioncreatejob.h:39
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
virtual QString errorString() const
void interceptAction(Type type, bool intercept=true)
Sets whether the default implementation for the given action type shall be executed when the action i...
Definition: standardactionmanager.cpp:1892
int error() const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
void setChecked(bool)
virtual QMimeData * mimeData(const QModelIndexList &indexes) const const
KGuiItem cancel()
bool isValid() const
Returns whether the agent instance object is valid.
Definition: core/agentinstance.cpp:32
void clear(QClipboard::Mode mode)
@ RenameFavoriteCollection
Rename the collection of the favorite collections model.
Definition: standardactionmanager.h:135
QStringList mimeTypes() const
Returns the list of supported mime types of the agent type.
Definition: core/agenttype.cpp:58
void setFavoriteCollectionsModel(FavoriteCollectionsModel *favoritesModel)
Sets the favorite collections model based on which the collection relatedactions should operate.
Definition: standardactionmanager.cpp:1768
@ MoveCollectionsToTrash
Moves the selected collection to trash and marks it as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:152
void setName(const QString &name)
Sets the i18n'ed name of the collection.
Definition: collection.cpp:221
QObject * parent() const const
const QAbstractItemModel * model() const const
@ MoveItemsToTrash
Moves the selected items to trash and marks them as deleted, needs EntityDeletedAttribute.
Definition: standardactionmanager.h:153
Job for creating new agent instances.
Definition: agentinstancecreatejob.h:58
AKONADICORE_DEPRECATED void configure(QWidget *parent=nullptr)
Triggers the agent instance to show its configuration dialog.
Definition: core/agentinstance.cpp:92
void setItemSelectionModel(QItemSelectionModel *selectionModel)
Sets the item selection model based on which the item related actions should operate.
Definition: standardactionmanager.cpp:1760
@ MoveItemToMenu
Menu allowing to move item into a collection.
Definition: standardactionmanager.h:138
QString toString() const const
QVariant property(const char *name) const const
Helper integration between Akonadi and Qt.
bool isEmpty() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:00:33 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:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.