diff options
| author | David Faure <[email protected]> | 2008-06-05 22:25:07 +0000 |
|---|---|---|
| committer | David Faure <[email protected]> | 2008-06-05 22:25:07 +0000 |
| commit | 3d28c535643ce8ad0c91b20adbdd1229031d3c82 (patch) | |
| tree | 5b4d3b175129147105da6e52a432de4da565d830 /src/dolphinpart.cpp | |
| parent | 008f524498475dd28717b1f3d65e2c99bbdb5b2a (diff) | |
When "move_to_trash" is disabled and "delete" is enabled (e.g. non-local files),
enable a hidden action with Key_Del as shortcut, so that the user can press Del to delete the file.
BUG: 76016
svn path=/trunk/KDE/kdebase/apps/; revision=817389
Diffstat (limited to 'src/dolphinpart.cpp')
| -rw-r--r-- | src/dolphinpart.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index bca9ee4a6..58e68a39f 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -122,8 +122,6 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL m_actionHandler->updateViewActions(); slotSelectionChanged(KFileItemList()); // initially disable selection-dependent actions - // TODO sort_by_* actions - // TODO there was a "always open a new window" (when clicking on a directory) setting in konqueror // (sort of spacial navigation) @@ -213,26 +211,27 @@ void DolphinPart::slotSelectionChanged(const KFileItemList& selection) QAction* deleteAction = actionCollection()->action("delete"); QAction* editMimeTypeAction = actionCollection()->action("editMimeType"); QAction* propertiesAction = actionCollection()->action("properties"); + QAction* deleteWithTrashShortcut = actionCollection()->action("delete_shortcut"); // see DolphinViewActionHandler if (!hasSelection) { stateChanged("has_no_selection"); emit m_extension->enableAction("cut", false); emit m_extension->enableAction("copy", false); - renameAction->setEnabled(false); - moveToTrashAction->setEnabled(false); - deleteAction->setEnabled(false); + deleteWithTrashShortcut->setEnabled(false); editMimeTypeAction->setEnabled(false); - propertiesAction->setEnabled(false); } else { stateChanged("has_selection"); + // TODO share this code with DolphinMainWindow::updateEditActions (and the desktop code) + // in libkonq KonqFileItemCapabilities capabilities(selection); const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); renameAction->setEnabled(capabilities.supportsMoving()); moveToTrashAction->setEnabled(enableMoveToTrash); deleteAction->setEnabled(capabilities.supportsDeleting()); + deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash); editMimeTypeAction->setEnabled(true); propertiesAction->setEnabled(true); emit m_extension->enableAction("cut", capabilities.supportsMoving()); |
