Git: Do not refresh branch view when hidden

Change-Id: Ia2e327b6396657255f9b40b792d794a647fc5745
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2020-10-26 12:04:16 +01:00
committed by André Hartmann
parent 7ae976a8b9
commit 2bc736a4f7
2 changed files with 13 additions and 0 deletions

View File

@@ -164,6 +164,11 @@ void BranchView::refresh(const QString &repository, bool force)
m_addButton->setToolTip(tr("Add Branch..."));
m_branchView->setEnabled(true);
}
// Do not refresh the model when the view is hidden
if (!isVisible())
return;
QString errorMessage;
if (!m_model->refresh(m_repository, &errorMessage))
VcsBase::VcsOutputWindow::appendError(errorMessage);
@@ -174,6 +179,11 @@ void BranchView::refreshCurrentBranch()
m_model->refreshCurrentBranch();
}
void BranchView::showEvent(QShowEvent *)
{
refreshCurrentRepository();
}
QToolButton *BranchView::addButton() const
{
return m_addButton;

View File

@@ -65,6 +65,9 @@ public:
QAction *m_includeOldEntriesAction = nullptr;
QAction *m_includeTagsAction = nullptr;
protected:
void showEvent(QShowEvent *) override;
private:
void refreshCurrentRepository();
void resizeColumns();