Bug 307303 - GROUP : delete group of photos problem [patch]
Summary: GROUP : delete group of photos problem [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-ItemGroup (show other bugs)
Version: 4.14.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-24 05:55 UTC by Marek Potocki
Modified: 2017-07-29 05:29 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments
error1.png (253.73 KB, image/png)
2012-09-24 16:39 UTC, Marek Potocki
Details
error2.png (295.26 KB, image/png)
2012-09-24 16:39 UTC, Marek Potocki
Details
error3.png (198.58 KB, image/png)
2012-09-24 16:39 UTC, Marek Potocki
Details
error4.png (232.36 KB, image/png)
2012-09-24 16:39 UTC, Marek Potocki
Details
error5.png (163.17 KB, image/png)
2012-09-24 16:39 UTC, Marek Potocki
Details
error6.png (208.84 KB, image/png)
2012-09-24 16:39 UTC, Marek Potocki
Details
error7.png (247.22 KB, image/png)
2012-09-24 16:39 UTC, Marek Potocki
Details
groupdelete.patch (1.40 KB, patch)
2016-01-13 20:24 UTC, Maik Qualmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Potocki 2012-09-24 05:55:25 UTC
When I have group of photos, an I use function "Move to Wastebin", group disappear. After refresh album (go to other one and back again), other photos from this group are visible, but ungroupped.

Reproducible: Always

Steps to Reproduce:
1. Group some files in album
2. Move group to Wastebin
3. Refresh Album
Actual Results:  
Photos are ungroupped, but only first photo from this is deleted.

Expected Results:  
I don't know what is better:
1. Deleted only first photo (need to fix album refersh)
2. Deleted all files from group (if not this function, i think it's good idea to add this functionality)


KDE 4.8.5
Comment 1 Smit Mehta 2012-09-24 15:48:43 UTC
Hi Marek

I am not able to reproduce it here. Just to be clear, first you open any album, group images by some property (say format), and then select on the group name and press "delete". Correct? Or do you do anything else? In any case, a couple of sceenshots will be best to describe the problem. I would appreciate if you could attach them here.

Smit
Comment 2 Smit Mehta 2012-09-24 16:15:58 UTC
Created attachment 74131 [details]
error1.png

Hi Marek

Sorry, no need to attach any screenshots. I understood the problem. Although I am not sure that this is a bug or expected behaviour.

@Gilles, Marcel : What do you suggest?

Smit
Comment 3 Marek Potocki 2012-09-24 16:39:46 UTC
> I am not able to reproduce it here. Just to be clear, first you open any album,
> group images by some property (say format), and then select on the group name
> and press "delete". Correct?

Correct.
There are slideshow :)

error1.png - I have album with 6 photos
error2.png - I group them (Group selected here)
error3.png - I have one group with 5 subelements
error4.png - I delete group
error5.png - Album is empty
error6.png - I change album to other one
error7.png - I back to first album. Tere are 5 ungroupped photos.

Thats all what I can explain without movie :)
Comment 4 Marek Potocki 2012-09-24 16:39:47 UTC
Created attachment 74132 [details]
error2.png
Comment 5 Marek Potocki 2012-09-24 16:39:47 UTC
Created attachment 74133 [details]
error3.png
Comment 6 Marek Potocki 2012-09-24 16:39:47 UTC
Created attachment 74134 [details]
error4.png
Comment 7 Marek Potocki 2012-09-24 16:39:47 UTC
Created attachment 74135 [details]
error5.png
Comment 8 Marek Potocki 2012-09-24 16:39:47 UTC
Created attachment 74136 [details]
error6.png
Comment 9 Marek Potocki 2012-09-24 16:39:47 UTC
Created attachment 74137 [details]
error7.png
Comment 10 Marcel Wiesweg 2012-09-25 13:04:28 UTC
The bug is quite obvious, grouping is simply not handled in the context of deletion.
The first idea is to extend DIO::del to include grouped images, but that is not desirable as not always the whole group shall be deleted.

We must have a look at all places where DeleteDialog is used. Let us ignore deleting a whole album for the moment, cross-album grouping is too complex to handle.
We have
1) ImageViewUtilities called from DigikamImageView
2) ImageWindow
3) LighttableWindow

It is fast to check if a picture has grouped images. Loading the actual image ids is an uncached db query.

Idea for 1): Delete whole group if group is collapsed, delete only selected if group is expanded. This must be implemented on the level of the view class, as the filter model knows about collapse/expanded state.
An idea for 2) and 3) would be to extend DeleteDialog with a checkbox (x) Delete grouped images
and showing/hiding the relevant URLs in the dialog depending on the check state. This could be extended to 1) as well.
Comment 11 René Fritz 2016-01-04 12:58:22 UTC
This bug is still valid. The workflow is somewhat uncomfortable because of this bug. Especially when you group your photos by format (jpg+raw).
Comment 12 caulier.gilles 2016-01-04 13:42:38 UTC
René,

Which version of digiKam do you use exactly ?

Gilles Caulier
Comment 13 René Fritz 2016-01-04 16:42:10 UTC
Version 4.14 (I didn't try 5.x yet)
Comment 14 Maik Qualmann 2016-01-13 20:24:30 UTC
Created attachment 96626 [details]
groupdelete.patch

A first attempt to solve the problem.
I think the idea 1) by Marcel actually the best. But the table view does not provide information whether the group is open.

This patch does the following:
1.) Group is closed: All the items of the group are added to the delete list.
2.) Group is open: As 1.) if the leader of the group is selected.
3.) Group is open: The leader of the group and an item of the group is selected, only two are in the delete list.
4.) Group is open: Item of the group is selected, only the selected item in the delete list.

We have in digiKam-5.0.0 a nice trash, if it goes wrong.

Maik
Comment 15 caulier.gilles 2016-01-14 06:48:42 UTC
Hi Maik,

I tested the patch and it work as expected on my computer.

For the table-view, this is an another problem, more complex to fix. I'm not sure if a file is open in TableView section about this topic to support Group feature (and certainly other features).

Gilles
Comment 16 Maik Qualmann 2016-01-14 20:22:11 UTC
Git commit f3949424b3e9d3032265840f3ba7a7089838b71d by Maik Qualmann.
Committed on 14/01/2016 at 20:20.
Pushed by mqualmann into branch 'master'.

apply patch #96626 to delete all the images of a group
FIXED-IN: 5.0.0

M  +2    -1    NEWS
M  +31   -2    app/items/imageviewutilities.cpp

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