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
Konsole
Commits
fc45802b
Commit
fc45802b
authored
Aug 21, 2022
by
Laurent Montel
Browse files
Port away from deprecated KIO code
parent
aa320d81
Pipeline
#220956
passed with stage
in 2 minutes and 22 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/filterHotSpots/EscapeSequenceUrlFilterHotSpot.cpp
View file @
fc45802b
...
...
@@ -7,7 +7,12 @@
#include
"EscapeSequenceUrlFilterHotSpot.h"
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<KIO/OpenUrlJob>
#include
<QApplication>
...
...
@@ -31,6 +36,10 @@ void EscapeSequenceUrlHotSpot::activate(QObject *obj)
Q_UNUSED
(
obj
)
auto
*
job
=
new
KIO
::
OpenUrlJob
(
QUrl
(
_url
));
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#endif
job
->
start
();
}
src/filterHotSpots/FileFilterHotspot.cpp
View file @
fc45802b
...
...
@@ -25,7 +25,12 @@
#include
<KIO/OpenUrlJob>
#include
<KFileItemListProperties>
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<KLocalizedString>
#include
<KMessageBox>
#include
<KShell>
...
...
@@ -127,7 +132,11 @@ void FileFilterHotSpot::activate(QObject *)
void
FileFilterHotSpot
::
openWithSysDefaultApp
(
const
QString
&
filePath
)
const
{
auto
*
job
=
new
KIO
::
OpenUrlJob
(
QUrl
::
fromLocalFile
(
filePath
));
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#endif
job
->
setRunExecutables
(
false
);
// Always open scripts, shell/python/perl... etc, as text
job
->
start
();
}
...
...
src/session/SessionController.cpp
View file @
fc45802b
...
...
@@ -46,7 +46,12 @@
#include
<KIO/CommandLauncherJob>
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<KIO/OpenFileManagerWindowJob>
#include
<KIO/OpenUrlJob>
...
...
@@ -552,7 +557,11 @@ void SessionController::handleWebShortcutAction(QAction *action)
const
QUrl
url
=
filterData
.
uri
();
auto
*
job
=
new
KIO
::
OpenUrlJob
(
url
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#endif
job
->
start
();
}
}
...
...
@@ -1159,7 +1168,11 @@ void SessionController::openBrowser()
}
else
{
const
QUrl
currentUrl
=
url
().
isLocalFile
()
?
url
()
:
QUrl
::
fromLocalFile
(
QDir
::
homePath
());
auto
*
job
=
new
KIO
::
OpenUrlJob
(
currentUrl
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
QApplication
::
activeWindow
()));
#endif
job
->
start
();
}
}
...
...
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