1. TortoiseHg
  2. TortoiseHg
  3. thg

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.

  • Participants
  • Parent commits 2babc4f
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/revset.py

View file
  • Ignore whitespace
         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')))