┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/trash
diff options
context:
space:
mode:
authorJakob Petsovits <[email protected]>2023-05-12 16:56:36 -0400
committerJakob Petsovits <[email protected]>2023-05-12 16:56:36 -0400
commit1b0caf69a845d0a68c3d8d1a6bdf98568a673501 (patch)
treec67f1558a531f4f5f3358320d52b1436c35af85a /src/trash
parentac1f8131f9defa2e949804dc621f082b069c0e4b (diff)
Remove deprecated, ifdef'd code for old KIO versions
Diffstat (limited to 'src/trash')
-rw-r--r--src/trash/dolphintrash.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/trash/dolphintrash.cpp b/src/trash/dolphintrash.cpp
index e1530bfae..ea13100c6 100644
--- a/src/trash/dolphintrash.cpp
+++ b/src/trash/dolphintrash.cpp
@@ -9,17 +9,11 @@
#include <KConfig>
#include <KConfigGroup>
+#include <KIO/DeleteOrTrashJob>
#include <KLocalizedString>
#include <KNotification>
-#include <QList>
-#include <kio_version.h>
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
-#include <KIO/DeleteOrTrashJob>
-#else
-#include <KIO/JobUiDelegate>
-#include <KJobWidgets>
-#endif
+#include <QList>
Trash::Trash()
: m_trashDirLister(new KDirLister())
@@ -62,22 +56,10 @@ static void notifyEmptied()
void Trash::empty(QWidget *window)
{
-#if KIO_VERSION >= QT_VERSION_CHECK(5, 100, 0)
using Iface = KIO::AskUserActionInterface;
auto *emptyJob = new KIO::DeleteOrTrashJob(QList<QUrl>{}, Iface::EmptyTrash, Iface::DefaultConfirmation, window);
QObject::connect(emptyJob, &KIO::Job::result, notifyEmptied);
emptyJob->start();
-#else
- KIO::JobUiDelegate uiDelegate;
- uiDelegate.setWindow(window);
- bool confirmed = uiDelegate.askDeleteConfirmation(QList<QUrl>(), KIO::JobUiDelegate::EmptyTrash, KIO::JobUiDelegate::DefaultConfirmation);
- if (confirmed) {
- KIO::Job *job = KIO::emptyTrash();
- KJobWidgets::setWindow(job, window);
- job->uiDelegate()->setAutoErrorHandlingEnabled(true);
- QObject::connect(job, &KIO::Job::result, notifyEmptied);
- }
-#endif
}
bool Trash::isEmpty()