eric7/ViewManager/BookmarkedFilesDialog.py

branch
eric7
changeset 9152
8a68afaf1ba2
parent 8881
54e42bc2437a
--- a/eric7/ViewManager/BookmarkedFilesDialog.py	Wed Jun 15 09:44:07 2022 +0200
+++ b/eric7/ViewManager/BookmarkedFilesDialog.py	Thu Jun 16 18:28:59 2022 +0200
@@ -7,7 +7,9 @@
 Module implementing a configuration dialog for the bookmarked files menu.
 """
 
-from PyQt6.QtCore import QFileInfo, Qt, pyqtSlot
+import pathlib
+
+from PyQt6.QtCore import Qt, pyqtSlot
 from PyQt6.QtGui import QColor
 from PyQt6.QtWidgets import QListWidgetItem, QDialog
 
@@ -35,7 +37,7 @@
         self.bookmarks = bookmarks[:]
         for bookmark in self.bookmarks:
             itm = QListWidgetItem(bookmark, self.filesList)
-            if not QFileInfo(bookmark).exists():
+            if not pathlib.Path(bookmark).exists():
                 itm.setBackground(QColor(Qt.GlobalColor.red))
             
         if len(self.bookmarks):
@@ -82,7 +84,7 @@
         bookmark = self.filePicker.text()
         if bookmark:
             itm = QListWidgetItem(bookmark, self.filesList)
-            if not QFileInfo(bookmark).exists():
+            if not pathlib.Path(bookmark).exists():
                 itm.setBackground(QColor(Qt.GlobalColor.red))
             self.filePicker.clear()
             self.bookmarks.append(bookmark)
@@ -99,7 +101,7 @@
         self.bookmarks[row] = bookmark
         itm = self.filesList.item(row)
         itm.setText(bookmark)
-        if not QFileInfo(bookmark).exists():
+        if not pathlib.Path(bookmark).exists():
             itm.setBackground(QColor(Qt.GlobalColor.red))
         else:
             itm.setBackground(QColor())

eric ide

mercurial