Yuya Nishihara avatar Yuya Nishihara committed 6577a87

filedialogs: connect sbar_changed() without using lambda

It prevented FileDiffDialog from GC. Now closed FileDiffDialog will be deleted.

Comments (0)

Files changed (1)


-            self.viewers[side].verticalScrollBar().valueChanged.connect(
-                    lambda value, side=side: self.sbar_changed(value, side))
+        l, r = (self.viewers[k].verticalScrollBar() for k in sides)
+        l.valueChanged.connect(self.sbar_changed_left)
+        r.valueChanged.connect(self.sbar_changed_right)
         l, r = (self.viewers[k].horizontalScrollBar() for k in sides)
+    @pyqtSlot(int)
+    def sbar_changed_left(self, value):
+        self.sbar_changed(value, 'left')
+    @pyqtSlot(int)
+    def sbar_changed_right(self, value):
+        self.sbar_changed(value, 'right')
     def sbar_changed(self, value, side):
         Callback called when a scrollbar of a file viewer
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.