962 if childItem is not None: |
962 if childItem is not None: |
963 self.beginRemoveRows(parentIndex, childItem.row(), childItem.row()) |
963 self.beginRemoveRows(parentIndex, childItem.row(), childItem.row()) |
964 parentItem.removeChild(childItem) |
964 parentItem.removeChild(childItem) |
965 self.endRemoveRows() |
965 self.endRemoveRows() |
966 |
966 |
967 if isinstance(parentItem, ProjectBrowserSimpleDirectoryItem): |
967 if ( |
968 # unmanaged directory |
968 isinstance(parentItem, ProjectBrowserSimpleDirectoryItem) |
|
969 and parentItem.childCount() == 0 |
|
970 ): |
|
971 # unmanaged directory is empty; remove it |
969 self.removeItem(os.path.dirname(name)) |
972 self.removeItem(os.path.dirname(name)) |
970 |
973 |
971 def repopulateItem(self, name): |
974 def repopulateItem(self, name): |
972 """ |
975 """ |
973 Public method to repopulate an item. |
976 Public method to repopulate an item. |