From 31f4c03aaa91d4f87eae026fc7207011a0789ede Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 1 Sep 2025 16:46:39 +0200 Subject: DolphinTrash: Only play emptied sound when it was emptied without error Also cancelling the confirmation results in a job finishing with error. --- src/trash/dolphintrash.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/trash/dolphintrash.cpp b/src/trash/dolphintrash.cpp index 8f57e6c00..ae3f1e20c 100644 --- a/src/trash/dolphintrash.cpp +++ b/src/trash/dolphintrash.cpp @@ -80,7 +80,11 @@ void Trash::empty(QWidget *window) { using Iface = KIO::AskUserActionInterface; auto *emptyJob = new KIO::DeleteOrTrashJob(QList{}, Iface::EmptyTrash, Iface::DefaultConfirmation, window); - QObject::connect(emptyJob, &KIO::Job::result, notifyEmptied); + QObject::connect(emptyJob, &KIO::Job::result, emptyJob, [emptyJob] { + if (!emptyJob->error()) { + notifyEmptied(); + } + }); emptyJob->start(); } -- cgit v1.3