┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/trash/dolphintrash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/trash/dolphintrash.cpp')
-rw-r--r--src/trash/dolphintrash.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/trash/dolphintrash.cpp b/src/trash/dolphintrash.cpp
index b37a7430d..007f48a33 100644
--- a/src/trash/dolphintrash.cpp
+++ b/src/trash/dolphintrash.cpp
@@ -13,13 +13,8 @@
#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 <kio_version.h>
Trash::Trash()
: m_trashDirLister(new KDirLister())
@@ -62,22 +57,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()