forked from qt-creator/qt-creator
Git: Simplify conditions in BranchView
index.isValid() is already checked in line 165, so it does not need to be checked afterwards because it is always true there. isLeaf is only used once, so join the assignment. Change-Id: I5f21486fd440b82d8e99be1248adf023da664c1e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
17fa69eb42
commit
81a4c1d934
@@ -166,12 +166,10 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const QModelIndex currentBranch = m_model->currentBranch();
|
const QModelIndex currentBranch = m_model->currentBranch();
|
||||||
const bool hasSelection = index.isValid();
|
const bool currentSelected = index == currentBranch;
|
||||||
const bool currentSelected = hasSelection && index == currentBranch;
|
|
||||||
const bool isLocal = m_model->isLocal(index);
|
const bool isLocal = m_model->isLocal(index);
|
||||||
const bool isLeaf = m_model->isLeaf(index);
|
|
||||||
const bool isTag = m_model->isTag(index);
|
const bool isTag = m_model->isTag(index);
|
||||||
const bool hasActions = hasSelection && isLeaf;
|
const bool hasActions = m_model->isLeaf(index);
|
||||||
const bool currentLocal = m_model->isLocal(currentBranch);
|
const bool currentLocal = m_model->isLocal(currentBranch);
|
||||||
|
|
||||||
QMenu contextMenu;
|
QMenu contextMenu;
|
||||||
|
Reference in New Issue
Block a user