Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
a158926a
Commit
a158926a
authored
Jan 21, 2022
by
Tomaz Canabrava
Committed by
Tomaz Canabrava
Feb 05, 2022
Browse files
Launch dolphin on "Open With File Manager" under a file
parent
b3eb91d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/filterHotSpots/FileFilterHotspot.h
View file @
a158926a
...
...
@@ -33,6 +33,7 @@ class TerminalDisplay;
*/
class
FileFilterHotSpot
:
public
RegExpFilterHotSpot
{
Q_OBJECT
public:
FileFilterHotSpot
(
int
startLine
,
int
startColumn
,
int
endLine
,
int
endColumn
,
const
QStringList
&
capturedTexts
,
const
QString
&
filePath
,
Session
*
session
);
~
FileFilterHotSpot
()
override
;
...
...
@@ -46,6 +47,7 @@ public:
QList
<
QAction
*>
setupMenu
(
QMenu
*
menu
)
override
;
KFileItem
fileItem
()
const
;
void
requestThumbnail
(
Qt
::
KeyboardModifiers
modifiers
,
const
QPoint
&
pos
);
void
thumbnailRequested
();
...
...
src/session/SessionController.cpp
View file @
a158926a
...
...
@@ -65,6 +65,7 @@
#include
"filterHotSpots/ColorFilter.h"
#include
"filterHotSpots/EscapeSequenceUrlFilter.h"
#include
"filterHotSpots/FileFilter.h"
#include
"filterHotSpots/FileFilterHotspot.h"
#include
"filterHotSpots/Filter.h"
#include
"filterHotSpots/FilterChain.h"
#include
"filterHotSpots/HotSpot.h"
...
...
@@ -1109,6 +1110,23 @@ void SessionController::closeSession()
// 2) transform url to get the desired result (ssh -> sftp, etc)
void
SessionController
::
openBrowser
()
{
// if we requested the browser on a file, we can't use OpenUrlJob
// because it does not open the file in a browser, it opens another program
// based on it's mime type.
// so force open dolphin with it selected.
// TODO: and for people that have other default file browsers such as
// konqueror and krusader?
if
(
_currentHotSpot
&&
_currentHotSpot
->
type
()
==
HotSpot
::
File
)
{
auto
*
fileHotSpot
=
qobject_cast
<
FileFilterHotSpot
*>
(
_currentHotSpot
.
get
());
assert
(
fileHotSpot
);
fileHotSpot
->
fileItem
().
url
();
auto
job
=
new
KIO
::
CommandLauncherJob
(
QStringLiteral
(
"dolphin"
),
{
fileHotSpot
->
fileItem
().
url
().
toLocalFile
(),
QStringLiteral
(
"--select"
)});
job
->
start
();
return
;
}
const
QUrl
currentUrl
=
url
().
isLocalFile
()
?
url
()
:
QUrl
::
fromLocalFile
(
QDir
::
homePath
());
auto
*
job
=
new
KIO
::
OpenUrlJob
(
currentUrl
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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