eric6/WebBrowser/SafeBrowsing/SafeBrowsingDialog.py

changeset 7771
787a6b3f8c9f
parent 7533
88261c96484b
child 7781
607a6098cb44
diff -r 49f3377aebf1 -r 787a6b3f8c9f eric6/WebBrowser/SafeBrowsing/SafeBrowsingDialog.py
--- a/eric6/WebBrowser/SafeBrowsing/SafeBrowsingDialog.py	Fri Oct 09 17:19:29 2020 +0200
+++ b/eric6/WebBrowser/SafeBrowsing/SafeBrowsingDialog.py	Sat Oct 10 12:20:51 2020 +0200
@@ -10,10 +10,11 @@
 
 from PyQt5.QtCore import pyqtSlot, Qt, QUrl, QDateTime
 from PyQt5.QtWidgets import (
-    QDialog, QDialogButtonBox, QAbstractButton, QApplication
+    QDialog, QDialogButtonBox, QAbstractButton
 )
 
 from E5Gui import E5MessageBox
+from E5Gui.E5OverrideCursor import E5OverrideCursor
 
 from .Ui_SafeBrowsingDialog import Ui_SafeBrowsingDialog
 
@@ -167,7 +168,6 @@
         @return flag indicating safe to close
         @rtype bool
         """
-        QApplication.restoreOverrideCursor()
         if self.__isModified():
             res = E5MessageBox.okToClearData(
                 self,
@@ -200,10 +200,9 @@
             self.tr("""Updating the Safe Browsing cache might be a lengthy"""
                     """ operation. Please be patient!"""))
         
-        QApplication.setOverrideCursor(Qt.WaitCursor)
-        ok, error = self.__manager.updateHashPrefixCache()
-        self.__resetProgress()
-        QApplication.restoreOverrideCursor()
+        with E5OverrideCursor():
+            ok, error = self.__manager.updateHashPrefixCache()
+            self.__resetProgress()
         if not ok:
             if error:
                 E5MessageBox.critical(
@@ -229,9 +228,8 @@
             self.tr("""Do you really want to clear the Safe Browsing cache?"""
                     """ Re-populating it might take some time."""))
         if res:
-            QApplication.setOverrideCursor(Qt.WaitCursor)
-            self.__manager.fullCacheCleanup()
-            QApplication.restoreOverrideCursor()
+            with E5OverrideCursor():
+                self.__manager.fullCacheCleanup()
     
     @pyqtSlot(str, int)
     def __setProgressMessage(self, message, maximum):

eric ide

mercurial