Source

thg-qt-mq / 13074.diff

Full commit
Yuya Nishihara 042be1e 

































# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1343836385 -32400
# Node ID 9b06a725b537d9ce91d57328cf1f7a777f205d93
# Parent 2c34ed39de8e6f954744d10b2c2d4d913945898f
qscilib: don't use lambda to emit "search backward" request by button

XXX update comment why

Normal function goes nicely with Qt signal than lambda. 1f16cc87f8a9

diff --git a/tortoisehg/hgqt/qscilib.py b/tortoisehg/hgqt/qscilib.py
--- a/tortoisehg/hgqt/qscilib.py
+++ b/tortoisehg/hgqt/qscilib.py
@@ -414,8 +414,7 @@ class SearchToolBar(QToolBar):
         self._wrapchk = QCheckBox(_('Wrap search'))
         self.addWidget(self._wrapchk)
         self._btprev = QPushButton('<< ' + _('Prev'))
-        self._btprev.clicked.connect(
-            lambda: self._emitSearchRequested(forward=False))
+        self._btprev.clicked.connect(self._emitSearchBackwardRequested)
         self.addWidget(self._btprev)
         self._bt = QPushButton(_('Next') + ' >>')
         self._bt.clicked.connect(self._emitSearchRequested)
@@ -482,6 +481,10 @@ class SearchToolBar(QToolBar):
                                   self.wrapAround(), forward)
 
     @pyqtSlot()
+    def _emitSearchBackwardRequested(self):
+        self._emitSearchRequested(forward=False)
+
+    @pyqtSlot()
     def _updateSearchButtons(self):
         enabled = bool(self._le.text())
         self._btprev.setEnabled(enabled)