Bug 357042 - Empty trash twice, trash stop work.
Summary: Empty trash twice, trash stop work.
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: trash (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR grave
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 357023 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-22 13:42 UTC by Cjacker
Modified: 2015-12-23 03:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cjacker 2015-12-22 13:42:54 UTC
Empty trash twice, trash stop work, happened every time.

Reproducible: Always

Steps to Reproduce:
In dolphin or DesktopView with trash.desktop.

1. Create a new text file, right click to move to trash, then empty trash
2. Again, create a new text file, right click to move to trash, then empty trash.

now, trash stop work:
1, if click the trash.desktop in DesktopView, kuiserver5 will show "Examinning" "trash:/" and never finished.
2, Can not move any file to trash again.




qt-5.5.1/framework 5.17/plamsa-5.4.3.
Comment 1 Cjacker 2015-12-22 14:24:20 UTC
This issue also affect 'ktrash5 --empty', 'ktrash5 --empty' will hang every time.

The root cause is in 'slotFinished' of 'emptytrashjob', here is a fix:

diff -Nur kio-5.16.0/src/core/emptytrashjob.cpp kio-5.16.0new/src/core/emptytrashjob.cpp
--- kio-5.16.0/src/core/emptytrashjob.cpp   2015-11-08 20:26:59.000000000 +0800
+++ kio-5.16.0new/src/core/emptytrashjob.cpp    2015-12-22 22:13:06.806386994 +0800
@@ -55,6 +55,10 @@
 {
     //KNotification::event("Trash: emptied", QString(), QPixmap(), 0, KNotification::DefaultEvent);
     org::kde::KDirNotify::emitFilesAdded(QUrl(QStringLiteral("trash:/")));
+    Q_D(EmptyTrashJob);
+    //Return slave to the scheduler
+    SimpleJob::slotFinished();
+
 }

 KIO::EmptyTrashJob *KIO::emptyTrash()
Comment 2 Leslie Zhai 2015-12-22 14:44:24 UTC
*** Bug 357023 has been marked as a duplicate of this bug. ***
Comment 3 Cjacker 2015-12-23 03:03:59 UTC
Patch already submitted with help of Leslie.

https://git.reviewboard.kde.org/r/126473/

mark as fixed.