Update folder images count on whole hierarchy.#21331
Conversation
|
Funny, I was working on that topic today as well, but didn't have the time to finish :) I think it would be nice to have that for DT_COLLECTION_PROP_TAG too, because tags also have a hierarchical structure. |
|
@zisoft : Probably yes, do you want to take this over (on top of this PR)? Otherwise I'll have a look no problem, let's just avoid duplicate work :) BTW, if you work on something do assign the issue to you. |
|
Ok, I have this ready, it is only a 2 lines edit :) I tried to push a commit to this PR but that was rejected. I have added this in review comments. |
| child = parent2; | ||
| } | ||
| GtkTreeIter p; | ||
| gtk_tree_model_iter_parent(model, &p, &iter); |
There was a problem hiding this comment.
you need to check for success here, otherwise gtk crashes if the node has no parent.
if(gtk_tree_model_iter_parent(model, &p, &iter))
_update_parent_count(model, &p, count);
| index++; | ||
| // also add the item count to parents | ||
| if((property == DT_COLLECTION_PROP_DAY | ||
| || property == DT_COLLECTION_PROP_FOLDERS |
There was a problem hiding this comment.
add
|| property == DT_COLLECTION_PROP_TAG
here and is works for tags, too.
There was a problem hiding this comment.
@zisoft : Yes, that's what I have done locally and it works BUT we have an issue with the counting.
- Select one image
- Add tag "one"
- Add tag "one|two"
- Add tag "one|two|three"
Look for one in tag collection and select it.
- On lighttable a single image displayed : GOOD
- The count on top bar says 1 : GOOD
- On the tag collection you have 2/2/1 : WRONG
- one (2)
- two (2)
- three (1)
There was a problem hiding this comment.
@zisoft
And this is hard to solve. For a folder we have a single image per folder, but here we have multiple tag on the same image. A solution would be to temporary have a map with already added image for each tag... Something I'd like to avoid as this extra complexity is not welcomed here. Any other idea?
There was a problem hiding this comment.
@TurboGit
you are right, that might get complicated.
I would suggest to merge the folder part, so we can continue on that base without hurry.
Closes #11799 #21282