diff options
| author | Kai Uwe Broulik <[email protected]> | 2025-09-01 16:46:39 +0200 |
|---|---|---|
| committer | Kai Uwe Broulik <[email protected]> | 2025-09-01 16:46:39 +0200 |
| commit | 31f4c03aaa91d4f87eae026fc7207011a0789ede (patch) | |
| tree | 06a853f21e1e5c4d19d2f2338cd9dd7f3790dd5b /src/trash | |
| parent | f087f7ecaff21b48428ea1a0750d529ec3878859 (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/trash')
| -rw-r--r-- | src/trash/dolphintrash.cpp | 6 |
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(); } |
