--- a/src/eric7/Project/ProjectBrowser.py Wed Nov 16 18:11:52 2022 +0100 +++ b/src/eric7/Project/ProjectBrowser.py Thu Nov 17 18:11:42 2022 +0100 @@ -78,6 +78,8 @@ (list of str, bool) @signal uipreview(str) emitted to preview a forms file @signal umlFile(filename) emitted to open an eric UML file (str) + @signal processChangedProjectFiles() emitted to indicate, that changed project files + should be processed """ appendStderr = pyqtSignal(str) @@ -95,6 +97,7 @@ trpreview = pyqtSignal((list,), (list, bool)) uipreview = pyqtSignal(str) umlFile = pyqtSignal(str) + processChangedProjectFiles = pyqtSignal() def __init__(self, project, parent=None): """ @@ -309,19 +312,18 @@ """ Public slot to handle the editorChanged signal. - @param fn filename of the changed file (string) + @param fn filename of the changed file + @type str """ if Preferences.getProject("FollowEditor"): - if self.project.isProjectSource(fn): - self.__browsers["sources"].selectFile(fn) - elif self.project.isProjectForm(fn): - self.__browsers["forms"].selectFile(fn) - elif self.project.isProjectResource(fn): - self.__browsers["resources"].selectFile(fn) - elif self.project.isProjectInterface(fn): - self.__browsers["interfaces"].selectFile(fn) - elif self.project.isProjectProtocol(fn): - self.__browsers["protocols"].selectFile(fn) + for fileCategory in ( + cat + for cat in self.project.getFileCategories() + if cat not in ("TRANSLATIONS", "OTHERS") + ): + if self.project.isProjectCategory(fn, fileCategory): + self.__browsers[fileCategory.lower()].selectFile(fn) + break def handleEditorLineChanged(self, fn, lineno): """ @@ -333,7 +335,7 @@ if ( Preferences.getProject("FollowEditor") and Preferences.getProject("FollowCursorLine") - and self.project.isProjectSource(fn) + and self.project.isProjectCategory(fn, "SOURCES") ): self.__browsers["sources"].selectFileLine(fn, lineno)