]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Update the "Move to Trash" action's and the "Delete" action's
authorEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Sat, 22 Jun 2013 12:04:45 +0000 (14:04 +0200)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Sat, 22 Jun 2013 12:04:45 +0000 (14:04 +0200)
enabled state in the context menu for read only files/folders (also
archives).

BUG: 294013
FIXED-IN: 4.11
REVIEW: 111160

src/dolphinremoveaction.cpp
src/views/dolphinview.cpp

index 200fc407db299bb13a02645ce44803b4e3a87f62..7d7c2f0439416f1e156ff1eabccc6de89b15dd80 100644 (file)
@@ -53,8 +53,9 @@ void DolphinRemoveAction::update()
         setText(i18nc("@action:inmenu", "&Move to Trash"));
     }
 
-   if (m_action) {
+    if (m_action) {
         setIcon(m_action->icon());
         setShortcuts(m_action->shortcuts());
+        setEnabled(m_action->isEnabled());
     }
 }
index e879f67fca911cc9520b95be5bb0ad346376b0b4..fa43656c1483a1d2553a4fbc8a36a7c414bab2c1 100644 (file)
@@ -850,6 +850,12 @@ void DolphinView::slotItemMiddleClicked(int index)
 
 void DolphinView::slotItemContextMenuRequested(int index, const QPointF& pos)
 {
+    // Force emit of a selection changed signal before we request the
+    // context menu, to update the edit-actions first. (See Bug 294013)
+    if (m_selectionChangedTimer->isActive()) {
+        emitSelectionChangedSignal();
+    }
+
     const KFileItem item = m_model->fileItem(index);
     emit requestContextMenu(pos.toPoint(), item, url(), QList<QAction*>());
 }