mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Do not use same name on a variable and a function
p4#: 21147
This commit is contained in:
parent
2f14dbc411
commit
5911e2bf32
@ -380,18 +380,18 @@ PdmUiTreeItem* caf::UiTreeModelPdm::getTreeItemFromIndex(const QModelIndex& inde
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QModelIndex caf::UiTreeModelPdm::getModelIndexFromPdmObjectRecursive(const QModelIndex& index, const PdmObject * object) const
|
||||
QModelIndex caf::UiTreeModelPdm::getModelIndexFromPdmObjectRecursive(const QModelIndex& currentIndex, const PdmObject * object) const
|
||||
{
|
||||
if (index.internalPointer())
|
||||
if (currentIndex.internalPointer())
|
||||
{
|
||||
PdmUiTreeItem* treeItem = static_cast<PdmUiTreeItem*>(index.internalPointer());
|
||||
if (treeItem->dataObject() == object) return index;
|
||||
PdmUiTreeItem* treeItem = static_cast<PdmUiTreeItem*>(currentIndex.internalPointer());
|
||||
if (treeItem->dataObject() == object) return currentIndex;
|
||||
}
|
||||
|
||||
int row;
|
||||
for (row = 0; row < rowCount(index); ++row)
|
||||
for (row = 0; row < rowCount(currentIndex); ++row)
|
||||
{
|
||||
QModelIndex foundIndex = getModelIndexFromPdmObjectRecursive(index(row, 0, index), object);
|
||||
QModelIndex foundIndex = getModelIndexFromPdmObjectRecursive(index(row, 0, currentIndex), object);
|
||||
if (foundIndex.isValid()) return foundIndex;
|
||||
}
|
||||
return QModelIndex();
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
virtual bool removeRows_special(int position, int rows, const QModelIndex &parent = QModelIndex());
|
||||
|
||||
protected:
|
||||
QModelIndex getModelIndexFromPdmObjectRecursive(const QModelIndex& index, const PdmObject * object) const;
|
||||
QModelIndex getModelIndexFromPdmObjectRecursive(const QModelIndex& currentIndex, const PdmObject * object) const;
|
||||
|
||||
private:
|
||||
PdmUiTreeItem* m_root;
|
||||
|
Loading…
Reference in New Issue
Block a user