eric6/QScintilla/EditorOutlineModel.py

changeset 7686
379d402162ca
parent 7685
0b6e8c0d6403
child 7690
a59680062837
diff -r 0b6e8c0d6403 -r 379d402162ca eric6/QScintilla/EditorOutlineModel.py
--- a/eric6/QScintilla/EditorOutlineModel.py	Wed Sep 02 18:13:12 2020 +0200
+++ b/eric6/QScintilla/EditorOutlineModel.py	Wed Sep 02 19:57:37 2020 +0200
@@ -36,9 +36,6 @@
         
         self.__editor = editor
         
-        self.__filename = self.__editor.getFileName()
-        self.__module = os.path.basename(self.__filename)
-        
         self.__populated = False
         
         rootData = QCoreApplication.translate("EditorOutlineModel", "Name")
@@ -53,6 +50,9 @@
         @param repopulate flag indicating a repopulation
         @type bool
         """
+        self.__filename = self.__editor.getFileName()
+        self.__module = os.path.basename(self.__filename)
+        
         language = self.__editor.getLanguage()
         if language in EditorOutlineModel.SupportedLanguages:
             if language in ("Python3", "MicroPython"):
@@ -145,3 +145,21 @@
         """
         self.clear()
         self.__populateModel(repopulate=True)
+    
+    def editor(self):
+        """
+        Public method to retrieve a reference to the editor.
+        
+        @return reference to the editor
+        @rtype Editor
+        """
+        return self.__editor
+    
+    def fileName(self):
+        """
+        Public method to retrieve the file name of the editor.
+        
+        @return file name of the editor
+        @rtype str
+        """
+        return self.__filename

eric ide

mercurial