Skip to content

Commit 5c29196

Browse files
committed
Fix final percents not updating correctly for files
FolderDisplay.cpp ~ at end of processing, update all percent of parents
1 parent f67c3a2 commit 5c29196

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

source/FolderDisplay.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ void FolderDisplay::OnUpdateUI(wxCommandEvent& event){
283283
AddItem(fd->subFolders[displayStartIndex]);
284284
}
285285

286+
//add files once
286287
if (displayStartIndex == 0){
287288
for (DirectoryData* file : fd->files){
288289
AddItem(file);
@@ -315,14 +316,14 @@ void FolderDisplay::OnUpdateUI(wxCommandEvent& event){
315316
data->parent = old_parent;
316317

317318
UpdateTitle(false);
318-
//add files once
319319
if (prog == 100){
320320
//update percents
321-
auto count = data->subFolders.size();
322-
for (int i = 0; i < count; i++){
323-
wxVariant v = wxAny((long)(data->subFolders[i]->percentOfParent()));
321+
for (int i = 0; i < ListCtrl->GetItemCount(); i++){
322+
DirectoryData* d = (DirectoryData*)(ListCtrl->GetItemData(ListCtrl->RowToItem(i)));
323+
wxVariant v = wxAny((long)(d->percentOfParent()));
324324
ListCtrl->SetValue(v, i, 1);
325325
}
326+
326327
//reconnect if applicable
327328
if (reloadParent != nullptr && updateItem.IsOk()){
328329
reloadParent->SetItemData(updateItem, fd);

0 commit comments

Comments
 (0)