code: def reloadFileOfCurrentItem(self, rtiRegItem=None):
          
          logger.debug("reloadFileOfCurrentItem, rtiClass={}".format(rtiRegItem))
  
  
          currentIndex = self.getRowCurrentIndex()
          if not currentIndex.isValid():
              return
  
          currentItem, _ = self.getCurrentItem()
          oldPath = currentItem.nodePath
  
          fileRtiIndex = self.model().findFileRtiIndex(currentIndex)
          isExpanded = self.isExpanded(fileRtiIndex)
  
          if rtiRegItem is None:
              rtiClass = None
          else:
              rtiRegItem.tryImportClass()
              rtiClass = rtiRegItem.cls
  
          newRtiIndex = self.model().reloadFileAtIndex(fileRtiIndex, rtiClass=rtiClass)
  
          try:
              # Expand and select the name with the old path
              _lastItem, lastIndex = self.expandPath(oldPath)
              self.setCurrentIndex(lastIndex)
              return lastIndex
          except Exception as ex:
              # The old path may not exist anymore. In that case select file RTI
              logger.warning("Unable to select {!r} beause of: {}".format(oldPath, ex))
              self.setExpanded(newRtiIndex, isExpanded)
              self.setCurrentIndex(newRtiIndex)
              return newRtiIndex
docs: Finds the repo tree item that holds the file of the current item and reloads it.
              Reloading is done by removing the repo tree item and inserting a new one.
  
              The new item will have by of type rtiRegItem.cls. If rtiRegItem is None (the default),
              the new rtiClass will be the same as the old one.
              The rtiRegItem.cls will be imported. If this fails the old class will be used, and a
              warning will be logged.