Commit a8aa8184 authored by Steve Borho's avatar Steve Borho
Browse files

repofilter: disable branchChanged signals while reloading

This was causing the graph to be rebuilt once for every named branch in your
repository, every time you hit the refresh button.  Obviously not nice.
parent b329d0932b39
......@@ -124,6 +124,7 @@ class RepoFilterBar(QToolBar):
self._branchCombo = QComboBox()
self._branchCombo.currentIndexChanged.connect(self._emitBranchChanged)
self._branchReloading = False
self.addWidget(self._branchLabel)
self.addWidget(self._branchCombo)
......@@ -137,10 +138,12 @@ class RepoFilterBar(QToolBar):
else:
branches = self._repo.namedbranches
self._branchReloading = True
self._branchCombo.clear()
self._branchCombo.addItems([''] + branches)
self._branchLabel.setEnabled(len(branches) > 1)
self._branchCombo.setEnabled(len(branches) > 1)
self._branchReloading = False
self.setBranch(curbranch)
......@@ -155,8 +158,9 @@ class RepoFilterBar(QToolBar):
@pyqtSlot()
def _emitBranchChanged(self):
self.branchChanged.emit(self.branch(),
self._allparAction.isChecked())
if not self._branchReloading:
self.branchChanged.emit(self.branch(),
self._allparAction.isChecked())
@pyqtSlot()
def refresh(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment