eric6/Plugins/VcsPlugins/vcsPySvn/SvnChangeListsDialog.py

changeset 7771
787a6b3f8c9f
parent 7360
9190402e4505
child 7774
9eed155411f0
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnChangeListsDialog.py	Fri Oct 09 17:19:29 2020 +0200
+++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnChangeListsDialog.py	Sat Oct 10 12:20:51 2020 +0200
@@ -7,16 +7,14 @@
 Module implementing a dialog to browse the change lists.
 """
 
-
 import os
 
 import pysvn
 
 from PyQt5.QtCore import pyqtSlot, Qt, QMutexLocker
-from PyQt5.QtGui import QCursor
-from PyQt5.QtWidgets import (
-    QDialog, QDialogButtonBox, QListWidgetItem, QApplication
-)
+from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QListWidgetItem
+
+from E5Gui.E5OverrideCursor import E5OverrideCursor
 
 from .SvnDialogMixin import SvnDialogMixin
 
@@ -78,24 +76,22 @@
         self.filesLabel.setText(
             self.tr("Files (relative to {0}):").format(path))
         
-        QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
-        QApplication.processEvents()
-        
-        locker = QMutexLocker(self.vcs.vcsExecutionMutex)
-        try:
-            entries = self.client.get_changelist(
-                path, depth=pysvn.depth.infinity)
-            for entry in entries:
-                file = entry[0]
-                changelist = entry[1]
-                if changelist not in self.changeListsDict:
-                    self.changeListsDict[changelist] = []
-                filename = file.replace(path + os.sep, "")
-                if filename not in self.changeListsDict[changelist]:
-                    self.changeListsDict[changelist].append(filename)
-        except pysvn.ClientError as e:
-            locker.unlock()
-            self.__showError(e.args[0])
+        with E5OverrideCursor():
+            locker = QMutexLocker(self.vcs.vcsExecutionMutex)
+            try:
+                entries = self.client.get_changelist(
+                    path, depth=pysvn.depth.infinity)
+                for entry in entries:
+                    file = entry[0]
+                    changelist = entry[1]
+                    if changelist not in self.changeListsDict:
+                        self.changeListsDict[changelist] = []
+                    filename = file.replace(path + os.sep, "")
+                    if filename not in self.changeListsDict[changelist]:
+                        self.changeListsDict[changelist].append(filename)
+            except pysvn.ClientError as e:
+                locker.unlock()
+                self.__showError(e.args[0])
         self.__finish()
     
     def __finish(self):
@@ -103,7 +99,6 @@
         Private slot called when the user pressed the button.
         """
         self.changeLists.addItems(sorted(self.changeListsDict.keys()))
-        QApplication.restoreOverrideCursor()
         
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
         self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)

eric ide

mercurial