From f2db7b5288ede845ed56d85a55504e68dd75b613 Mon Sep 17 00:00:00 2001 From: Eugene Popov Date: Tue, 4 Oct 2022 21:05:39 +0000 Subject: [PATCH] [WelcomeView] Improve locating a file in the file manager Use KIO::highlightInFileManager to highlight a file in the file manager. --- shell/welcomescreen.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shell/welcomescreen.cpp b/shell/welcomescreen.cpp index 62faac1fc..128abd7a2 100644 --- a/shell/welcomescreen.cpp +++ b/shell/welcomescreen.cpp @@ -7,13 +7,12 @@ #include "welcomescreen.h" #include +#include #include #include #include #include -#include -#include #include #include #include @@ -79,10 +78,7 @@ public: showDirectoryAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open-folder"))); connect(showDirectoryAction, &QAction::triggered, this, [item]() { if (item->url.isLocalFile()) { - QFileInfo fileInfo(item->url.toLocalFile()); - QDir parentDir = fileInfo.dir(); - QUrl parentDirUrl = QUrl::fromLocalFile(parentDir.absolutePath()); - QDesktopServices::openUrl(parentDirUrl); + KIO::highlightInFileManager({item->url}); } }); menu.addAction(showDirectoryAction);