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
Network
Konqueror
Commits
9de7e6dc
Commit
9de7e6dc
authored
Nov 15, 2020
by
Alexander Lohnau
💬
Browse files
Add terminal action to context menu
parent
df3f50f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
libkonq/src/konq_popupmenu.cpp
View file @
9de7e6dc
...
...
@@ -44,12 +44,14 @@
#include <KIO/JobUiDelegate>
#include <KIO/RestoreJob>
#include <KIO/CommandLauncherJob>
#include <kio_version.h>
#include <KIO/OpenUrlJob>
#include <KFileCopyToMenu>
#include <KJobWidgets>
#include <KJobUiDelegate>
#include <KMimeTypeEditor>
#include <KPluginMetaData>
#include <KToolInvocation>
#include <QIcon>
#include <QFileInfo>
...
...
@@ -396,7 +398,19 @@ void KonqPopupMenuPrivate::populate()
}
// Second block, builtin + user
#if KIO_VERSION < QT_VERSION_CHECK(5, 77, 0)
m_menuActions
.
addServiceActionsTo
(
q
);
#else
QList
<
QAction
*>
additionalActions
;
if
(
isDirectory
&&
m_popupItemProperties
.
items
().
count
()
==
1
)
{
QAction
*
openTerminalHere
=
new
QAction
(
QIcon
::
fromTheme
(
"utilities-terminal"
),
i18n
(
"Open Terminal Here"
),
m_parentWidget
);
QObject
::
connect
(
openTerminalHere
,
&
QAction
::
triggered
,
q
,
[
this
]()
{
KToolInvocation
::
invokeTerminal
(
QString
(),
m_popupItemProperties
.
urlList
().
constFirst
().
toLocalFile
());
});
additionalActions
<<
openTerminalHere
;
}
m_menuActions
.
addServiceActionsTo
(
q
,
additionalActions
);
#endif
q
->
addSeparator
();
...
...
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