Bug 368104

Summary: files/folders in trash get copied to /tmp while previews are generated
Product: [Frameworks and Libraries] frameworks-kio Reporter: Wolfgang Bauer <wbauer1>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: agsimmons0, bugseforuns, dolphin-bugs-null, eduardosanchezmunoz, hotmusicfan, jtamate, kde, kdelibs-bugs, meven29, nate, philippe.roubach, suse
Priority: NOR    
Version: 5.66.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
URL: http://bugzilla.opensuse.org/show_bug.cgi?id=969768
Latest Commit: Version Fixed In: 5.98
Sentry Crash Report:

Description Wolfgang Bauer 2016-09-01 13:17:55 UTC
See also http://bugzilla.opensuse.org/show_bug.cgi?id=969768

If you open the trash in dolphin and hover over files/folders, they get copied to /tmp if previews are enabled (globally and for the corresponding filetype).

This is especially annoying if you happen to have large folders in the trash because previews for folders is turned on by default in default. And in this case, the files/folders in /tmp are not even deleted and even copied again every time you move the mouse over one.

The same happens in the file open/save dialog too.
Comment 1 Wolfgang Bauer 2016-09-01 13:19:04 UTC
I CC'ed the dolphin maintainers too, so that they know about the problem in case similar bug reports get filed against dolphin.
Comment 2 suse 2018-03-28 19:23:57 UTC
I can confirm mostly comment#1, but my test case is a little bit different.

Test case:
1. Five mpeg files trashed, each ~400-1200 MB.
2. go to trash:/ in dolphin.
3. Open a second dolphin window to see the free space information (of /tmp) in the status bar.
4. Turn on preview (in the first dolphin window).
5. All mpeg files will be copied sequentially to /tmp, preview generated and deleted afterwards.
6. You can watch the free space information going down and up dependent of the size of the trashed files.

Re-trigger the test case: (the preview pictures are cached.)
Restore the files, rename them and then start with #1 again.

Plasma: 5.12.3
Framework: 5.44.0
Application: 17.12.3
Comment 3 Jaime Torres 2018-04-26 08:22:20 UTC
Detailed code analysis:

In PreviewJobPrivate::getOrCreateThumbnail, as the KFileItem item localPath() is empty, the copy takes place.
And a KFileItem has localPath() empty if there is no KIO::UDSEntry::UDS_LOCAL_PATH in the UDSEntry.
Comment 4 Patrick Silva 2018-08-05 17:08:06 UTC
*** Bug 397165 has been marked as a duplicate of this bug. ***
Comment 5 Wolfgang Bauer 2020-01-25 12:28:54 UTC
*** Bug 415924 has been marked as a duplicate of this bug. ***
Comment 6 Philippe ROUBACH 2021-02-05 08:19:06 UTC
Please I get recently a non responded system due to a full / partition. Happily I get a backup system. I was able to repair /tmp.

kde apps 20.12.2
kde plasma 5.20.5
kde frameworks 5.78.0
qt 5.15.2

Please it's a 5 years old problem. Freezing your system is a blocking bug.
Comment 7 Patrick Silva 2021-10-25 00:01:29 UTC
*** Bug 444349 has been marked as a duplicate of this bug. ***
Comment 8 Eduardo Sánchez Muñoz 2021-10-25 17:04:00 UTC
I wonder why trash files are copied to /tmp to make the thumbnails. They are just regular files in ~/.local/share/Trash and they can be read without needing to copy them elsewhere.
Comment 9 Eduardo Sánchez Muñoz 2021-10-25 17:38:40 UTC
It created MR https://invent.kde.org/frameworks/kio/-/merge_requests/617 to fix this bug
Comment 10 Bug Janitor Service 2021-10-26 07:56:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/618
Comment 11 Bug Janitor Service 2021-10-26 07:56:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/618
Comment 12 Méven Car 2021-11-28 19:52:32 UTC
Git commit dedf0ee37f16c587826cf6ad9a6e6cec241a8d37 by Méven Car, on behalf of Eduardo Sánchez Muñoz.
Committed on 28/11/2021 at 19:46.
Pushed by meven into branch 'master'.

Do not create thumbnails when it requires to copy the file to /tmp

M  +5    -17   src/widgets/previewjob.cpp

https://invent.kde.org/frameworks/kio/commit/dedf0ee37f16c587826cf6ad9a6e6cec241a8d37
Comment 13 Patrick Silva 2021-12-04 11:40:28 UTC
The 'fix' seems a regresion to me. Now Trash does not generate any preview, what makes impossible to find the exact file I want to restore
when my Trash has lots of files with random names.
Comment 14 Eduardo Sánchez Muñoz 2021-12-04 15:59:14 UTC
I still think it is better than filling then RAM and crashing the whole OS.

There is https://invent.kde.org/frameworks/kio/-/merge_requests/618, which should bring back trash thumbnails without needing to copy anything to /tmp.
Comment 15 Kai Uwe Broulik 2021-12-11 11:44:20 UTC
Not just trash, I dont see any thumbnails on any remote location anymore.
Comment 16 Patrick Silva 2022-01-09 17:16:24 UTC
The 'fix' was reverted in frameworks 5.90 and this bug persists.
Comment 17 Méven Car 2022-05-26 08:04:36 UTC
Git commit 4984b26849e2d1f182bf6a60216848ae9307295a by Méven Car, on behalf of Méven Car.
Committed on 26/05/2022 at 07:21.
Pushed by meven into branch 'master'.

trash:/ set the UDS_LOCAL_PATH

M  +2    -1    src/ioslaves/trash/kio_trash.cpp
M  +1    -1    src/ioslaves/trash/tests/testtrash.cpp

https://invent.kde.org/frameworks/kio/commit/4984b26849e2d1f182bf6a60216848ae9307295a
Comment 18 Patrick Silva 2022-06-14 15:20:08 UTC
This bug persists at least with .jpg files after update to frameworks 5.95.

Operating System: Arch Linux
KDE Plasma Version: 5.25.0
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4
Graphics Platform: Wayland
Comment 19 Philippe ROUBACH 2022-06-15 05:52:42 UTC
I confirm. The problem is still there for movies (ts, mp4).

It seems this problem occurs with movies you fly over with mouse cursor.
Comment 20 Méven Car 2022-08-21 09:15:04 UTC
Git commit 1773ee3e8ae224b4a3536b403439e7e3b7c6f53e by Méven Car.
Committed on 21/08/2022 at 09:15.
Pushed by meven into branch 'master'.

trash:/ set the UDS_LOCAL_PATH

Should fix test regression:
https://build.kde.org/job/Frameworks/job/kio/job/kf5-qt5%20SUSEQt5.15/1586/testReport/projectroot.src.ioslaves.trash/tests/testtrash/

cc https://invent.kde.org/frameworks/kio/-/merge_requests/618#note_457689

M  +15   -3    autotests/dropjobtest.cpp
M  +12   -7    src/core/copyjob.cpp
M  +2    -1    src/ioslaves/trash/kio_trash.cpp
M  +11   -5    src/ioslaves/trash/tests/testtrash.cpp

https://invent.kde.org/frameworks/kio/commit/1773ee3e8ae224b4a3536b403439e7e3b7c6f53e
Comment 21 Méven Car 2022-08-23 19:21:43 UTC
(In reply to Philippe ROUBACH from comment #19)
> I confirm. The problem is still there for movies (ts, mp4).
> 
> It seems this problem occurs with movies you fly over with mouse cursor.

The previous patch 4984b26849e2d1f182bf6a60216848ae9307295a was reverted the new one should arrive in KF 5.98 provided testing goes well.