Bug 224052 - Pressing Delete repeatedly is not cached
Summary: Pressing Delete repeatedly is not cached
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-Trash (show other bugs)
Version: 1.1.0
Platform: Unlisted Binaries Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-24 16:05 UTC by Dotan Cohen
Modified: 2017-08-14 08:35 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.2.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dotan Cohen 2010-01-24 16:05:34 UTC
Version:            (using KDE 4.3.4)
Installed from:    Unspecified Linux

When the user presses Delete in the View mode N times, he expects N photos to be deleted. He can make this decision because the filmstrip shows him the next few photos. However, instead of caching the Delete function, Digikam tries to delete the deleted photo, leading to an error "XYZ photo does not exist".

Steps to reproduce:
1) In View mode press Delete repeatedly
Comment 1 Marcel Wiesweg 2010-01-24 20:14:03 UTC
You mean the mode where one image is large with a thumbnail bar at the bottom?
This does not apply when in the icon view mode, does it?
Comment 2 Johannes Wienke 2010-01-24 20:17:31 UTC
I also noticed this in the icon view. Simply press delete two times with fast speed there.
Comment 3 Dotan Cohen 2010-01-24 20:22:31 UTC
> You mean the mode where one image is large
> with a thumbnail bar at the bottom?

Yes.


> This does not apply when in the icon view
> mode, does it?

I can reproduce there as well.
Comment 4 Marcel Wiesweg 2010-01-24 20:27:07 UTC
Ok. I assume the problem is this:
- first delete
- KDE process started to delete file
- file is deleted
- **
- digikam is notified that something happened
- digikam triggers scanning
- scanning is done, database is updated
- view is notified about change
- album listing is started
- **
- album listing results are received in main thread, view is updated

When pressing delete in the time between the **, the described behavior will occur.
Comment 5 Marcel Wiesweg 2010-01-24 20:27:47 UTC
The easiest solution would be to move the focus on to the next item when pressing delete?
Comment 6 Marcel Wiesweg 2010-01-26 22:56:35 UTC
SVN commit 1080759 by mwiesweg:

When deleting images, move to the next index.

CCBUG: 224052

 M  +31 -1     digikamimageview.cpp  
 M  +5 -3      imageviewutilities.cpp  
 M  +1 -1      imageviewutilities.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1080759
Comment 7 caulier.gilles 2010-01-28 09:15:33 UTC
Dotan,

Please test and report using code from svn trunk. I would to close this file for 1.1 release

Thanks in advance

Gilles Caulier
Comment 8 Dotan Cohen 2010-01-28 15:45:09 UTC
I'm in dependency hell, Gilles, and I won't be testing this SVN, sorry. But this issue should be easy to test: just click Delete three times quickly, and check that three photos were deleted without an error being thrown.
Comment 9 Marcel Wiesweg 2010-03-22 21:44:21 UTC
Suggested test successful (item do not disappear immediately, but cursor moves to next entry, so three key pressed will delete three images)
Comment 10 Johannes Wienke 2010-03-22 21:52:40 UTC
I'm still not convinced that this is a solution that fulfills the user's expectations. If I'm pressing delete I expect an immediate response of the GUI with removing the selected items. If this is not possible, a progress dialog should appear.

Can't we hide the items immediately after pressing delete and unhide them in case the kde deletion progress reports an error?
Comment 11 Marcel Wiesweg 2010-03-26 17:00:16 UTC
On which level should we filter out the deleted images? Filter model? I agree that the current behavior is not good, it's simply to long until the images are removed.
Comment 12 Johannes Wienke 2010-03-26 21:43:59 UTC
Would it be possible to put this in an extra filter model (DeleteHidingFilterModel) that only does this one thing so it can be reused? This filter model could simply "intercept" the delete action and hide all selected items immediately until they disappear from the core model or re-enable them on an error.
Comment 13 Marcel Wiesweg 2010-03-27 16:28:15 UTC
This can be a lot of work because the view expects an ImageFilterModel which expects and ImageModel. It may be easier to extend the ImageFilterModel.
Comment 14 Johannes Wienke 2010-03-27 16:31:09 UTC
But then it cannot be reused for the eg. the tree views.