eric6/WebBrowser/Tools/WebIconProvider.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
diff -r 27f636beebad -r 2c730d5fd177 eric6/WebBrowser/Tools/WebIconProvider.py
--- a/eric6/WebBrowser/Tools/WebIconProvider.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/WebBrowser/Tools/WebIconProvider.py	Tue Mar 02 17:17:09 2021 +0100
@@ -114,7 +114,7 @@
             for url, icon in self.__iconsDB.items():
                 ba = QByteArray()
                 buffer = QBuffer(ba)
-                buffer.open(QIODevice.WriteOnly)
+                buffer.open(QIODevice.OpenModeFlag.WriteOnly)
                 icon.pixmap(32).toImage().save(buffer, "PNG")
                 db[url] = bytes(buffer.data()).decode(self.__encoding)
             
@@ -157,8 +157,12 @@
         @return string representation of the URL
         @rtype str
         """
-        return url.toString(QUrl.PrettyDecoded | QUrl.RemoveUserInfo |
-                            QUrl.RemoveFragment | QUrl.RemovePath)
+        return url.toString(
+            QUrl.ComponentFormattingOption.PrettyDecoded |
+            QUrl.UrlFormattingOption.RemoveUserInfo |
+            QUrl.UrlFormattingOption.RemoveFragment |
+            QUrl.UrlFormattingOption.RemovePath
+        )
     
     def iconForUrl(self, url):
         """
@@ -225,7 +229,7 @@
         
         from .WebIconDialog import WebIconDialog
         dlg = WebIconDialog(self.__iconsDB)
-        if dlg.exec() == QDialog.Accepted:
+        if dlg.exec() == QDialog.DialogCode.Accepted:
             changed = False
             urls = dlg.getUrls()
             for url in list(self.__iconsDB.keys())[:]:

eric ide

mercurial