Bug 358913

Summary: Using Versioning, after returning from edit mode wrong image is selected, image itself is not updated [patch]
Product: [Applications] digikam Reporter: Michal Sylwester <msylwester>
Component: Albums-VersioningAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 5.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.0.0
Sentry Crash Report:
Attachments: Bug screencast
Console output
ImageCategorizedView.patch

Description Michal Sylwester 2016-02-02 11:48:21 UTC
After editing image, saving it and closing editor...
1. The image shown in the main window is still the one before edits
2. The image selected on the thumbbar is the image following the edited one
The thumbnail image is actually correctly updated.

I can reproduce it consistently. Additionally, turning the thumbbar off and on removes current selection.

This may be related to bug 326796, but my pictures are on NTFS partition.

This is on 5.0.0~beta3-wily~ppa1 from philip5's ppa, but I think I've seen it also on 4.x
Comment 1 caulier.gilles 2016-02-02 11:54:20 UTC
To identfy and trying to reproduce the problem, can you take a screencast of you screen when problem occurs ?

Thanks in advance

Gilles Caulier
Comment 2 Michal Sylwester 2016-02-02 12:14:09 UTC
Created attachment 96976 [details]
Bug screencast

Note at about 0:10 selection change in thumbbar and image not being updated.
Comment 3 caulier.gilles 2016-02-02 13:15:50 UTC
If i understand the screencast, the problem is about the image preview which is not updated automatically when editor save changes. Right ?

Thumbnails is updated even.

Perhaps some debug statement are visible on the console during the operations. Can you copy all console messages here please ?

Gilles Caulier
Comment 4 Michal Sylwester 2016-02-02 13:27:57 UTC
The preview is one thing. The thumbnail is updated, but the selection moves to the next image. 
Note at the end I have to click the updated thumbnail to see the updated image. To actually see the following image (the one selected after 0:10) I have to first pick a different picture.

It's getting a little wicked, but take a look how the thumbnail selection changes when I clicked save and it should be pretty obvious. 

BTW: I noticed that sometimes the preview does follows the thumbnail, so I see the correct preview of the next image. It's still the next one, not the edited one.
Comment 5 Michal Sylwester 2016-02-02 13:32:53 UTC
Created attachment 96978 [details]
Console output

Only part while saving the image, let me know if you need larger context.
Comment 6 caulier.gilles 2016-02-02 13:36:18 UTC
I suspect that you use versionning with editor. Right ?

If yes, this still reproducible when versionning is disabled ?

Gilles Caulier
Comment 7 Michal Sylwester 2016-02-02 14:37:32 UTC
You're right. After disabling versioning everything works as I would expect it: thumbbar selection does not change, preview is updated.
Comment 8 Maik Qualmann 2016-02-02 17:54:11 UTC
There is a problem with "scroll current item to center of thumbbar". This option must be turned on so that the error occurs.

Maik
Comment 9 Maik Qualmann 2016-02-02 18:25:17 UTC
Please ignore Comment 8.

Maik
Comment 10 Maik Qualmann 2016-02-03 19:24:51 UTC
Created attachment 96996 [details]
ImageCategorizedView.patch

Workaround for this timing problem. The new image URL is still unknown in the item view after saving the image.

Maik
Comment 11 caulier.gilles 2016-02-03 21:22:05 UTC
Tested here.

As i can see, i cannot reproduce the problem here with this patch...

Michael, if you can confirm on your computer, this will be nice.

Gilles Caulier
Comment 12 Michal Sylwester 2016-02-03 21:25:06 UTC
Sure, I'll give it a try, but not before weekend.
Comment 13 Michal Sylwester 2016-02-06 13:25:47 UTC
I had only time for a quick test so far, but seems to work just as I'd expect it to work. Thanks!
Comment 14 Maik Qualmann 2016-02-06 15:53:27 UTC
I'm technically not really happy with this workaround. I still look for a better solution...

Maik
Comment 15 Maik Qualmann 2016-02-08 20:38:32 UTC
Git commit b1319ec3b93ccdfd6a3a26561a3f0f55e070997e by Maik Qualmann.
Committed on 08/02/2016 at 20:35.
Pushed by mqualmann into branch 'master'.

fix current item in the icon view selected by the image editor
FIXED-IN: 5.0.0

M  +2    -1    NEWS
M  +1    -1    app/items/digikamimageview.cpp
M  +35   -0    app/items/imagecategorizedview.cpp
M  +5    -0    app/items/imagecategorizedview.h

http://commits.kde.org/digikam/b1319ec3b93ccdfd6a3a26561a3f0f55e070997e