def METHOD_NAME(self):
    """Called when the document changes or the settings are changed."""
    self._outline = None
    app.settingsChanged.disconnect(self.METHOD_NAME)
    self.document().contentsChanged.disconnect(self.METHOD_NAME)