From ce15a0f44799c4d04ea4898f48ed3c06b2e6770c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 28 Oct 2018 09:00:50 +0200 Subject: [PATCH] Git: Fix detection of current selected index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comparing the row is not enough. Row is relative to the parent, so the second row in locals was wrongfully considered identical to the second row in a remote. This amends commit 299c777c019fb9573b31034e3ca327e6ca59c500. Change-Id: I4c5e43e3107a1f01bbed7abf9b7e2a2d3feb4feb Reviewed-by: André Hartmann --- src/plugins/git/branchview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index c37bc87abb0..9268d3d6e05 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -194,7 +194,7 @@ void BranchView::slotCustomContextMenu(const QPoint &point) const QModelIndex index = m_filterModel->mapToSource(filteredIndex); const QModelIndex currentBranch = m_model->currentBranch(); - const bool currentSelected = index.row() == currentBranch.row(); + const bool currentSelected = index.sibling(index.row(), 0) == currentBranch; const bool isLocal = m_model->isLocal(index); const bool isTag = m_model->isTag(index); const bool hasActions = m_model->isLeaf(index);