Commits

Yuya Nishihara committed e73a689

revset: disallow to run multiple queries at once

It happens if you select known query, e.g. "tagged()", and press enter key.
Initial runQuery() is invoked by activated signal, then returnPressed follows.

It also happens if you press enter key repeatedly.

Comments (0)

Files changed (1)

tortoisehg/hgqt/revset.py

         QShortcut(QKeySequence('Return'), self, self.returnPressed)
         QShortcut(QKeySequence('Escape'), self, self.reject)
 
+        self.refreshing = None
+
     def runQuery(self):
+        if self.refreshing:
+            return
         self.entry.setEnabled(False)
         self.showMessage.emit(_('Searching...'))
         self.progress.emit(*cmdui.startProgress(_('Running'), _('query')))
 
     def queryFinished(self):
         self.refreshing.wait()
+        self.refreshing.setParent(None)  # assist garbage-collection
+        self.refreshing = None
         self.entry.setEnabled(True)
         self.progress.emit(*cmdui.stopProgress(_('Running')))