Commit f344b900 authored by Eugene Popov's avatar Eugene Popov 🇺🇦
Browse files

[WelcomeView] Improve locating a file in the file manager

Use KIO::highlightInFileManager to highlight a file in the file manager.
parent 2faca962
Pipeline #241143 passed with stage
in 6 minutes and 18 seconds
......@@ -8,10 +8,10 @@
#include <KIconLoader>
#include <KSharedConfig>
#include <KIO/OpenFileManagerWindowJob>
#include <QAction>
#include <QClipboard>
#include <QDesktopServices>
#include <QDir>
#include <QGraphicsOpacityEffect>
#include <QGuiApplication>
......@@ -83,10 +83,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);
......
Supports Markdown
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