1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-13 21:39:41 +00:00

Small cleanup

This commit is contained in:
Marek Kochanowicz 2014-07-01 21:13:27 +02:00
parent fcd082c6a5
commit c50cecdc64
3 changed files with 5 additions and 10 deletions

View file

@ -127,12 +127,10 @@ bool CSMWorld::IdTable::removeRows (int row, int count, const QModelIndex& paren
{ {
if (parent.isValid()) if (parent.isValid())
{ {
beginRemoveRows(parent, row, row+count-1);
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
{ {
mIdCollection->removeNestedRows(parent.row(), parent.column(), row+i); mIdCollection->removeNestedRows(parent.row(), parent.column(), row+i);
} }
endRemoveRows();
return true; return true;
} }
@ -149,7 +147,11 @@ void CSMWorld::IdTable::addNestedRow(const QModelIndex& parent, int position)
{ {
assert(parent.isValid()); assert(parent.isValid());
mIdCollection->addNestedRow(parent.row(), parent.column(), position); int row = parent.row();
mIdCollection->addNestedRow(row, parent.column(), position);
emit dataChanged (CSMWorld::IdTable::index (row, 0),
CSMWorld::IdTable::index (row, mIdCollection->getColumns()-1));
} }
QModelIndex CSMWorld::IdTable::index (int row, int column, const QModelIndex& parent) const QModelIndex CSMWorld::IdTable::index (int row, int column, const QModelIndex& parent) const

View file

@ -77,7 +77,6 @@ void CSVWorld::NestedTable::removeRowActionTriggered()
mModel->getParentId(), mModel->getParentId(),
selectionModel()->selectedRows().begin()->row(), selectionModel()->selectedRows().begin()->row(),
mModel->getParentColumn())); mModel->getParentColumn()));
} }
void CSVWorld::NestedTable::addNewRowActionTriggered() void CSVWorld::NestedTable::addNewRowActionTriggered()
@ -86,5 +85,4 @@ void CSVWorld::NestedTable::addNewRowActionTriggered()
mModel->getParentId(), mModel->getParentId(),
selectionModel()->selectedRows().size(), selectionModel()->selectedRows().size(),
mModel->getParentColumn())); mModel->getParentColumn()));
} }

View file

@ -47,11 +47,6 @@ namespace CSVWorld
void removeRowActionTriggered(); void removeRowActionTriggered();
void addNewRowActionTriggered(); void addNewRowActionTriggered();
signals:
void addNewRow();
void removeRow(int row);
}; };
} }