Bug 497555

Summary: Dolphin is not automatically updating previews after changing file's name since 24.12
Product: [Applications] dolphin Reporter: Michał Dybczak <michal.dybczak>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: akselmo, chrisw82, hi, kdedev, kfm-devel, nate, p.r.worrall, smowtenshi
Priority: NOR Keywords: regression
Version: 24.12.0   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Michał Dybczak 2024-12-16 11:23:40 UTC
***
After Dolphin's upgrade 24.08.3-1 -> 24.12.0-1 I noticed that after changing image's name, the preview is not automatically updated. Usually, it took some time (1-3sec.) till it happened (surprisingly slow, but it worked nevertheless), but now, it doesn't work at all and file is represented by the general icon. Clicking on refresh or going up and down to the same place updates it. The issue is clearly with auto-refresh, that is not being triggered after the file's name update as it was before.
***

SUMMARY


STEPS TO REPRODUCE
1.  Have an image with showed preview in Dolphin
2. Change its name by F2
3.

OBSERVED RESULT
The preview image that was present is not loading/updating after the name change and Dolphin shows just the general icon.

EXPECTED RESULT
The preview image is updating.info

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.5-2-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Memory: 30.6 GiB of RAM
Graphics Processor: AMD Radeon 780M
Manufacturer: TUXEDO
Product Name: TUXEDO Sirius 16 Gen1
ADDITIONAL INFORMATION
Comment 1 Michał Dybczak 2024-12-16 11:49:22 UTC
I downgraded Dolphin to 24.08.3-1 and the issue is gone.

I may have been wrong about previously autorefresh taking its time. Now it looks like the preview is not changing at all after the name change (which is how it should be, since preview shouldn't change after only name change) or it's doing so fast that the change is not perceivable.

I do remember that after moving folders with files to another location, preview is gone but showing up after a while, that one I am certain. But that is off-topic.
Comment 2 Paul Worrall 2024-12-16 16:22:21 UTC
Reproduced on:

Operating System: Arch Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.4-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-3210M CPU @ 2.50GHz
Memory: 15.5 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4000
Manufacturer: Apple Inc.
Product Name: MacBookPro9,2
System Version: 1.0
Comment 3 Nate Graham 2024-12-16 17:07:31 UTC
Can also confirm.
Comment 4 Akseli Lahtinen 2024-12-17 08:37:25 UTC
Seems the preview job is getting the name of the old item, instead of the new item. So it fails to create the preview. Something has changed there, will try to bisect.
Comment 5 Akseli Lahtinen 2024-12-17 09:10:44 UTC
*** Bug 497159 has been marked as a duplicate of this bug. ***
Comment 6 Akseli Lahtinen 2024-12-17 09:11:25 UTC
(In reply to Akseli Lahtinen from comment #4)
> Seems the preview job is getting the name of the old item, instead of the
> new item. So it fails to create the preview. Something has changed there,
> will try to bisect.

Scratch that. The file name is correct. I think the renaming process however is not done yet inside the folder, so it tries to generate a preview before the file is renamed.
Comment 7 Bug Janitor Service 2024-12-17 10:42:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/876
Comment 8 OIRNOIR 2024-12-17 21:24:17 UTC
Can also confirm.
Comment 9 Méven 2024-12-19 10:04:19 UTC
Git commit eca160ae5a2dbd5590e4bae22cddde488dbacf74 by Méven Car, on behalf of Akseli Lahtinen.
Committed on 19/12/2024 at 10:04.
Pushed by meven into branch 'master'.

dolphinview: Update thumbnail on filename change

If filename of an item was updated previously, it would modify the model
before the file was actually changed. This led to the model calling
a signal that would try to run a previewjob, but since the filename
is not actually changed yet on disk, it would fail.

This patch moves the model updating after copyjob. Copyjob
will take care of the file renaming if there is already existing file.
We just need to update the model correctly after the job has succeeded.

M  +1    -0    src/kitemviews/kfileitemlistview.h
M  +1    -0    src/kitemviews/kfileitemmodelrolesupdater.cpp
M  +3    -0    src/kitemviews/kfileitemmodelrolesupdater.h
M  +48   -0    src/tests/dolphinmainwindowtest.cpp
M  +8    -17   src/views/dolphinview.cpp

https://invent.kde.org/system/dolphin/-/commit/eca160ae5a2dbd5590e4bae22cddde488dbacf74
Comment 10 Akseli Lahtinen 2024-12-19 15:59:54 UTC
Git commit 0fe6544079a23769e8f19ee2f09b5c149f404d5a by Akseli Lahtinen.
Committed on 19/12/2024 at 15:52.
Pushed by akselmo into branch 'release/24.12'.

dolphinview: Update thumbnail on filename change

If filename of an item was updated previously, it would modify the model
before the file was actually changed. This led to the model calling
a signal that would try to run a previewjob, but since the filename
is not actually changed yet on disk, it would fail.

This patch moves the model updating after copyjob. Copyjob
will take care of the file renaming if there is already existing file.
We just need to update the model correctly after the job has succeeded.

(cherry picked from commit eca160ae5a2dbd5590e4bae22cddde488dbacf74)

M  +1    -0    src/kitemviews/kfileitemlistview.h
M  +1    -0    src/kitemviews/kfileitemmodelrolesupdater.cpp
M  +3    -0    src/kitemviews/kfileitemmodelrolesupdater.h
M  +2    -0    src/kitemviews/kitemlistview.h
M  +49   -0    src/tests/dolphinmainwindowtest.cpp
M  +8    -17   src/views/dolphinview.cpp

https://invent.kde.org/system/dolphin/-/commit/0fe6544079a23769e8f19ee2f09b5c149f404d5a