diff --git a/components/mobileshell/notifications/notificationfilemenu.cpp b/components/mobileshell/notifications/notificationfilemenu.cpp index 6e4b0ba1..757139a5 100644 --- a/components/mobileshell/notifications/notificationfilemenu.cpp +++ b/components/mobileshell/notifications/notificationfilemenu.cpp @@ -25,10 +25,7 @@ #include #include -#include // for KIO::trash -#include -#include -#include +#include #include NotificationFileMenu::NotificationFileMenu(QObject *parent) @@ -148,12 +145,8 @@ void NotificationFileMenu::open(int x, int y) auto moveToTrashLambda = [this] { const QList urls{m_url}; - KIO::JobUiDelegate uiDelegate; - if (uiDelegate.askDeleteConfirmation(urls, KIO::JobUiDelegate::Trash, KIO::JobUiDelegate::DefaultConfirmation)) { - auto *job = KIO::trash(urls); - job->uiDelegate()->setAutoErrorHandlingEnabled(true); - KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Trash, urls, QUrl(QStringLiteral("trash:/")), job); - } + auto *job = new KIO::DeleteOrTrashJob(urls, KIO::AskUserActionInterface::Trash, KIO::AskUserActionInterface::DefaultConfirmation, this); + job->start(); }; auto moveToTrashAction = KStandardAction::moveToTrash(this, moveToTrashLambda, menu); moveToTrashAction->setShortcut({}); // Can't focus notification to press Delete @@ -167,11 +160,8 @@ void NotificationFileMenu::open(int x, int y) auto deleteLambda = [this] { const QList urls{m_url}; - KIO::JobUiDelegate uiDelegate; - if (uiDelegate.askDeleteConfirmation(urls, KIO::JobUiDelegate::Delete, KIO::JobUiDelegate::DefaultConfirmation)) { - auto *job = KIO::del(urls); - job->uiDelegate()->setAutoErrorHandlingEnabled(true); - } + auto *job = new KIO::DeleteOrTrashJob(urls, KIO::AskUserActionInterface::Delete, KIO::AskUserActionInterface::DefaultConfirmation, this); + job->start(); }; auto deleteAction = KStandardAction::deleteFile(this, deleteLambda, menu); deleteAction->setShortcut({});