--- a/src/eric7/UI/BrowserModel.py Fri Feb 23 16:52:01 2024 +0100 +++ b/src/eric7/UI/BrowserModel.py Mon Feb 26 10:41:10 2024 +0100 @@ -749,7 +749,6 @@ """ from eric7.Utilities import ClassBrowsers - # TODO: add support for 'remote:' directories moduleName = parentItem.moduleName() fileName = parentItem.fileName() try: @@ -1210,8 +1209,7 @@ Class implementing the data structure for browser simple directory items. """ - # TODO: add support for 'remote:' directories - def __init__(self, parent, text, path=""): + def __init__(self, parent, text, path="", fsInterface=None): """ Constructor @@ -1221,16 +1219,29 @@ @type str @param path path of the directory @type str + @param fsInterface reference to the 'eric-ide' server file system interface + (defaults to None) + @type EricServerFileSystemInterface (optional) """ BrowserItem.__init__(self, parent, text) + self.__fsInterface = fsInterface + self.type_ = BrowserItemType.SimpleDirectory self._dirName = path - if not os.path.isdir(self._dirName): - self._dirName = os.path.dirname(self._dirName) + if FileSystemUtilities.isRemoteFileName(self._dirName): + if not self.__fsInterface.isdir(self._dirName): + self._dirName = self.__fsInterface.dirname(self._dirName) + else: + if not os.path.isdir(self._dirName): + self._dirName = os.path.dirname(self._dirName) - if os.path.lexists(self._dirName) and os.path.islink(self._dirName): + if ( + FileSystemUtilities.isPlainFileName(self._dirName) + and os.path.lexists(self._dirName) + and os.path.islink(self._dirName) + ): self.symlink = True self.icon = EricPixmapCache.getSymlinkIcon("dirClosed") else: @@ -1245,9 +1256,12 @@ @param full flag indicating full path name should be displayed @type bool """ - # TODO: add support for 'remote:' directories - self._dirName = os.path.abspath(dinfo) - self.itemData[0] = os.path.basename(self._dirName) + if FileSystemUtilities.isRemoteFileName(dinfo): + self._dirName = dinfo + self.itemData[0] = self.__fsInterface.basename(self._dirName) + else: + self._dirName = os.path.abspath(dinfo) + self.itemData[0] = os.path.basename(self._dirName) def dirName(self): """ @@ -1418,7 +1432,6 @@ return "sys.path" -# TODO: add support for 'remote:' directories class BrowserFileItem(BrowserItem): """ Class implementing the data structure for browser file items.