forked from qt-creator/qt-creator
Git: Do not refresh branch view when hidden
Change-Id: Ia2e327b6396657255f9b40b792d794a647fc5745 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
7ae976a8b9
commit
2bc736a4f7
@@ -164,6 +164,11 @@ void BranchView::refresh(const QString &repository, bool force)
|
|||||||
m_addButton->setToolTip(tr("Add Branch..."));
|
m_addButton->setToolTip(tr("Add Branch..."));
|
||||||
m_branchView->setEnabled(true);
|
m_branchView->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not refresh the model when the view is hidden
|
||||||
|
if (!isVisible())
|
||||||
|
return;
|
||||||
|
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!m_model->refresh(m_repository, &errorMessage))
|
if (!m_model->refresh(m_repository, &errorMessage))
|
||||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
||||||
@@ -174,6 +179,11 @@ void BranchView::refreshCurrentBranch()
|
|||||||
m_model->refreshCurrentBranch();
|
m_model->refreshCurrentBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BranchView::showEvent(QShowEvent *)
|
||||||
|
{
|
||||||
|
refreshCurrentRepository();
|
||||||
|
}
|
||||||
|
|
||||||
QToolButton *BranchView::addButton() const
|
QToolButton *BranchView::addButton() const
|
||||||
{
|
{
|
||||||
return m_addButton;
|
return m_addButton;
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ public:
|
|||||||
QAction *m_includeOldEntriesAction = nullptr;
|
QAction *m_includeOldEntriesAction = nullptr;
|
||||||
QAction *m_includeTagsAction = nullptr;
|
QAction *m_includeTagsAction = nullptr;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent *) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void refreshCurrentRepository();
|
void refreshCurrentRepository();
|
||||||
void resizeColumns();
|
void resizeColumns();
|
||||||
|
|||||||
Reference in New Issue
Block a user