mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
[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
This commit is contained in:
parent
289ef9fa49
commit
8f10b5540c
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue