1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

removed more hardcoded column numbers

This commit is contained in:
Marc Zinnschlag 2014-06-07 14:39:34 +02:00
parent 302e2f8e9a
commit 7ede6573eb

View file

@ -230,9 +230,12 @@ CSMWorld::UniversalId CSVWorld::Table::getUniversalId (int row) const
{ {
row = mProxyModel->mapToSource (mProxyModel->index (row, 0)).row(); row = mProxyModel->mapToSource (mProxyModel->index (row, 0)).row();
int idColumn = mModel->findColumnIndex (CSMWorld::Columns::ColumnId_Id);
int typeColumn = mModel->findColumnIndex (CSMWorld::Columns::ColumnId_RecordType);
return CSMWorld::UniversalId ( return CSMWorld::UniversalId (
static_cast<CSMWorld::UniversalId::Type> (mModel->data (mModel->index (row, 2)).toInt()), static_cast<CSMWorld::UniversalId::Type> (mModel->data (mModel->index (row, typeColumn)).toInt()),
mModel->data (mModel->index (row, 0)).toString().toUtf8().constData()); mModel->data (mModel->index (row, idColumn)).toString().toUtf8().constData());
} }
void CSVWorld::Table::editRecord() void CSVWorld::Table::editRecord()