Bug 503527

Summary: Image Summation not working when Tree Node expanded
Product: [Applications] digikam Reporter: jan.sende
Component: Albums-TreeViewAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.6.0   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Screenshots

Description jan.sende 2025-04-29 14:36:32 UTC
Created attachment 180776 [details]
Screenshots

SUMMARY
The album tree view (optionally) shows the number of images in each subfolder. This works correctly as long as the node is collapsed. However, as soon as the node is expanded the display switches to 0.

STEPS TO REPRODUCE
1. Open library with images in subfolders.
2. Enable image counting in the tree view.
3. Open tree view with nodes collapsed. Find the correct count.
4. Expand any node containing one or more pictures. Find the count switched to 0.

OBSERVED RESULT
Image count in expanded tree node is 0.

EXPECTED RESULT
Image count in expanded tree node is the same as for collapsed tree node, that is the number of images in subfolders.
Comment 1 caulier.gilles 2025-04-29 15:18:00 UTC
From the doc: 

https://docs.digikam.org/en/setup_application/views_settings.html#tree-view-settings

"The option Show a count of items in Tree Views will display the number of items inside a folder or assigned to a tag behind the album/tag name. The count shown depends on whether the subfolders/-tags are folded out or not and on the View ‣ Include Album Sub-Tree and the View ‣ Include Tag Sub-Tree settings in the main menu."

Typical case :

+A (10)

- A(0)
   B(7)
   C(3)

Collapsed, A counts is the sum of B + C.
Not collapsed : A counts correspond to the number of items in this album, not sub-album.

For ex, if A has 5 items, we will seen :

+A (15)

- A(5)
   B(7)
   C(3)

In other words, it's not a bug, it's a feature. Sure we can explain better in the documentation.

Gilles Caulier
Comment 2 Maik Qualmann 2025-04-30 05:57:40 UTC
Read the duplicate bug report we have explained and tested why other solutions are no better or are difficult to implement.

Maik

*** This bug has been marked as a duplicate of bug 414424 ***