┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKai Uwe Broulik <[email protected]>2025-09-01 16:46:39 +0200
committerKai Uwe Broulik <[email protected]>2025-09-01 16:46:39 +0200
commit31f4c03aaa91d4f87eae026fc7207011a0789ede (patch)
tree06a853f21e1e5c4d19d2f2338cd9dd7f3790dd5b /src
parentf087f7ecaff21b48428ea1a0750d529ec3878859 (diff)
DolphinTrash: Only play emptied sound when it was emptied without error
Also cancelling the confirmation results in a job finishing with error.
Diffstat (limited to 'src')
-rw-r--r--src/trash/dolphintrash.cpp6
1 files changed, 5 insertions, 1 deletions
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<QUrl>{}, 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();
}