code: def tabFileNameChanged(self, tab):
  		'''
  		Perform all UI state changes that need to be done when the
  		filename of the current tab has changed.
  		'''
  		if tab == self.currentTab:
  			if tab.fileName:
  				self.setWindowTitle("")
  				if globalSettings.windowTitleFullPath:
  					self.setWindowTitle(tab.fileName + '[*]')
  				self.setWindowFilePath(tab.fileName)
  				self.tabWidget.setTabText(self.ind, tab.getBaseName())
  				self.tabWidget.setTabToolTip(self.ind, tab.fileName)
  				QDir.setCurrent(QFileInfo(tab.fileName).dir().path())
  			else:
  				self.setWindowFilePath('')
  				self.setWindowTitle(self.tr('New document') + '[*]')
  
  			canReload = bool(tab.fileName) and not self.autoSaveActive(tab)
  			self.actionSetEncoding.setEnabled(canReload)
  			self.actionReload.setEnabled(canReloadf tabFileNameChanged(self, tab):
  		'''
  		Perform all UI state changes that need to be done when the
  		filename of the current tab has changed.
  		'''
  		if tab == self.currentTab:
  			if tab.fileName:
  				self.setWindowTitle("")
  				if globalSettings.windowTitleFullPath:
  					self.setWindowTitle(tab.fileName + '[*]')
  				self.setWindowFilePath(tab.fileName)
  				self.tabWidget.setTabText(self.ind, tab.getBaseName())
  				self.tabWidget.setTabToolTip(self.ind, tab.fileName)
  				QDir.setCurrent(QFileInfo(tab.fileName).dir().path())
  			else:
  				self.setWindowFilePath('')
  				self.setWindowTitle(self.tr('New document') + '[*]')
  
  			canReload = bool(tab.fileName) and not self.autoSaveActive(tab)
  			self.actionSetEncoding.setEnabled(canReload)
  			self.actionReload.setEnabled(canReload)
docs: Perform all UI state changes that need to be done when the
  		filename of the current tab has changed.