1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 11:45:34 +00:00

cleaning up the code

This commit is contained in:
Marek Kochanowicz 2014-07-31 12:18:24 +02:00
parent c6194e7ea3
commit 40edf15ab0
3 changed files with 10 additions and 5 deletions

View file

@ -2,6 +2,7 @@
#define CSM_WOLRD_COLLECTION_H #define CSM_WOLRD_COLLECTION_H
#include <vector> #include <vector>
#include <iostream>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>

View file

@ -4,6 +4,7 @@
#include <sstream> #include <sstream>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <iostream>
#include <QColor> #include <QColor>

View file

@ -2,6 +2,7 @@
#include <QDebug> #include <QDebug>
#include <cassert> #include <cassert>
#include <iostream>
#include "nestedtablewrapper.hpp" #include "nestedtablewrapper.hpp"
#include "collectionbase.hpp" #include "collectionbase.hpp"
@ -30,7 +31,7 @@ int CSMWorld::IdTable::columnCount (const QModelIndex & parent) const
{ {
return dynamic_cast<NestedCollection*>(mIdCollection)->getNestedColumnsCount(parent.row(), parent.column()); return dynamic_cast<NestedCollection*>(mIdCollection)->getNestedColumnsCount(parent.row(), parent.column());
} }
return mIdCollection->getColumns(); return mIdCollection->getColumns();
} }
@ -46,9 +47,9 @@ QVariant CSMWorld::IdTable::data (const QModelIndex & index, int role) const
{ {
std::pair<int, int> parentAdress(unfoldIndexAdress(index.internalId())); std::pair<int, int> parentAdress(unfoldIndexAdress(index.internalId()));
return dynamic_cast<NestedCollection*>(mIdCollection)->getNestedData(parentAdress.first, return dynamic_cast<NestedCollection*>(mIdCollection)->getNestedData(parentAdress.first,
parentAdress.second, parentAdress.second,
index.row(), index.row(),
index.column()); index.column());
} else { } else {
return mIdCollection->getData (index.row(), index.column()); return mIdCollection->getData (index.row(), index.column());
} }
@ -68,8 +69,10 @@ QVariant CSMWorld::IdTable::headerData (int section,
return mIdCollection->getColumn (section).mFlags; return mIdCollection->getColumn (section).mFlags;
if (role==ColumnBase::Role_Display) if (role==ColumnBase::Role_Display)
{
return mIdCollection->getColumn (section).mDisplayType; return mIdCollection->getColumn (section).mDisplayType;
}
return QVariant(); return QVariant();
} }