]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Select and scroll to the file for "Open path" and "Open Path in New Window" operations
authorNathaniel Graham <nate@kde.org>
Mon, 26 Mar 2018 00:06:46 +0000 (18:06 -0600)
committerNathaniel Graham <nate@kde.org>
Mon, 9 Apr 2018 23:02:09 +0000 (17:02 -0600)
Summary:
After performing a search and using  the "Open path" or "Open Path in New Window"  present in the context menu, make sure the file is selected and visible in the resulting view.

Cannot implement the same fix for "Open Path in New Tab" because of a limitation in how the contents of inactive tabs are rendered; will need to fix that separately in another patch.

BUG: 377510

Test Plan: Search for an item, and choose {nav Open Path} or {nav Open path in new window}

Reviewers: #dolphin, elvisangelaccio

Reviewed By: #dolphin, elvisangelaccio

Subscribers: elvisangelaccio, broulik

Differential Revision: https://phabricator.kde.org/D11703

src/dolphinmainwindow.cpp

index 65c57ef7d242af69699f7f9c6fcd1e06511c5719..b826a3bd2e682d06082b9c483d8bc4f563089609 100644 (file)
@@ -821,10 +821,12 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
     switch (command) {
     case DolphinContextMenu::OpenParentFolder:
         changeUrl(KIO::upUrl(item.url()));
+        m_activeViewContainer->view()->markUrlsAsSelected({item.url()});
+        m_activeViewContainer->view()->markUrlAsCurrent(item.url());
         break;
 
     case DolphinContextMenu::OpenParentFolderInNewWindow:
-        Dolphin::openNewWindow({KIO::upUrl(item.url())}, this);
+        Dolphin::openNewWindow({item.url()}, this, Dolphin::OpenNewWindowFlag::Select);
         break;
 
     case DolphinContextMenu::OpenParentFolderInNewTab: