564 self._selectEntries( |
564 self._selectEntries( |
565 local=False, |
565 local=False, |
566 filter=[ProjectBrowserSimpleDirectoryItem, |
566 filter=[ProjectBrowserSimpleDirectoryItem, |
567 ProjectBrowserDirectoryItem]) |
567 ProjectBrowserDirectoryItem]) |
568 |
568 |
|
569 def getExpandedItemNames(self): |
|
570 """ |
|
571 Public method to get the file/directory names of all expanded items. |
|
572 |
|
573 @return list of expanded items names (list of string) |
|
574 """ |
|
575 # step 1: find the top most index |
|
576 childIndex = self.currentIndex() |
|
577 if not childIndex.isValid(): |
|
578 return [] |
|
579 |
|
580 while childIndex.isValid(): |
|
581 topIndex = childIndex |
|
582 childIndex = self.indexAbove(childIndex) |
|
583 |
|
584 # step 2: get names of expanded items |
|
585 expandedNames = [] |
|
586 childIndex = topIndex |
|
587 while childIndex.isValid(): |
|
588 if self.isExpanded(childIndex): |
|
589 expandedNames.append( |
|
590 self.model().item(childIndex).name()) |
|
591 childIndex = self.indexBelow(childIndex) |
|
592 return expandedNames |
|
593 |
569 def _prepareRepopulateItem(self, name): |
594 def _prepareRepopulateItem(self, name): |
570 """ |
595 """ |
571 Protected slot to handle the prepareRepopulateItem signal. |
596 Protected slot to handle the prepareRepopulateItem signal. |
572 |
597 |
573 @param name relative name of file item to be repopulated (string) |
598 @param name relative name of file item to be repopulated (string) |