Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
Konsole
Commits
2fd589f1
Commit
2fd589f1
authored
Oct 04, 2020
by
Ahmad Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port KRun (deprecated) to KIO::OpenUrlJob
parent
2c1ec710
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
10 deletions
+51
-10
src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.cpp
src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.cpp
+13
-0
src/filterHotSpots/UrlFilterHotspot.cpp
src/filterHotSpots/UrlFilterHotspot.cpp
+14
-1
src/session/Session.cpp
src/session/Session.cpp
+0
-1
src/session/SessionController.cpp
src/session/SessionController.cpp
+24
-8
No files found.
src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.cpp
View file @
2fd589f1
...
...
@@ -20,7 +20,14 @@
#include "EscapeSequenceUrlFilterHotSpot.h"
#include <kio_version.h>
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
#include <KRun>
#else
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#endif
#include <QApplication>
#include <QMouseEvent>
#include <QDebug>
...
...
@@ -47,5 +54,11 @@ void EscapeSequenceUrlHotSpot::activate(QObject *obj)
{
Q_UNUSED
(
obj
)
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
new
KRun
(
QUrl
(
_url
),
QApplication
::
activeWindow
());
#else
auto
*
job
=
new
KIO
::
OpenUrlJob
(
QUrl
(
_url
));
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
job
->
start
();
#endif
}
src/filterHotSpots/UrlFilterHotspot.cpp
View file @
2fd589f1
...
...
@@ -20,6 +20,14 @@
#include "UrlFilterHotspot.h"
#include <kio_version.h>
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
#include <KRun>
#else
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#endif
#include <QAction>
#include <QApplication>
#include <QClipboard>
...
...
@@ -27,7 +35,6 @@
#include <QIcon>
#include <KLocalizedString>
#include <KRun>
#include <QMouseEvent>
#include "UrlFilter.h"
...
...
@@ -91,7 +98,13 @@ void UrlFilterHotSpot::activate(QObject *object)
url
.
prepend
(
QLatin1String
(
"mailto:"
));
}
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
new
KRun
(
QUrl
(
url
),
QApplication
::
activeWindow
());
#else
auto
*
job
=
new
KIO
::
OpenUrlJob
(
QUrl
(
url
));
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
job
->
start
();
#endif
}
}
...
...
src/session/Session.cpp
View file @
2fd589f1
...
...
@@ -40,7 +40,6 @@
// KDE
#include <KLocalizedString>
#include <KNotification>
#include <KRun>
#include <KShell>
#include <KProcess>
#include <KConfigGroup>
...
...
src/session/SessionController.cpp
View file @
2fd589f1
...
...
@@ -41,7 +41,6 @@
#include <KActionCollection>
#include <KLocalizedString>
#include <KMessageBox>
#include <KRun>
#include <KShell>
#include <KToggleAction>
#include <KSelectAction>
...
...
@@ -56,6 +55,14 @@
#include <KNotification>
#include <KIO/CommandLauncherJob>
#include <kio_version.h>
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
#include <KRun>
#else
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#endif
// Konsole
#include "CopyInputDialog.h"
#include "Emulation.h"
...
...
@@ -534,8 +541,15 @@ void SessionController::handleWebShortcutAction()
KUriFilterData
filterData
(
action
->
data
().
toString
());
if
(
KUriFilter
::
self
()
->
filterUri
(
filterData
,
{
QStringLiteral
(
"kurisearchfilter"
)
}))
{
const
QUrl
&
url
=
filterData
.
uri
();
const
QUrl
url
=
filterData
.
uri
();
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
new
KRun
(
url
,
QApplication
::
activeWindow
());
#else
auto
*
job
=
new
KIO
::
OpenUrlJob
(
url
);
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
job
->
start
();
#endif
}
}
...
...
@@ -1058,13 +1072,15 @@ void SessionController::closeSession()
// 2) transform url to get the desired result (ssh -> sftp, etc)
void
SessionController
::
openBrowser
()
{
const
QUrl
currentUrl
=
url
();
const
QUrl
currentUrl
=
url
()
.
isLocalFile
()
?
url
()
:
QUrl
::
fromLocalFile
(
QDir
::
homePath
())
;
if
(
currentUrl
.
isLocalFile
())
{
new
KRun
(
currentUrl
,
QApplication
::
activeWindow
(),
true
);
}
else
{
new
KRun
(
QUrl
::
fromLocalFile
(
QDir
::
homePath
()),
QApplication
::
activeWindow
(),
true
);
}
#if KIO_VERSION < QT_VERSION_CHECK(5, 71, 0)
new
KRun
(
currentUrl
,
QApplication
::
activeWindow
(),
true
);
#else
auto
*
job
=
new
KIO
::
OpenUrlJob
(
currentUrl
);
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
job
->
start
();
#endif
}
void
SessionController
::
copy
()
...
...
Write
Preview
Markdown
is supported
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