diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml --- a/containments/desktop/package/contents/ui/FolderView.qml +++ b/containments/desktop/package/contents/ui/FolderView.qml @@ -862,8 +862,14 @@ Behavior on contentX { id: smoothX; enabled: false; SmoothedAnimation { velocity: 700 } } Behavior on contentY { id: smoothY; enabled: false; SmoothedAnimation { velocity: 700 } } - Keys.onReturnPressed: runOrCdSelected() - Keys.onEnterPressed: runOrCdSelected() + Keys.onReturnPressed: { + if (event.modifiers === Qt.AltModifier) { + dir.openPropertiesDialog(); + } else { + runOrCdSelected(); + } + } + Keys.onEnterPressed: Keys.returnPressed(event) Keys.onMenuPressed: { if (currentIndex != -1 && dir.hasSelection() && currentItem) { diff --git a/containments/desktop/plugins/folder/foldermodel.h b/containments/desktop/plugins/folder/foldermodel.h --- a/containments/desktop/plugins/folder/foldermodel.h +++ b/containments/desktop/plugins/folder/foldermodel.h @@ -229,6 +229,8 @@ Q_INVOKABLE void linkHere(const QUrl &sourceUrl); + Q_INVOKABLE void openPropertiesDialog(); + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; int indexForUrl(const QUrl &url) const; KFileItem itemForIndex(const QModelIndex &index) const; diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp --- a/containments/desktop/plugins/folder/foldermodel.cpp +++ b/containments/desktop/plugins/folder/foldermodel.cpp @@ -1773,9 +1773,7 @@ if (KPropertiesDialog::canDisplay(items)) { QAction *act = new QAction(menu); act->setText(i18n("&Properties")); - QObject::connect(act, &QAction::triggered, [this, items]() { - KPropertiesDialog::showDialog(items, nullptr, false /*non modal*/); - }); + QObject::connect(act, &QAction::triggered, this, &FolderModel::openPropertiesDialog); menu->addAction(act); } @@ -1790,6 +1788,29 @@ connect(menu, &QMenu::aboutToHide, [menu]() { menu->deleteLater(); }); } +void FolderModel::openPropertiesDialog() +{ + const QModelIndexList indexes = m_selectionModel->selectedIndexes(); + if (indexes.isEmpty()) { + return; + } + + KFileItemList items; + items.reserve(indexes.count()); + for (const QModelIndex &index : indexes) { + KFileItem item = itemForIndex(index); + if (!item.isNull()) { + items.append(item); + } + } + + if (!KPropertiesDialog::canDisplay(items)) { + return; + } + + KPropertiesDialog::showDialog(items, nullptr, false /*non modal*/); +} + void FolderModel::linkHere(const QUrl &sourceUrl) { KIO::CopyJob *job = KIO::link(sourceUrl, m_dirModel->dirLister()->url());