Git: Fix context menu actions in BranchViews second column

m_branchView->indexAt(point) returned another model index
[column 1] than m_model->currentBranch() [column 0], if the
context menu was requested in thesecond (date/time) column.

The failed comparison then gave a lot of invalid actions
(like merge) for the current branch.

Change-Id: Icefc084c81f9b573cd151460db793d3c5a01eb2b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2018-10-12 19:43:33 +02:00
committed by Orgad Shaneh
parent 81a4c1d934
commit 299c777c01

View File

@@ -166,7 +166,7 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
return; return;
const QModelIndex currentBranch = m_model->currentBranch(); const QModelIndex currentBranch = m_model->currentBranch();
const bool currentSelected = index == currentBranch; const bool currentSelected = index.row() == currentBranch.row();
const bool isLocal = m_model->isLocal(index); const bool isLocal = m_model->isLocal(index);
const bool isTag = m_model->isTag(index); const bool isTag = m_model->isTag(index);
const bool hasActions = m_model->isLeaf(index); const bool hasActions = m_model->isLeaf(index);