code: def currentRepoTreeItemChanged(self):
          
          # When the model is empty the current index may be invalid and the currentItem may be None.
          currentItem, currentIndex = self.getCurrentItem()
  
          hasCurrent = currentIndex.isValid()
          assert hasCurrent == (currentItem is not None), \
              "If current idex is valid, currentIndex may not be None" # sanity check
  
          # Set the item in the collector, will will subsequently update the inspector.
          if hasCurrent:
              logger.info("Adding rti to collector: {}".format(currentItem.nodePath))
              self.collector.setRti(currentItem)
              #if rti.asArray is not None: # TODO: maybe later, first test how robust it is now
              #    self.collector.setRti(rti)
  
          # Update context menus in the repo tree
          self.currentItemActionGroup.setEnabled(hasCurrent)
          isTopLevel = hasCurrent and self.model().isTopLevelIndex(currentIndex)
          self.topLevelItemActionGroup.setEnabled(isTopLevel)
          self.openItemAction.setEnabled(currentItem is not None
                                         and currentItem.hasChildren()
                                         and not currentItem.isOpen)
          self.closeItemAction.setEnabled(currentItem is not None
                                          and currentItem.hasChildren()
                                          and currentItem.isOpen)
  
          # Emit sigRepoItemChanged signal so that, for example, details panes can update.
          logger.debug("Emitting sigRepoItemChanged: {}".format(currentItem))
          self.sigRepoItemChanged.emit(currentItem)
docs: Called to update the GUI when a repo tree item has changed or a new one was selected.