Version: 2.1.0 (using KDE 4.7.0) OS: Linux If you drag a tag to the preview window a prohibition sign pops up If you drag a tag to the thumbnails above the preview window you are asked if you want to apply etc and you choose yes, but no tag has been applied afterwards. Reproducible: Always Steps to Reproduce: just as above Actual Results: just as above Expected Results: Either to tag should be applied or the prohibition signe should pop up. Not leaving you in the false presumption you have applied a tag to a picture
Rinus, This file still valid using digiKam 2.4 ? Gilles Caulier
Gilles Caulier I think this bug no longer exists.Its working fine now.
Shourya, point 1/ If you drag a tag to the preview window a prohibition sign pops up ==> Still valid. preview widget do not handle tag D&D Point 2/ If you drag a tag to the thumbnails above the preview window you are asked if you want to apply etc and you choose yes, but no tag has been applied afterwards. ==> Work fine here... Gilles Caulier
Gilles, what are the ways you suggest , in which point(1) can be implemented ?
I mean what are the ways in which I can make preview widget handle drag and drop feature ?
To implement D&D tags support you need to add new methods in ImagePreviewView class as i do with Canvas class from Image Editor which support D&D. See : void Canvas::dragEnterEvent(QDragEnterEvent* e) void Canvas::dragMoveEvent(QDragMoveEvent* e) void Canvas::dropEvent(QDropEvent* e) Canvas is a little bit special, because it shared with Showfoto which do not support digiKam DB. There no DB handling in Canvas. Just a signal is emitted to parent editor instance to handle or not dropped data, accordingly with DB or not. There is no need to reproduce the same scheme in ImagePreviewView than Canvas. You can directly handle Tags drop directly in this class with dropEvent(). The code to decode and branch action with tags is similar than this method : void ImageWindow::slotAddedDropedItems(QDropEvent* e) In this code of course, all possible dropped data are managed. In case of tags, editor load image with relevant tags in thumbbar. It do not assign tags to current image (which is a wrong behavior in fact i think)... Gilles Caulier
tagmngrlistview.cpp also has dropEvent implemented to facilitate drag-n-drop feature. I think dropEvent in ImagePreviewView.cpp should also be implemented in similar way. Right ?
I mean not same but somewhat like this
Look in canvas implementation from Image editor. It use same parent class than ImagPreviewView, and D&D is implemented in git/master... Gilles Caulier
Created attachment 85839 [details] Patch to make preview widget handle drag and drop feature
Created attachment 85912 [details] Updated prev code, so that a confirmation KMenu appears before applying tag After a user drags and drops a tag on preview widget, a KMenu asks user 2 thing : 1) Assign Tags to This Item 2)Cancel If a user clicks on "Assign Tags to This Item" then only the tag is applied to the image.
Created attachment 85919 [details] Merged the first two patches.
Git commit 45bf8a142d6c8ea92757ba054a02389e6a6074e7 by Gilles Caulier. Committed on 03/04/2014 at 07:54. Pushed by cgilles into branch 'master'. apply patch #85919 from Shourya Singh Gupta to handle D&D operation with tags over preview canvas FIXED-IN: 4.0.0 M +54 -0 digikam/views/imagepreviewview.cpp M +7 -0 digikam/views/imagepreviewview.h http://commits.kde.org/digikam/45bf8a142d6c8ea92757ba054a02389e6a6074e7