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
de86be5e
Commit
de86be5e
authored
Mar 03, 2022
by
Nicolas Fella
Browse files
Port away from deprecated KToolInvocation::invokeTerminal
parent
073dddf8
Pipeline
#144857
failed with stage
in 2 minutes and 25 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
addons/project/kateprojecttreeviewcontextmenu.cpp
View file @
de86be5e
...
...
@@ -19,6 +19,7 @@
#include
<KNS3/KMoreTools>
#include
<KNS3/KMoreToolsMenuFactory>
#include
<KPropertiesDialog>
#include
<KTerminalLauncherJob>
#include
<QAction>
#include
<QApplication>
...
...
@@ -33,7 +34,6 @@
#include
<QMimeType>
#include
<QStandardPaths>
#include
<KToolInvocation>
#include
<ktexteditor/editor.h>
#include
<ktexteditor/application.h>
...
...
@@ -180,11 +180,13 @@ void KateProjectTreeViewContextMenu::exec(const QString &filename, const QModelI
}
else
if
(
action
==
terminal
)
{
// handle "open terminal here"
QFileInfo
checkFile
(
filename
);
auto
*
job
=
new
KTerminalLauncherJob
(
QString
());
if
(
checkFile
.
isFile
())
{
KToolInvocation
::
invokeTerminal
(
QString
(),
{},
checkFile
.
absolutePath
());
job
->
setWorkingDirectory
(
checkFile
.
absolutePath
());
}
else
{
KToolInvocation
::
invokeTerminal
(
QString
(),
{},
filename
);
job
->
setWorkingDirectory
(
filename
);
}
job
->
start
();
}
else
if
(
action
->
parentWidget
()
==
openWithMenu
)
{
// handle "open with"
handleOpenWith
(
action
,
filename
);
...
...
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