Git: Fix issues in the branch dialog

* Split part/next/last into a 'part' node and a 'next/last' node
  instead of 'part/next' and 'last' node. This is closer to what git does.

* Fix some model-issues along the way;)

* Unhighlight remote checked-out branches again once they are no longer
  the current one.

* Remove stale nodes after removing a branch. When removing 'first/next'
  kind of branches, do not keep a empty 'first' in the tree.

Task-number: QTCREATORBUG-8518

Change-Id: Ia5650540aa58354aaab513199c8622392bdbd37f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
This commit is contained in:
Tobias Hunger
2013-01-20 01:03:02 +01:00
parent 3898effa68
commit b6a9d58f69
3 changed files with 100 additions and 70 deletions

View File

@@ -82,8 +82,6 @@ BranchDialog::BranchDialog(QWidget *parent) :
BranchDialog::~BranchDialog()
{
delete m_ui;
delete m_model;
m_model = 0;
}
void BranchDialog::refresh(const QString &repository, bool force)
@@ -160,7 +158,6 @@ void BranchDialog::add()
void BranchDialog::checkout()
{
QModelIndex idx = selectedIndex();
QTC_CHECK(m_model->isLocal(idx));
const QString currentBranch = m_model->branchName(m_model->currentBranch());
const QString nextBranch = m_model->branchName(idx);