ClangTools: Generalize some variables names

Change-Id: I81f9fa2c2c0d91c78050db0004114d22779550cf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-02-06 10:01:01 +01:00
parent a60cd0ba30
commit 9cca455fc7

View File

@@ -154,32 +154,32 @@ QModelIndex DiagnosticView::getIndex(const QModelIndex &index, Direction directi
{ {
QModelIndex parentIndex = index.parent(); QModelIndex parentIndex = index.parent();
// Use direct sibling for level 2 and 3 items is possible // Use direct sibling for level 2 and 3 items if possible
if (parentIndex.isValid()) { if (parentIndex.isValid()) {
const QModelIndex nextIndex = index.sibling(index.row() + direction, index.column()); const QModelIndex followingIndex = index.sibling(index.row() + direction, index.column());
if (nextIndex.isValid()) if (followingIndex.isValid())
return nextIndex; return followingIndex;
} }
// Last level 3 item? Continue on level 2 item // Last level 3 item? Continue on level 2 item
if (parentIndex.parent().isValid()) if (parentIndex.parent().isValid())
return getIndex(parentIndex, direction); return getIndex(parentIndex, direction);
// Find next/previous level 2 item // Find following level 2 item
QModelIndex nextTopIndex = getTopLevelIndex(parentIndex.isValid() ? parentIndex : index, QModelIndex followingTopIndex = getTopLevelIndex(parentIndex.isValid() ? parentIndex : index,
direction); direction);
while (!model()->hasChildren(nextTopIndex)) while (!model()->hasChildren(followingTopIndex))
nextTopIndex = getTopLevelIndex(nextTopIndex, direction); followingTopIndex = getTopLevelIndex(followingTopIndex, direction);
return model()->index(direction == Next ? 0 : model()->rowCount(nextTopIndex) - 1, return model()->index(direction == Next ? 0 : model()->rowCount(followingTopIndex) - 1,
0, 0,
nextTopIndex); followingTopIndex);
} }
QModelIndex DiagnosticView::getTopLevelIndex(const QModelIndex &index, Direction direction) const QModelIndex DiagnosticView::getTopLevelIndex(const QModelIndex &index, Direction direction) const
{ {
QModelIndex below = index.sibling(index.row() + direction, 0); QModelIndex following = index.sibling(index.row() + direction, 0);
if (below.isValid()) if (following.isValid())
return below; return following;
return model()->index(direction == Next ? 0 : model()->rowCount(index) - 1, 0); return model()->index(direction == Next ? 0 : model()->rowCount(index) - 1, 0);
} }