Bug 510500

Summary: Dolphin does not delete temp files
Product: [Applications] dolphin Reporter: Vadym Krevs <vkrevs>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugs.kde.org-97810000, dandyoctavian, dolphin-bugs-null, kdedev, kitts.mailinglists, meven, vkrevs
Priority: NOR    
Version First Reported In: 25.08.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Vadym Krevs 2025-10-11 18:32:35 UTC
SUMMARY
/tmp is full of dolphin.NNNNN temporary files.


STEPS TO REPRODUCE
1.  ls -alF -tr /tmp/dolphin.* | wc -l
2. Rename N files in Dolphin
3.   ls -alF -tr /tmp/dolphin.* | wc -l

OBSERVED RESULT
The number printed in step 3 is the number printed in step 1 plus N
EXPECTED RESULT
The number printed in step 3 is the same number as printed in step 1

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.6
KDE Plasma Version: 6.4.91
KDE Frameworks Version: 6.18.0
Qt Version: 6.10.0
Graphics Platform: X11
Comment 1 Méven 2025-10-15 15:44:10 UTC
ViewProperties have to use tmp to save view metadata due to a limitation in Kconfig.

Those files are supposed to be cleaned after use, apparently not correctly.

A KConfig path is underway to allow to lift this limitation and coincidentally fix this.

This still can be fixed in dolphin.

This has been discussed in
https://discuss.kde.org/t/dolphin-is-spamming-tmp/40585/6
Comment 2 Méven 2025-10-15 16:03:07 UTC
It does not seem renaming files is the explanation.

Or it depends on the method used to rename files.

I don't reproduce this easily.
Comment 3 Vadym Krevs 2025-10-15 18:37:02 UTC
Well, turns out all one needs to do is simply open dolphin in /tmp directory. I've done a quick screen recording reproducing the issue. No renames involved.  

https://www.youtube.com/watch?v=spMbL6VSOBU

P.S.: I cannot believe someone seriously suggested rebooting as a solution to this issue in that linked discuss.kde.org thread ...
Comment 4 Méven 2025-10-16 07:28:15 UTC
Is Opensuse using LTO for compilation ?

I know Fedora does, and this creates bugs due to LTO changing valid code to whatever sometimes.

> https://www.youtube.com/watch?v=spMbL6VSOBU

I don't reproduce simply opening /tmp in Arch.

You asked in the video why dolphin used files in /tmp, you could read my answer: https://bugs.kde.org/show_bug.cgi?id=510500#c1
Comment 5 Vadym Krevs 2025-10-16 18:45:37 UTC
(In reply to Méven from comment #4)
> Is Opensuse using LTO for compilation ?
> 
> I know Fedora does, and this creates bugs due to LTO changing valid code to
> whatever sometimes.
> 
> > https://www.youtube.com/watch?v=spMbL6VSOBU
> 
> I don't reproduce simply opening /tmp in Arch.
> 
> You asked in the video why dolphin used files in /tmp, you could read my
> answer: https://bugs.kde.org/show_bug.cgi?id=510500#c1

I recall reading somewhere that openSUSE Tumbleween does use LTO by default, but cannot find anything definitive regarding Leap which is what I am using.
Comment 6 Vadym Krevs 2025-10-24 08:13:49 UTC
Still not fixed in Plasma 6.5. I've deleted all these dolphin.* files manually and now when I open /tmp in Dolphin it is next to impossible to select any file with a mouse (to right click on it or delete, etc) whose name alphabetically follows dolphin.* - because the constant creation and deletion of dolphin.*** files in /tmp while /tmp is open in Dolphin makes all the file/directory icons shift randomly on the screen very rapidly.
Comment 7 bugs.kde.org-97810000 2025-10-25 21:05:08 UTC
This is reliably reproducable for me in Arch while using the current flatpak of dolphin.
Flatpak version: org.kde.dolphin 25.08.2
Comment 8 Méven 2025-10-27 11:07:19 UTC
(In reply to Vadym Krevs from comment #6)
> Still not fixed in Plasma 6.5. I've deleted all these dolphin.* files
> manually and now when I open /tmp in Dolphin it is next to impossible to
> select any file with a mouse (to right click on it or delete, etc) whose
> name alphabetically follows dolphin.* - because the constant creation and
> deletion of dolphin.*** files in /tmp while /tmp is open in Dolphin makes
> all the file/directory icons shift randomly on the screen very rapidly.

Are you also using dolphin through flatpak ?
Comment 9 Vadym Krevs 2025-10-27 18:52:02 UTC
No
Comment 10 dendy oc 2025-11-17 09:35:16 UTC
I have same issue on Artix Linux 

video:
https://github.com/user-attachments/assets/4be4656a-2c3c-46f2-bf6b-eaea32d46a0e

Operating System: Artix Linux 
KDE Plasma Version: 6.5.2
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.7-artix1-1 (64-bit)
Graphics Platform: Wayland
Comment 11 Kishore 2025-11-27 06:41:46 UTC
I have the same issue with KDE neon user edition.
Comment 12 TraceyC 2025-12-04 00:30:32 UTC
Thanks for the bug report. Based on the symptoms, this looks like the same thing as bug 508402, which has a fix in progress

*** This bug has been marked as a duplicate of bug 508402 ***
Comment 13 Méven 2026-01-12 12:57:43 UTC
Git commit b9b06174afca99d7fe544940b950a7323631271a by Méven Car, on behalf of Sergey Katunin.
Committed on 12/01/2026 at 12:57.
Pushed by meven into branch 'master'.

viewproperties: remove temp file after loading defaultConfig

It turns out that since f6c97d52220be9bd996b71309051e56ff7aa1834 a temp file is created here with each `save()` call for this default config, which is not deleted later. In another place where `defaultProperties()` is called for `m_node`, the file is deleted in the destructor of this class. But it is not deleted here.

So, remove temp file after loading defaultConfig or it will create temp file on each save() operation in /tmp folder.

Also keep the global/.directory file when xattr isn't supported.

M  +54   -0    src/tests/viewpropertiestest.cpp
M  +11   -0    src/views/viewproperties.cpp

https://invent.kde.org/system/dolphin/-/commit/b9b06174afca99d7fe544940b950a7323631271a
Comment 14 Méven 2026-01-13 12:01:01 UTC
Git commit 6566c021d01b82299b78ea8beba3c39896cb6c7b by Méven Car, on behalf of Sergey Katunin.
Committed on 13/01/2026 at 12:00.
Pushed by meven into branch 'release/25.12'.

viewproperties: remove temp file after loading defaultConfig

It turns out that since f6c97d52220be9bd996b71309051e56ff7aa1834 a temp file is created here with each `save()` call for this default config, which is not deleted later. In another place where `defaultProperties()` is called for `m_node`, the file is deleted in the destructor of this class. But it is not deleted here.

So, remove temp file after loading defaultConfig or it will create temp file on each save() operation in /tmp folder.

Also keep the global/.directory file when xattr isn't supported.


(cherry picked from commit b9b06174afca99d7fe544940b950a7323631271a)


----- 

https://invent.kde.org/system/dolphin/-/merge_requests/1133

M  +54   -0    src/tests/viewpropertiestest.cpp
M  +11   -0    src/views/viewproperties.cpp

https://invent.kde.org/system/dolphin/-/commit/6566c021d01b82299b78ea8beba3c39896cb6c7b