Update the "Move to Trash" action's and the "Delete" action's

enabled state in the context menu for read only files/folders (also
archives).

BUG: 294013
FIXED-IN: 4.11
REVIEW: 111160
This commit is contained in:
Emmanuel Pescosta 2013-06-22 14:04:45 +02:00
parent 4e80918a44
commit 4cd231838d
2 changed files with 8 additions and 1 deletions

View 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());
}
}

View 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*>());
}