Commit 8f10b554 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[DolphinContextMenu] Use the view's already existing root KFileItem

Saves creating a new KFileItem from scratch which stats the file.
Only when the root item isn't available (as can happen when you're currently looking at an non-existing directory)
will it create a new KFileItem

Differential Revision: https://phabricator.kde.org/D15266
parent 289ef9fa
......@@ -341,7 +341,12 @@ void DolphinContextMenu::openViewportContextMenu()
addSeparator();
// Insert 'Open With' entries
const KFileItemListProperties baseUrlProperties(KFileItemList() << baseFileItem());
KFileItem baseItem = view->rootItem();
if (baseItem.isNull() || baseItem.url() != m_baseUrl) {
baseItem = baseFileItem();
}
const KFileItemListProperties baseUrlProperties(KFileItemList() << baseItem);
KFileItemActions fileItemActions;
fileItemActions.setParentWidget(m_mainWindow);
fileItemActions.setItemListProperties(baseUrlProperties);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment