From 07921dee775781ef681fea6a849cad8acd4c7a7a Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 26 Mar 2017 16:35:20 +0300 Subject: [PATCH] Git: Expand branches also on internal model refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I91e3b875be1a2c3b5da9ae7720709b34a7d83232 Reviewed-by: André Hartmann --- src/plugins/git/branchdialog.cpp | 4 ++++ src/plugins/git/branchdialog.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index 6f2184d5070..eb71c73531a 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -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(); } diff --git a/src/plugins/git/branchdialog.h b/src/plugins/git/branchdialog.h index db0318b5570..a967dc3bdf4 100644 --- a/src/plugins/git/branchdialog.h +++ b/src/plugins/git/branchdialog.h @@ -56,6 +56,7 @@ public: void refreshIfSame(const QString &repository); private: + void expandAndResize(); void resizeColumns(); void enableButtons(); void refreshCurrentRepository();