Skip to content

Commit

Permalink
Replaced ModuleItem::row() with BaseTreeItem::getOwnRow()
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaleee committed Apr 17, 2024
1 parent 0141426 commit c061ccc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
7 changes: 0 additions & 7 deletions plugins/gui/include/gui/module_model/module_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ namespace hal
*/
QVariant getData(int column) const override;

/**
* Gets the index of this ModuleItem in the list of children ModuleItems of its parent.
*
* @returns the index in the parents ModuleItem children list
*/
int row() const;

/**
* Gets the name of the netlist item this ModuleItem represents.
*
Expand Down
8 changes: 0 additions & 8 deletions plugins/gui/src/module_model/module_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ ModuleItem::ModuleItem(const u32 id, const TreeItemType type) :
}
}

int ModuleItem::row() const
{
BaseTreeItem* parent = getParent();
if (!parent) return 0;
return parent->getRowForChild(this);
}


void ModuleItem::appendExistingChildIfAny(const QMap<u32,ModuleItem*>& moduleMap)
{
if(mItemType != TreeItemType::Module) // only module can have children
Expand Down
4 changes: 2 additions & 2 deletions plugins/gui/src/module_model/module_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace hal

QModelIndex index = getIndexFromItem(parentItem);

int row = itemToRemove->row();
int row = itemToRemove->getOwnRow();

mIsModifying = true;
beginRemoveRows(index, row, row);
Expand Down Expand Up @@ -648,7 +648,7 @@ namespace hal
moduleItemToBeMoved = submItem;
QModelIndex index = getIndexFromItem(oldParentItem);

int row = submItem->row();
int row = submItem->getOwnRow();

mIsModifying = true;
beginRemoveRows(index, row, row);
Expand Down

0 comments on commit c061ccc

Please sign in to comment.