Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/standardactionmanager.cpp
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Line(s) | 441 | { | |||
---|---|---|---|---|---|
445 | } | 445 | } | ||
446 | 446 | | |||
447 | #ifndef QT_NO_CLIPBOARD | 447 | #ifndef QT_NO_CLIPBOARD | ||
448 | QAbstractItemModel *model = const_cast<QAbstractItemModel *>(selectionModel->model()); | 448 | QAbstractItemModel *model = const_cast<QAbstractItemModel *>(selectionModel->model()); | ||
449 | QMimeData *mimeData = selectionModel->model()->mimeData(safeSelectedRows(selectionModel)); | 449 | QMimeData *mimeData = selectionModel->model()->mimeData(safeSelectedRows(selectionModel)); | ||
450 | model->setData(QModelIndex(), false, EntityTreeModel::PendingCutRole); | 450 | model->setData(QModelIndex(), false, EntityTreeModel::PendingCutRole); | ||
451 | markCutAction(mimeData, cut); | 451 | markCutAction(mimeData, cut); | ||
452 | QApplication::clipboard()->setMimeData(mimeData); | 452 | QApplication::clipboard()->setMimeData(mimeData); | ||
453 | 453 | if (cut) { | |||
454 | const auto rows = safeSelectedRows(selectionModel); | 454 | const auto rows = safeSelectedRows(selectionModel); | ||
455 | for (const auto &index : rows) { | 455 | for (const auto &index : rows) { | ||
456 | model->setData(index, true, EntityTreeModel::PendingCutRole); | 456 | model->setData(index, true, EntityTreeModel::PendingCutRole); | ||
457 | } | 457 | } | ||
458 | } | ||||
458 | #endif | 459 | #endif | ||
459 | } | 460 | } | ||
460 | 461 | | |||
461 | static Akonadi::Collection::List collectionsForIndexes(const QModelIndexList& list) | 462 | static Akonadi::Collection::List collectionsForIndexes(const QModelIndexList& list) | ||
462 | { | 463 | { | ||
463 | Akonadi::Collection::List collectionList; | 464 | Akonadi::Collection::List collectionList; | ||
464 | for (const QModelIndex &index : list) { | 465 | for (const QModelIndex &index : list) { | ||
465 | Collection collection = index.data(EntityTreeModel::CollectionRole).value<Collection>(); | 466 | Collection collection = index.data(EntityTreeModel::CollectionRole).value<Collection>(); | ||
▲ Show 20 Lines • Show All 1373 Lines • Show Last 20 Lines |