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
Graphics
Gwenview
Commits
0de73c4d
Commit
0de73c4d
authored
Nov 11, 2022
by
Volker Krause
Committed by
Albert Astals Cid
Nov 15, 2022
Browse files
Restore compatibility with KF5 < 5.100
parent
e404516c
Pipeline
#268462
passed with stage
in 1 minute and 52 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
app/fileoperations.cpp
View file @
0de73c4d
...
...
@@ -27,9 +27,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include
<QPushButton>
// KF
#include
"kio_version.h"
#include
<KIO/CopyJob>
#include
<KIO/DeleteJob>
#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
#include
<KIO/DeleteOrTrashJob>
#endif
#include
<KIO/Job>
#include
<KIO/JobUiDelegate>
#include
<KJobWidgets>
...
...
@@ -134,6 +137,24 @@ static void delOrTrash(KIO::JobUiDelegate::DeletionType deletionType, const QLis
{
Q_ASSERT
(
urlList
.
count
()
>
0
);
#if KIO_VERSION < QT_VERSION_CHECK(5, 100, 0)
KIO
::
JobUiDelegate
uiDelegate
;
uiDelegate
.
setWindow
(
parent
);
if
(
!
uiDelegate
.
askDeleteConfirmation
(
urlList
,
deletionType
,
KIO
::
JobUiDelegate
::
DefaultConfirmation
))
{
return
;
}
KIO
::
Job
*
job
=
nullptr
;
switch
(
deletionType
)
{
case
KIO
::
JobUiDelegate
::
Trash
:
job
=
KIO
::
trash
(
urlList
);
break
;
case
KIO
::
JobUiDelegate
::
Delete
:
job
=
KIO
::
del
(
urlList
);
break
;
default:
// e.g. EmptyTrash
return
;
}
#else
KJob
*
job
=
nullptr
;
switch
(
deletionType
)
{
case
KIO
::
JobUiDelegate
::
Trash
:
...
...
@@ -145,6 +166,7 @@ static void delOrTrash(KIO::JobUiDelegate::DeletionType deletionType, const QLis
default:
// e.g. EmptyTrash
return
;
}
#endif
Q_ASSERT
(
job
);
KJobWidgets
::
setWindow
(
job
,
parent
);
...
...
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