]> cloud.milkyroute.net Git - dolphin.git/commit
KFileItemModelRolesUpdater: reset size and count before updating folders
authorAkseli Lahtinen <akselmo@akselmo.dev>
Thu, 13 Mar 2025 12:26:40 +0000 (12:26 +0000)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Thu, 13 Mar 2025 12:26:40 +0000 (12:26 +0000)
commitdd2cc41fdeed515f8b7921caa9da823e3cba424c
tree36c47fc63a0b2e2a32b43b2cf471c58123514347
parent4f25090d0b5e6e69097e0f62db45eec0085b0c49
KFileItemModelRolesUpdater: reset size and count before updating folders

Folder count would not update properly when user would delete file from
a folder, or add a new file to it.

Previously when size value is set to -2 after update, the update will
never be called again unless user presses F5. This change will instead
reset that -2 to 0 whenever we are requesting for calculating
directory sizes.

We never updated the count when a file was deleted, so that has been added as well.

This change also calculates the item counts from the processedAmount, which is the total amount of items we're processing. From there we remove the unwanted items and get the final count.

For remote files, we set the count to -1 since we don't calculate them.

BUG: 500502
src/kitemviews/kfileitemmodelrolesupdater.cpp
src/kitemviews/kfileitemmodelrolesupdater.h