Git: Expand branches also on internal model refresh

Change-Id: I91e3b875be1a2c3b5da9ae7720709b34a7d83232
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2017-03-26 16:35:20 +03:00
committed by Orgad Shaneh
parent 8478e35384
commit 07921dee77
2 changed files with 5 additions and 0 deletions

View File

@@ -92,6 +92,7 @@ BranchDialog::BranchDialog(QWidget *parent) :
connect(m_model, &QAbstractItemModel::dataChanged, this, &BranchDialog::resizeColumns);
connect(m_model, &QAbstractItemModel::rowsInserted, this, &BranchDialog::resizeColumns);
connect(m_model, &QAbstractItemModel::rowsRemoved, this, &BranchDialog::resizeColumns);
connect(m_model, &QAbstractItemModel::modelReset, this, &BranchDialog::expandAndResize);
m_ui->branchView->selectionModel()->clear();
}
@@ -111,7 +112,10 @@ void BranchDialog::refresh(const QString &repository, bool force)
QString errorMessage;
if (!m_model->refresh(m_repository, &errorMessage))
VcsOutputWindow::appendError(errorMessage);
}
void BranchDialog::expandAndResize()
{
m_ui->branchView->expandAll();
resizeColumns();
}

View File

@@ -56,6 +56,7 @@ public:
void refreshIfSame(const QString &repository);
private:
void expandAndResize();
void resizeColumns();
void enableButtons();
void refreshCurrentRepository();