495 posPaths |= {x for x in self.closedItems if len(x) > pll} |
495 posPaths |= {x for x in self.closedItems if len(x) > pll} |
496 posPaths = {x[pll] for x in posPaths if x[:pll] == pathlist} |
496 posPaths = {x[pll] for x in posPaths if x[:pll] == pathlist} |
497 |
497 |
498 if posPaths: |
498 if posPaths: |
499 for child in parent.children: |
499 for child in parent.children: |
500 if child.hasChildren and child.nameWithId in posPaths: |
500 if ( |
501 if child.currentCount >= 0: |
501 child.hasChildren and |
502 # Discard loaded elements and refresh if still expanded |
502 child.nameWithId in posPaths and |
503 child.currentCount = -1 |
503 child.currentCount >= 0 |
504 child.populated = False |
504 ): |
505 row = parent.children.index(child) |
505 # Discard loaded elements and refresh if still expanded |
506 newParentIdx = self.index(row, 0, parentIdx) |
506 child.currentCount = -1 |
507 self.resetModifiedMarker( |
507 child.populated = False |
508 newParentIdx, pathlist + (child.nameWithId,)) |
508 row = parent.children.index(child) |
|
509 newParentIdx = self.index(row, 0, parentIdx) |
|
510 self.resetModifiedMarker( |
|
511 newParentIdx, pathlist + (child.nameWithId,)) |
509 |
512 |
510 self.closedItems = [] |
513 self.closedItems = [] |
511 |
514 |
512 # Little quirk: Refresh all visible items to clear the changed marker |
515 # Little quirk: Refresh all visible items to clear the changed marker |
513 if parentIdx == QModelIndex(): |
516 if parentIdx == QModelIndex(): |