From 9c5b3bc3cd8ccd57c3669adb81259ca85c99a901 Mon Sep 17 00:00:00 2001 From: kate Date: Sat, 1 Jan 2022 13:04:49 +0800 Subject: [PATCH] fix: cut option enabled --- model/foldermodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model/foldermodel.cpp b/model/foldermodel.cpp index 5512e68..d18f1d8 100644 --- a/model/foldermodel.cpp +++ b/model/foldermodel.cpp @@ -1011,6 +1011,9 @@ void FolderModel::openSelected() if (!m_selectionModel->hasSelection()) return; + if (resolvedUrl().scheme() == QLatin1String("trash")) + return; + const QList urls = selectedUrls(); if (!m_isDesktop) { if (urls.size() == 1 && KFileItem(urls.first()).isDir()) { @@ -1875,6 +1878,7 @@ void FolderModel::updateActions() if (QAction *cutAction = m_actionCollection.action(QStringLiteral("cut"))) { cutAction->setVisible(!isTrash); + cutAction->setEnabled(rootItem().isWritable()); } if (QAction *restoreAction = m_actionCollection.action(QStringLiteral("restore"))) {