Commit 03c6b6c0 authored by Igor Poboiko's avatar Igor Poboiko
Browse files

[StandardActionManager] Don't add PendingCutRole when copying

Summary: We shouldn't add `PendingCutRole` (which i.e. greys out items from the EntityTreeView) when we are only copying, not cutting

Test Plan:
Although I've found no PIM applications which use `Copy` action (KMail, KAdressBook and KOrganizer use `Copy To` with a submenu),
I've used this action in KJots (to be able to paste links to various notes / books inside notes, instead of existing `copy_link_address` action), and it works.

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D29484
parent 6952bb44
......@@ -450,10 +450,11 @@ public:
model->setData(QModelIndex(), false, EntityTreeModel::PendingCutRole);
markCutAction(mimeData, cut);
QApplication::clipboard()->setMimeData(mimeData);
const auto rows = safeSelectedRows(selectionModel);
for (const auto &index : rows) {
model->setData(index, true, EntityTreeModel::PendingCutRole);
if (cut) {
const auto rows = safeSelectedRows(selectionModel);
for (const auto &index : rows) {
model->setData(index, true, EntityTreeModel::PendingCutRole);
}
}
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment