Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
f344b900
Commit
f344b900
authored
Oct 03, 2022
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/lib/welcomeview.cpp
View file @
f344b900
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment