Bug 318834

Summary: Images vanish and Properties not shown if image is picked from Image Thumbbar on right and dropped on to the Thumbbar itself [patch]
Product: [Applications] digikam Reporter: Pravesh Gupta <praveshgupta1993>
Component: Thumbs-BarViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, praveshgupta1993, wazery
Priority: NOR    
Version: 3.2.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
URL: https://drive.google.com/folderview?id=0B6h7Clvq1U_-MURsMUhJMlQ3TXM&usp=sharing
Latest Commit: Version Fixed In: 3.2.0
Sentry Crash Report:
Attachments: Patch for bug id=318834

Description Pravesh Gupta 2013-04-25 06:25:47 UTC
If I pick an Image from the Image Thumbbar on the right of Image Editor, and drop it onto the Image Thumbbar itself, then all images except the picked one vanishes and Properties sidebar on the left becomes unable to show properties of even the single image that remains.

*True for ImageEditor opened with single Image or Multiple Images.

*Bug only in Digikam:ImageEditor Image ThumbBar(on the right), not in ShowFoto Thumbbar as it does not use drag and drop or Light Digikam Image Thumbbar as it supports Grouping of Images on Drag and Drop. It is not even in Light Table Image Thumbbar.

Reproducible: Always

Steps to Reproduce:
1.Open Digikam,select 1 or more Images and Open them with ImageEditor using F4(or Edit).The properties of the images are shown.
2.Pick an image from the ImageEditor:Image ThumbBar(on the left)
3.Drop it onto the Image ThumbBar itself.
Actual Results:  
All Images except the picked one vanishes and Properties in the properties sidebar(on the left) are not shown thereon(even after clicking on the image that remained in the ImageThumbBar).

Expected Results:  
Images in the ImageThumbbar(left) must not vanish,they should occupy their original position in the ThumbBar. 
Properties in the properties sidebar(right) must not vanish, they should be shown according to the current selection whether the image is drag&dropped or not.

PlatForm & OS : KDE Linux Mint 14

Digikam Version: 3.2-beta2 (git)
Comment 1 Pravesh Gupta 2013-04-25 06:39:48 UTC
URL for the proper Info of the bug.
https://drive.google.com/folderview?id=0B6h7Clvq1U_-MURsMUhJMlQ3TXM&usp=sharing
H
ere you can find the screenshots and info related to the bug.
Comment 2 caulier.gilles 2013-04-25 07:49:14 UTC
I think this is a side effect of model/view coded from Album GUI icon-view and re-used to Image Editor thumbbar.

In fact, icons from thumbbar use model from icon-view. Try to use D&D in icon-view in same context and look if dysfunction is reproducible. If i remember D&D in icon-view create a "Group Here" of items. This must be the same effect in thumbbar, but of course, we don't need grouping feature here...

Anyway, a typical fix in my mind will be to disable D&D from thumbbar to thumbbar. D&D from Thumbbar  to another place in digiKam (and vis-versa)digikam
 must still enabled.

Gilles Caulier
Comment 3 Pravesh Gupta 2013-04-27 10:56:12 UTC
If I make m_readonly attribute of ImageDragDropHandler as false by 
d->dragDrogHandler->setReadonly(false) (line 355) of main.cpp of ImageEditor, this bug disappears but then I cannot drop image from the digiKam window to ImageEditor Window.

I think dropEvent() (line 207) function of ImageDragDropHandler.cpp have to be reimplemented to detect whether the D&D is from thumbbar to thumbbar and then return false if detected.

ImageEditor main.cpp :-
https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/utilities/imageeditor/main/imagewindow.cpp

ImageDragDropHandler.cpp
https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/digikam/dragdrop/imagedragdrop.cpp

Pravesh
Comment 4 caulier.gilles 2013-04-27 10:59:20 UTC
> I think dropEvent() (line 207) function of ImageDragDropHandler.cpp have to be >reimplemented to detect whether the D&D is from thumbbar to thumbbar and then return >false if detected.

==> Yes, exactly. patch is welcome...

Gilles Caulier
Comment 5 Pravesh Gupta 2013-04-27 11:25:42 UTC
Or we can reimplement the slotDroppedOnThumbbar function of imageWindow.cpp to checkout whether the dropped image already resides in the thumbbar and if yes then return false.

Line 594 of imagewindow.cpp

https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/utilities/imageeditor/main/imagewindow.cpp

Pravesh
Comment 6 caulier.gilles 2013-04-27 11:36:29 UTC
You can try this way
Comment 7 Pravesh Gupta 2013-04-28 06:13:04 UTC
Created attachment 79505 [details]
Patch for bug id=318834

Since we don't want the files to be dropped which are already present in the ImageEditor ThumbBar, we only want new files to be edited and dropped and thus dropEvent() does not come into play. If we drop files, which are already present in the thumbbar, they would not be loaded as they were already present in the thumbbar, only the new files will replace the old files.
Comment 8 Pravesh Gupta 2013-04-28 06:14:12 UTC
Gilles,
Please review the patch.

Pravesh
Comment 9 caulier.gilles 2013-04-28 12:01:10 UTC
Git commit 3111747abdbf9f153977f557b890eccb05852a96 by Gilles Caulier.
Committed on 28/04/2013 at 13:59.
Pushed by cgilles into branch 'master'.

apply modified patch #79505 from Pravesh Gupta

M  +22   -1    utilities/imageeditor/main/imagewindow.cpp

http://commits.kde.org/digikam/3111747abdbf9f153977f557b890eccb05852a96
Comment 10 caulier.gilles 2013-04-28 15:34:41 UTC
Pravesh, 

Why did you turn bug status ?

Gilles Caulier
Comment 11 Pravesh Gupta 2013-04-28 16:51:43 UTC
Hi Gilles,

Sorry for that. I was also searching that who turned bug status.
I think I accidently changed it. 

Pravesh
Comment 12 caulier.gilles 2013-04-28 20:46:15 UTC
I do it automatically through git commit...

http://community.kde.org/Sysadmin/GitKdeOrgManual#Commit_hook_keywords

Gilles Caulier