src/eric7/UI/BrowserModel.py

branch
eric7
changeset 9624
b47dfa7a137d
parent 9612
93b496cc3c88
child 9653
e67609152c5e
--- a/src/eric7/UI/BrowserModel.py	Sun Dec 18 14:19:10 2022 +0100
+++ b/src/eric7/UI/BrowserModel.py	Sun Dec 18 19:33:46 2022 +0100
@@ -24,8 +24,9 @@
 from PyQt6.QtGui import QFont, QImageReader
 from PyQt6.QtWidgets import QApplication
 
-from eric7 import Preferences, Utilities
+from eric7 import Preferences
 from eric7.EricGui import EricPixmapCache
+from eric7.SystemUtilities import FileSystemUtilities
 from eric7.Utilities import ClassBrowsers
 from eric7.Utilities.ClassBrowsers import ClbrBaseClasses
 
@@ -336,7 +337,7 @@
             # step 1: check for new entries
             children = itm.children()
             for f in entryInfoList:
-                fpath = Utilities.toNativeSeparators(f.absoluteFilePath())
+                fpath = FileSystemUtilities.toNativeSeparators(f.absoluteFilePath())
                 childFound = False
                 for child in children:
                     if child.name() == fpath:
@@ -350,11 +351,14 @@
                 self.beginInsertRows(self.createIndex(itm.row(), 0, itm), cnt, cnt)
                 node = (
                     BrowserDirectoryItem(
-                        itm, Utilities.toNativeSeparators(f.absoluteFilePath()), False
+                        itm,
+                        FileSystemUtilities.toNativeSeparators(f.absoluteFilePath()),
+                        False,
                     )
                     if f.isDir()
                     else BrowserFileItem(
-                        itm, Utilities.toNativeSeparators(f.absoluteFilePath())
+                        itm,
+                        FileSystemUtilities.toNativeSeparators(f.absoluteFilePath()),
                     )
                 )
                 self._addItem(node, itm)
@@ -364,7 +368,7 @@
             if len(entryInfoList) != itm.childCount():
                 for row in range(oldCnt - 1, -1, -1):
                     child = itm.child(row)
-                    childname = Utilities.fromNativeSeparators(child.name())
+                    childname = FileSystemUtilities.fromNativeSeparators(child.name())
                     entryFound = False
                     for f in entryInfoList:
                         if f.absoluteFilePath() == childname:
@@ -388,10 +392,12 @@
         if tdp:
             self.toplevelDirs = tdp
         else:
-            self.toplevelDirs.append(Utilities.toNativeSeparators(QDir.homePath()))
+            self.toplevelDirs.append(
+                FileSystemUtilities.toNativeSeparators(QDir.homePath())
+            )
             for d in QDir.drives():
                 self.toplevelDirs.append(
-                    Utilities.toNativeSeparators(d.absoluteFilePath())
+                    FileSystemUtilities.toNativeSeparators(d.absoluteFilePath())
                 )
 
         for d in self.toplevelDirs:
@@ -566,7 +572,7 @@
                 if f.isDir():
                     node = BrowserDirectoryItem(
                         parentItem,
-                        Utilities.toNativeSeparators(f.absoluteFilePath()),
+                        FileSystemUtilities.toNativeSeparators(f.absoluteFilePath()),
                         False,
                     )
                 else:
@@ -576,7 +582,8 @@
                         if any(fnmatch.fnmatch(fn, ff.strip()) for ff in fileFilters):
                             continue
                     node = BrowserFileItem(
-                        parentItem, Utilities.toNativeSeparators(f.absoluteFilePath())
+                        parentItem,
+                        FileSystemUtilities.toNativeSeparators(f.absoluteFilePath()),
                     )
                 self._addItem(node, parentItem)
             if repopulate:
@@ -1061,7 +1068,7 @@
 
         self.type_ = BrowserItemDirectory
         if (
-            not Utilities.isDrive(self._dirName)
+            not FileSystemUtilities.isDrive(self._dirName)
             and os.path.lexists(self._dirName)
             and os.path.islink(self._dirName)
         ):

eric ide

mercurial