diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index dedbfc4e7..9172959bb 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -140,6 +140,8 @@ CSMWorld::Data::Data() addModel (new IdTable (&mBirthsigns), UniversalId::Type_Birthsigns, UniversalId::Type_Birthsign); addModel (new IdTable (&mSpells), UniversalId::Type_Spells, UniversalId::Type_Spell); addModel (new IdTable (&mCells), UniversalId::Type_Cells, UniversalId::Type_Cell); + addModel (new IdTable (&mReferenceables), UniversalId::Type_Referenceables, + UniversalId::Type_Referenceable); } CSMWorld::Data::~Data() @@ -268,6 +270,16 @@ CSMWorld::IdCollection& CSMWorld::Data::getCells() return mCells; } +const CSMWorld::RefIdCollection& CSMWorld::Data::getReferenceables() const +{ + return mReferenceables; +} + +CSMWorld::RefIdCollection& CSMWorld::Data::getReferenceables() +{ + return mReferenceables; +} + QAbstractItemModel *CSMWorld::Data::getTableModel (const UniversalId& id) { std::map::iterator iter = mModelIndex.find (id.getType()); diff --git a/apps/opencs/model/world/data.hpp b/apps/opencs/model/world/data.hpp index 03a2448f1..ad6e4ba69 100644 --- a/apps/opencs/model/world/data.hpp +++ b/apps/opencs/model/world/data.hpp @@ -21,6 +21,7 @@ #include "idcollection.hpp" #include "universalid.hpp" #include "cell.hpp" +#include "refidcollection.hpp" class QAbstractItemModel; @@ -40,6 +41,7 @@ namespace CSMWorld IdCollection mBirthsigns; IdCollection mSpells; IdCollection mCells; + RefIdCollection mReferenceables; std::vector mModels; std::map mModelIndex; @@ -104,6 +106,10 @@ namespace CSMWorld IdCollection& getCells(); + const RefIdCollection& getReferenceables() const; + + RefIdCollection& getReferenceables(); + QAbstractItemModel *getTableModel (const UniversalId& id); ///< If no table model is available for \a id, an exception is thrown. /// diff --git a/apps/opencs/model/world/idcollection.hpp b/apps/opencs/model/world/idcollection.hpp index 93390c97b..193e4f8e2 100644 --- a/apps/opencs/model/world/idcollection.hpp +++ b/apps/opencs/model/world/idcollection.hpp @@ -46,10 +46,12 @@ namespace CSMWorld virtual void setData (int index, int column, const QVariant& data) = 0; - virtual void merge() = 0; +// Not in use. Temporarily removed so that the implementation of RefIdCollection can continue without +// these functions for now. +// virtual void merge() = 0; ///< Merge modified into base. - virtual void purge() = 0; +// virtual void purge() = 0; ///< Remove records that are flagged as erased. virtual void removeRows (int index, int count) = 0;