Bug 373562 - Inconsistent items selected count with groups in the main view [patch]
Summary: Inconsistent items selected count with groups in the main view [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-ItemGroup (show other bugs)
Version: 5.3.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-12 09:37 UTC by Simon
Modified: 2016-12-20 20:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.4.0


Attachments
Fixes image counts for grouped images (3.63 KB, patch)
2016-12-20 10:16 UTC, Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2016-12-12 09:37:48 UTC
When there are grouped items in an album the indication on the bottom left of the window about how many items are selected is off. It looks like in Thumbnail view the number on the left (currently selected items) counts selected items plus grouped items belonging to the selected items. The number on the right (total items) however only counts how many items are actually present in the current view. In my opinion the second is more useful, i.e. always show the numbers of selected items in the current view, regardless of grouping.

In Tableview mode there is a different behaviour again:
When "Hide grouped items" is active, the behaviour is the same as described above for the thumbnail view.
When "Ignore grouping" is active the behaviour is correct except to an offset by one. So when just one item is selected, it counts 2 items selected and when all are selected it is total + 1.
When "Show grouping in tree" is active, the same is the case. In addition no matter whether a group of images is expanded or not, selecting the first (parent) item counts all items in the group. Selecting a child item when the group is expanded counts as one image. This should also be true for the first/parent item when the group is expanded.
Comment 1 Simon 2016-12-20 10:16:49 UTC
Created attachment 102892 [details]
Fixes image counts for grouped images

The attached patch should solves the described problem. It is related to https://bugs.kde.org/show_bug.cgi?id=372027 as it takes care of grouping when all items are requested (the referenced issue did this for selected items). In addition there was a bug in TableView::selectedImageInfos() where the currentIndex is compared to a list of row indexes. The currentIndex however always had column!=0, so they never matched. This caused the wrong selected image count (base offset of 1 or 2).
Comment 2 caulier.gilles 2016-12-20 13:01:31 UTC
The patch sound acceptable as it's not too intrusive.

Gilles Caulier
Comment 3 Maik Qualmann 2016-12-20 20:45:37 UTC
Git commit 830f70e8ace3990520f114e65300d1c5b6cb3a1c by Maik Qualmann.
Committed on 20/12/2016 at 20:44.
Pushed by mqualmann into branch 'master'.

apply patch #102892 from Simon to fix image counts for grouped images and polish
FIXED-IN: 5.4.0

M  +2    -1    NEWS
M  +15   -10   app/items/imagecategorizedview.cpp
M  +3    -2    app/items/imagecategorizedview.h
M  +2    -2    app/views/tableview/tableview.cpp
M  +6    -4    app/views/tableview/tableview_model.cpp

https://commits.kde.org/digikam/830f70e8ace3990520f114e65300d1c5b6cb3a1c