Do not use same name on a variable and a function

p4#: 21147
This commit is contained in:
Magne Sjaastad
2013-04-05 14:32:33 +02:00
parent 2f14dbc411
commit 5911e2bf32
2 changed files with 7 additions and 7 deletions

View File

@@ -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()); PdmUiTreeItem* treeItem = static_cast<PdmUiTreeItem*>(currentIndex.internalPointer());
if (treeItem->dataObject() == object) return index; if (treeItem->dataObject() == object) return currentIndex;
} }
int row; 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; if (foundIndex.isValid()) return foundIndex;
} }
return QModelIndex(); return QModelIndex();

View File

@@ -68,7 +68,7 @@ public:
virtual bool removeRows_special(int position, int rows, const QModelIndex &parent = QModelIndex()); virtual bool removeRows_special(int position, int rows, const QModelIndex &parent = QModelIndex());
protected: protected:
QModelIndex getModelIndexFromPdmObjectRecursive(const QModelIndex& index, const PdmObject * object) const; QModelIndex getModelIndexFromPdmObjectRecursive(const QModelIndex& currentIndex, const PdmObject * object) const;
private: private:
PdmUiTreeItem* m_root; PdmUiTreeItem* m_root;