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
KBackup
Commits
35b9b87e
Commit
35b9b87e
authored
Aug 20, 2022
by
Laurent Montel
Browse files
Port away from deprecated KIO code
parent
23da6bb6
Pipeline
#220605
passed with stage
in 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Selector.cxx
View file @
35b9b87e
...
...
@@ -22,7 +22,12 @@
#include
<KIO/ApplicationLauncherJob>
#include
<KIO/OpenUrlJob>
#include
<kio_version.h>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
#include
<KIO/JobUiDelegateFactory>
#else
#include
<KIO/JobUiDelegate>
#endif
#include
<QDir>
#include
<QPixmap>
...
...
@@ -720,7 +725,11 @@ void Selector::open()
auto
*
job
=
new
KIO
::
OpenUrlJob
(
sourceUrl
,
window
());
job
->
setRunExecutables
(
false
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#endif
job
->
start
();
}
...
...
@@ -741,7 +750,11 @@ void Selector::openWith(QAction *action)
{
KIO
::
ApplicationLauncherJob
*
job
=
new
KIO
::
ApplicationLauncherJob
();
job
->
setUrls
(
QList
<
QUrl
>
()
<<
sourceUrl
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#endif
job
->
start
();
return
;
}
...
...
@@ -749,7 +762,11 @@ void Selector::openWith(QAction *action)
if
(
name
==
QLatin1String
(
"-"
)
)
// File Manager
{
KIO
::
OpenUrlJob
*
job
=
new
KIO
::
OpenUrlJob
(
sourceUrl
.
adjusted
(
QUrl
::
RemoveFilename
),
QStringLiteral
(
"inode/directory"
));
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#endif
job
->
start
();
return
;
...
...
@@ -758,7 +775,11 @@ void Selector::openWith(QAction *action)
KService
::
Ptr
service
=
serviceForName
[
name
];
KIO
::
ApplicationLauncherJob
*
job
=
new
KIO
::
ApplicationLauncherJob
(
service
);
job
->
setUrls
(
QList
<
QUrl
>
()
<<
sourceUrl
);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 98, 0)
job
->
setUiDelegate
(
KIO
::
createDefaultJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#else
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
#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