forked from qt-creator/qt-creator
Git: Expand branches also on internal model refresh
Change-Id: I91e3b875be1a2c3b5da9ae7720709b34a7d83232 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
8478e35384
commit
07921dee77
@@ -92,6 +92,7 @@ BranchDialog::BranchDialog(QWidget *parent) :
|
|||||||
connect(m_model, &QAbstractItemModel::dataChanged, this, &BranchDialog::resizeColumns);
|
connect(m_model, &QAbstractItemModel::dataChanged, this, &BranchDialog::resizeColumns);
|
||||||
connect(m_model, &QAbstractItemModel::rowsInserted, this, &BranchDialog::resizeColumns);
|
connect(m_model, &QAbstractItemModel::rowsInserted, this, &BranchDialog::resizeColumns);
|
||||||
connect(m_model, &QAbstractItemModel::rowsRemoved, this, &BranchDialog::resizeColumns);
|
connect(m_model, &QAbstractItemModel::rowsRemoved, this, &BranchDialog::resizeColumns);
|
||||||
|
connect(m_model, &QAbstractItemModel::modelReset, this, &BranchDialog::expandAndResize);
|
||||||
|
|
||||||
m_ui->branchView->selectionModel()->clear();
|
m_ui->branchView->selectionModel()->clear();
|
||||||
}
|
}
|
||||||
@@ -111,7 +112,10 @@ void BranchDialog::refresh(const QString &repository, bool force)
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!m_model->refresh(m_repository, &errorMessage))
|
if (!m_model->refresh(m_repository, &errorMessage))
|
||||||
VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BranchDialog::expandAndResize()
|
||||||
|
{
|
||||||
m_ui->branchView->expandAll();
|
m_ui->branchView->expandAll();
|
||||||
resizeColumns();
|
resizeColumns();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public:
|
|||||||
void refreshIfSame(const QString &repository);
|
void refreshIfSame(const QString &repository);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void expandAndResize();
|
||||||
void resizeColumns();
|
void resizeColumns();
|
||||||
void enableButtons();
|
void enableButtons();
|
||||||
void refreshCurrentRepository();
|
void refreshCurrentRepository();
|
||||||
|
|||||||
Reference in New Issue
Block a user