--- a/src/eric7/Project/ProjectOthersBrowser.py Tue Oct 24 11:45:39 2023 +0200 +++ b/src/eric7/Project/ProjectOthersBrowser.py Wed Oct 25 14:30:33 2023 +0200 @@ -9,7 +9,6 @@ """ import contextlib -import os from PyQt6.QtCore import QModelIndex, QUrl, pyqtSignal from PyQt6.QtGui import QDesktopServices @@ -445,31 +444,13 @@ """ Private method to add files to the project. """ - itm = self.model().item(self.currentIndex()) - if isinstance(itm, ProjectBrowserFileItem): - dn = os.path.dirname(itm.fileName()) - elif isinstance( - itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem) - ): - dn = itm.dirName() - else: - dn = None - self.project.addFiles("OTHERS", dn) + self.project.addFiles("OTHERS", self.currentDirectory()) def __addOthersDirectory(self): """ Private method to add files of a directory to the project. """ - itm = self.model().item(self.currentIndex()) - if isinstance(ProjectBrowserFileItem): - dn = os.path.dirname(itm.fileName()) - elif isinstance( - itm, (ProjectBrowserSimpleDirectoryItem, ProjectBrowserDirectoryItem) - ): - dn = itm.dirName() - else: - dn = None - self.project.addDirectory("OTHERS", dn) + self.project.addDirectory("OTHERS", self.currentDirectory()) def __removeItem(self): """