Fixed the enum uses of a few places missed in the past. eric7

Sun, 29 Aug 2021 17:48:26 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 29 Aug 2021 17:48:26 +0200
branch
eric7
changeset 8555
844c2713bf44
parent 8554
167c78918573
child 8556
766e1566cb74

Fixed the enum uses of a few places missed in the past.

eric7/EricNetwork/EricTldExtractor.py file | annotate | diff | comparison | revisions
eric7/HexEdit/HexEditMainWindow.py file | annotate | diff | comparison | revisions
eric7/IconEditor/IconEditorWindow.py file | annotate | diff | comparison | revisions
eric7/Snapshot/SnapWidget.py file | annotate | diff | comparison | revisions
--- a/eric7/EricNetwork/EricTldExtractor.py	Sun Aug 29 17:46:56 2021 +0200
+++ b/eric7/EricNetwork/EricTldExtractor.py	Sun Aug 29 17:48:26 2021 +0200
@@ -16,7 +16,7 @@
 import os
 import re
 
-from PyQt6.QtCore import QObject, QUrl, QFile, QFileInfo, qWarning
+from PyQt6.QtCore import QObject, QUrl, QFile, QFileInfo, QIODevice, qWarning
 
 from EricWidgets import EricMessageBox
 
@@ -320,7 +320,7 @@
         
         file = QFile(dataFile)
         
-        if not file.open(QFile.ReadOnly | QFile.Text):
+        if not file.open(QIODevice.OpenModeFlag.ReadOnly | QIODevice.OpenModeFlag.Text):
             return False
         
         seekToEndOfPrivateDomains = False
@@ -479,7 +479,7 @@
         
         file = QFile(testDataFileName)
         
-        if not file.open(QFile.ReadOnly | QFile.Text):
+        if not file.open(QIODevice.OpenModeFlag.ReadOnly | QIODevice.OpenModeFlag.Text):
             return False
         
         testRegExp = re.compile(
--- a/eric7/HexEdit/HexEditMainWindow.py	Sun Aug 29 17:46:56 2021 +0200
+++ b/eric7/HexEdit/HexEditMainWindow.py	Sun Aug 29 17:48:26 2021 +0200
@@ -11,7 +11,8 @@
 import contextlib
 
 from PyQt6.QtCore import (
-    pyqtSignal, pyqtSlot, QFile, QFileInfo, QSize, QCoreApplication, QLocale
+    pyqtSignal, pyqtSlot, QFile, QFileInfo, QSize, QCoreApplication, QLocale,
+    QIODevice
 )
 from PyQt6.QtGui import QKeySequence, QAction
 from PyQt6.QtWidgets import (
@@ -991,7 +992,7 @@
                 .format(fileName))
             return
         
-        if not file.open(QFile.ReadOnly):
+        if not file.open(QIODevice.OpenModeFlag.ReadOnly):
             EricMessageBox.warning(
                 self, self.tr("eric Hex Editor"),
                 self.tr("Cannot read file '{0}:\n{1}.")
@@ -1105,7 +1106,7 @@
         @rtype bool
         """
         file = QFile(fileName)
-        if not file.open(QFile.WriteOnly):
+        if not file.open(QIODevice.OpenModeFlag.WriteOnly):
             EricMessageBox.warning(
                 self, self.tr("eric Hex Editor"),
                 self.tr("Cannot write file '{0}:\n{1}.")
@@ -1180,7 +1181,7 @@
                 return
         
         file = QFile(fileName)
-        if not file.open(QFile.WriteOnly):
+        if not file.open(QIODevice.OpenModeFlag.WriteOnly):
             EricMessageBox.warning(
                 self, self.tr("eric Hex Editor"),
                 self.tr("Cannot write file '{0}:\n{1}.")
--- a/eric7/IconEditor/IconEditorWindow.py	Sun Aug 29 17:46:56 2021 +0200
+++ b/eric7/IconEditor/IconEditorWindow.py	Sun Aug 29 17:48:26 2021 +0200
@@ -11,7 +11,7 @@
 import contextlib
 
 from PyQt6.QtCore import (
-    pyqtSignal, Qt, QSize, QSignalMapper, QFileInfo, QFile, QEvent
+    pyqtSignal, Qt, QSize, QSignalMapper, QFileInfo, QFile, QEvent, QIODevice
 )
 from PyQt6.QtGui import (
     QPalette, QImage, QImageReader, QImageWriter, QKeySequence
@@ -1157,7 +1157,7 @@
                 .format(fileName))
             return
         
-        if not file.open(QFile.ReadOnly):
+        if not file.open(QIODevice.OpenModeFlag.ReadOnly):
             EricMessageBox.warning(
                 self, self.tr("eric Icon Editor"),
                 self.tr("Cannot read file '{0}:\n{1}.")
@@ -1177,7 +1177,7 @@
         @return flag indicating success (boolean)
         """
         file = QFile(fileName)
-        if not file.open(QFile.WriteOnly):
+        if not file.open(QIODevice.OpenModeFlag.WriteOnly):
             EricMessageBox.warning(
                 self, self.tr("eric Icon Editor"),
                 self.tr("Cannot write file '{0}:\n{1}.")
--- a/eric7/Snapshot/SnapWidget.py	Sun Aug 29 17:46:56 2021 +0200
+++ b/eric7/Snapshot/SnapWidget.py	Sun Aug 29 17:48:26 2021 +0200
@@ -17,7 +17,7 @@
 
 from PyQt6.QtCore import (
     pyqtSlot, Qt, QFile, QFileInfo, QTimer, QPoint, QMimeData, QLocale,
-    QStandardPaths
+    QStandardPaths, QIODevice
 )
 from PyQt6.QtGui import QImageWriter, QPixmap, QDrag, QKeySequence, QShortcut
 from PyQt6.QtWidgets import QWidget, QApplication
@@ -240,7 +240,7 @@
                 return False
         
         file = QFile(fileName)
-        if not file.open(QFile.WriteOnly):
+        if not file.open(QIODevice.OpenModeFlag.WriteOnly):
             EricMessageBox.warning(
                 self, self.tr("Save Snapshot"),
                 self.tr("Cannot write file '{0}:\n{1}.")

eric ide

mercurial