From ef84e553beb94cd6ee56ff270dca6a182cc34331 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 12 Apr 2015 13:48:23 +1000 Subject: [PATCH] Renamed some stuff. --- apps/opencs/CMakeLists.txt | 2 +- apps/opencs/model/world/data.cpp | 166 +++++++++--------- ...adapterimp.cpp => nestedcoladapterimp.cpp} | 2 +- ...adapterimp.hpp => nestedcoladapterimp.hpp} | 20 +-- ...{idadapter.hpp => nestedcolumnadapter.hpp} | 17 +- .../opencs/model/world/nestedidcollection.hpp | 21 ++- 6 files changed, 114 insertions(+), 114 deletions(-) rename apps/opencs/model/world/{idadapterimp.cpp => nestedcoladapterimp.cpp} (99%) rename apps/opencs/model/world/{idadapterimp.hpp => nestedcoladapterimp.hpp} (96%) rename apps/opencs/model/world/{idadapter.hpp => nestedcolumnadapter.hpp} (77%) diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index bc0b964ae..babd3363f 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -25,7 +25,7 @@ opencs_units (model/world opencs_units_noqt (model/world universalid record commands columnbase scriptcontext cell refidcollection refidadapter refiddata refidadapterimp ref collectionbase refcollection columns infocollection tablemimedata cellcoordinates cellselection resources resourcesmanager scope - pathgrid landtexture land nestedtablewrapper nestedadapters nestedcollection idadapterimp + pathgrid landtexture land nestedtablewrapper nestedadapters nestedcollection nestedcoladapterimp ) opencs_hdrs_noqt (model/world diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index db644affa..d7280e354 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -18,7 +18,7 @@ #include "columns.hpp" #include "resourcesmanager.hpp" #include "resourcetable.hpp" -#include "idadapterimp.hpp" +#include "nestedcoladapterimp.hpp" void CSMWorld::Data::addModel (QAbstractItemModel *model, UniversalId::Type type, bool update) { @@ -64,6 +64,8 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc : mEncoder (encoding), mPathgrids (mCells), mRefs (mCells), mResourcesManager (resourcesManager), mReader (0), mDialogue (0), mReaderIndex(0) { + int index = 0; + mGlobals.addColumn (new StringIdColumn); mGlobals.addColumn (new RecordStateColumn); mGlobals.addColumn (new FixedRecordTypeColumn (UniversalId::Type_Global)); @@ -109,14 +111,13 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc for (int i=0; i<7; ++i) mFactions.addColumn (new SkillsColumn (i)); // Faction Reactions - NestedParentColumn *reactions = - new NestedParentColumn (Columns::ColumnId_FactionReactions); - mFactions.addColumn (reactions); - mFactions.addAdapter (std::make_pair(reactions, new FactionReactionsAdapter ())); - mFactions.getNestableColumn(mFactions.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_Faction, ColumnBase::Display_String)); - mFactions.getNestableColumn(mFactions.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_FactionReaction, ColumnBase::Display_Integer)); + mFactions.addColumn (new NestedParentColumn (Columns::ColumnId_FactionReactions)); + index = mFactions.getColumns()-1; + mFactions.addAdapter (std::make_pair(&mFactions.getColumn(index), new FactionReactionsAdapter ())); + mFactions.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Faction, ColumnBase::Display_String)); + mFactions.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_FactionReaction, ColumnBase::Display_Integer)); mRaces.addColumn (new StringIdColumn); mRaces.addColumn (new RecordStateColumn); @@ -130,12 +131,11 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mRaces.addColumn (new WeightHeightColumn (false, true)); mRaces.addColumn (new WeightHeightColumn (false, false)); // Race spells - NestedParentColumn *raceSpells = - new NestedParentColumn (Columns::ColumnId_SpellList); - mRaces.addColumn (raceSpells); - mRaces.addAdapter (std::make_pair(raceSpells, new SpellListAdapter ())); - mRaces.getNestableColumn(mRaces.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_SpellId, ColumnBase::Display_String)); + mRaces.addColumn (new NestedParentColumn (Columns::ColumnId_SpellList)); + index = mRaces.getColumns()-1; + mRaces.addAdapter (std::make_pair(&mRaces.getColumn(index), new SpellListAdapter ())); + mRaces.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_SpellId, ColumnBase::Display_String)); mSounds.addColumn (new StringIdColumn); mSounds.addColumn (new RecordStateColumn); @@ -157,14 +157,13 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mRegions.addColumn (new MapColourColumn); mRegions.addColumn (new SleepListColumn); // Region Sounds - NestedParentColumn *soundList = - new NestedParentColumn (Columns::ColumnId_RegionSounds); - mRegions.addColumn (soundList); - mRegions.addAdapter (std::make_pair(soundList, new RegionSoundListAdapter ())); - mRegions.getNestableColumn(mRegions.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_SoundName, ColumnBase::Display_String)); - mRegions.getNestableColumn(mRegions.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_SoundChance, ColumnBase::Display_Integer)); + mRegions.addColumn (new NestedParentColumn (Columns::ColumnId_RegionSounds)); + index = mRegions.getColumns()-1; + mRegions.addAdapter (std::make_pair(&mRegions.getColumn(index), new RegionSoundListAdapter ())); + mRegions.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_SoundName, ColumnBase::Display_String)); + mRegions.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_SoundChance, ColumnBase::Display_Integer)); mBirthsigns.addColumn (new StringIdColumn); mBirthsigns.addColumn (new RecordStateColumn); @@ -173,12 +172,12 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mBirthsigns.addColumn (new TextureColumn); mBirthsigns.addColumn (new DescriptionColumn); // Birthsign spells - NestedParentColumn *birthSpells = - new NestedParentColumn (Columns::ColumnId_SpellList); - mBirthsigns.addColumn (birthSpells); - mBirthsigns.addAdapter (std::make_pair(birthSpells, new SpellListAdapter ())); - mBirthsigns.getNestableColumn(mBirthsigns.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_SpellId, ColumnBase::Display_String)); + mBirthsigns.addColumn (new NestedParentColumn (Columns::ColumnId_SpellList)); + index = mBirthsigns.getColumns()-1; + mBirthsigns.addAdapter (std::make_pair(&mBirthsigns.getColumn(index), + new SpellListAdapter ())); + mBirthsigns.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_SpellId, ColumnBase::Display_String)); mSpells.addColumn (new StringIdColumn); mSpells.addColumn (new RecordStateColumn); @@ -190,26 +189,25 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mSpells.addColumn (new FlagColumn (Columns::ColumnId_StarterSpell, 0x2)); mSpells.addColumn (new FlagColumn (Columns::ColumnId_AlwaysSucceeds, 0x4)); // Spell effects - NestedParentColumn *spellEffect = - new NestedParentColumn (Columns::ColumnId_EffectList); - mSpells.addColumn (spellEffect); - mSpells.addAdapter (std::make_pair(spellEffect, new EffectsListAdapter ())); - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_EffectId, ColumnBase::Display_String/*, false*/)); // false means no edit - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_Skill, ColumnBase::Display_String)); - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_String)); // reuse attribute - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_EffectRange, ColumnBase::Display_Integer)); - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_EffectArea, ColumnBase::Display_String)); - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_Duration, ColumnBase::Display_Integer)); // reuse from light - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_MinRange, ColumnBase::Display_Integer)); // reuse from sound - mSpells.getNestableColumn(mSpells.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_MaxRange, ColumnBase::Display_Integer)); // reuse from sound + mSpells.addColumn (new NestedParentColumn (Columns::ColumnId_EffectList)); + index = mSpells.getColumns()-1; + mSpells.addAdapter (std::make_pair(&mSpells.getColumn(index), new EffectsListAdapter ())); + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_EffectId, ColumnBase::Display_String/*, false*/)); // false means no edit + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Skill, ColumnBase::Display_String)); + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_String)); // reuse attribute + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_EffectRange, ColumnBase::Display_Integer)); + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_EffectArea, ColumnBase::Display_String)); + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Duration, ColumnBase::Display_Integer)); // reuse from light + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_MinRange, ColumnBase::Display_Integer)); // reuse from sound + mSpells.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_MaxRange, ColumnBase::Display_Integer)); // reuse from sound mTopics.addColumn (new StringIdColumn); mTopics.addColumn (new RecordStateColumn); @@ -264,26 +262,26 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mEnchantments.addColumn (new ChargesColumn2); mEnchantments.addColumn (new AutoCalcColumn); // Enchantment effects - NestedParentColumn *enchantmentEffect = - new NestedParentColumn (Columns::ColumnId_EffectList); - mEnchantments.addColumn (enchantmentEffect); - mEnchantments.addAdapter (std::make_pair(enchantmentEffect, new EffectsListAdapter ())); - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_EffectId, ColumnBase::Display_String/*, false*/)); - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_Skill, ColumnBase::Display_String)); - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_String)); // reuse attribute - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_EffectRange, ColumnBase::Display_Integer)); - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_EffectArea, ColumnBase::Display_String)); - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_Duration, ColumnBase::Display_Integer)); // reuse from light - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_MinRange, ColumnBase::Display_Integer)); // reuse from sound - mEnchantments.getNestableColumn(mEnchantments.getColumns()-1)->addColumn( - new NestedChildColumn (Columns::ColumnId_MaxRange, ColumnBase::Display_Integer)); // reuse from sound + mEnchantments.addColumn (new NestedParentColumn (Columns::ColumnId_EffectList)); + index = mEnchantments.getColumns()-1; + mEnchantments.addAdapter (std::make_pair(&mEnchantments.getColumn(index), + new EffectsListAdapter ())); + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_EffectId, ColumnBase::Display_String/*, false*/)); + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Skill, ColumnBase::Display_String)); + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Attribute, ColumnBase::Display_String)); // reuse attribute + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_EffectRange, ColumnBase::Display_Integer)); + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_EffectArea, ColumnBase::Display_String)); + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_Duration, ColumnBase::Display_Integer)); // reuse from light + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_MinRange, ColumnBase::Display_Integer)); // reuse from sound + mEnchantments.getNestableColumn(index)->addColumn( + new NestedChildColumn (Columns::ColumnId_MaxRange, ColumnBase::Display_Integer)); // reuse from sound mBodyParts.addColumn (new StringIdColumn); mBodyParts.addColumn (new RecordStateColumn); @@ -331,31 +329,29 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc mPathgrids.addColumn (new FixedRecordTypeColumn (UniversalId::Type_Pathgrid)); // new object deleted in dtor of Collection - NestedParentColumn *pointList = - new NestedParentColumn (Columns::ColumnId_PathgridPoints); - mPathgrids.addColumn (pointList); - // new object deleted in dtor of SubCellCollection - mPathgrids.addAdapter (std::make_pair(pointList, new PathgridPointListAdapter ())); + mPathgrids.addColumn (new NestedParentColumn (Columns::ColumnId_PathgridPoints)); + index = mPathgrids.getColumns()-1; + // new object deleted in dtor of NestedCollection + mPathgrids.addAdapter (std::make_pair(&mPathgrids.getColumn(index), new PathgridPointListAdapter ())); // new objects deleted in dtor of NestableColumn // WARNING: The order of the columns below are assumed in PathgridPointListAdapter - mPathgrids.getNestableColumn(mPathgrids.getColumns()-1)->addColumn( + mPathgrids.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_PathgridIndex, ColumnBase::Display_Integer, false)); - mPathgrids.getNestableColumn(mPathgrids.getColumns()-1)->addColumn( + mPathgrids.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_PathgridPosX, ColumnBase::Display_Integer)); - mPathgrids.getNestableColumn(mPathgrids.getColumns()-1)->addColumn( + mPathgrids.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_PathgridPosY, ColumnBase::Display_Integer)); - mPathgrids.getNestableColumn(mPathgrids.getColumns()-1)->addColumn( + mPathgrids.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_PathgridPosZ, ColumnBase::Display_Integer)); - NestedParentColumn *edgeList = - new NestedParentColumn (Columns::ColumnId_PathgridEdges); - mPathgrids.addColumn (edgeList); - mPathgrids.addAdapter (std::make_pair(edgeList, new PathgridEdgeListAdapter ())); - mPathgrids.getNestableColumn(mPathgrids.getColumns()-1)->addColumn( + mPathgrids.addColumn (new NestedParentColumn (Columns::ColumnId_PathgridEdges)); + index = mPathgrids.getColumns()-1; + mPathgrids.addAdapter (std::make_pair(&mPathgrids.getColumn(index), new PathgridEdgeListAdapter ())); + mPathgrids.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_PathgridEdgeIndex, ColumnBase::Display_Integer, false)); - mPathgrids.getNestableColumn(mPathgrids.getColumns()-1)->addColumn( + mPathgrids.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_PathgridEdge0, ColumnBase::Display_Integer)); - mPathgrids.getNestableColumn(mPathgrids.getColumns()-1)->addColumn( + mPathgrids.getNestableColumn(index)->addColumn( new NestedChildColumn (Columns::ColumnId_PathgridEdge1, ColumnBase::Display_Integer)); mStartScripts.addColumn (new StringIdColumn); diff --git a/apps/opencs/model/world/idadapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp similarity index 99% rename from apps/opencs/model/world/idadapterimp.cpp rename to apps/opencs/model/world/nestedcoladapterimp.cpp index 95e68e09e..2bf1ffadd 100644 --- a/apps/opencs/model/world/idadapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -1,4 +1,4 @@ -#include "idadapterimp.hpp" +#include "nestedcoladapterimp.hpp" #include #include diff --git a/apps/opencs/model/world/idadapterimp.hpp b/apps/opencs/model/world/nestedcoladapterimp.hpp similarity index 96% rename from apps/opencs/model/world/idadapterimp.hpp rename to apps/opencs/model/world/nestedcoladapterimp.hpp index effa0011c..7fed74868 100644 --- a/apps/opencs/model/world/idadapterimp.hpp +++ b/apps/opencs/model/world/nestedcoladapterimp.hpp @@ -1,5 +1,5 @@ -#ifndef CSM_WOLRD_IDADAPTERIMP_H -#define CSM_WOLRD_IDADAPTERIMP_H +#ifndef CSM_WOLRD_NESTEDCOLADAPTERIMP_H +#define CSM_WOLRD_NESTEDCOLADAPTERIMP_H #include @@ -9,7 +9,7 @@ #include // for converting skill names #include // for converting attributes -#include "idadapter.hpp" +#include "nestedcolumnadapter.hpp" #include "nestedtablewrapper.hpp" namespace ESM @@ -37,7 +37,7 @@ namespace CSMWorld } }; - class PathgridPointListAdapter : public NestedIdAdapter + class PathgridPointListAdapter : public NestedColumnAdapter { public: PathgridPointListAdapter (); @@ -62,7 +62,7 @@ namespace CSMWorld virtual int getNestedRowsCount(const Record& record) const; }; - class PathgridEdgeListAdapter : public NestedIdAdapter + class PathgridEdgeListAdapter : public NestedColumnAdapter { public: PathgridEdgeListAdapter (); @@ -87,7 +87,7 @@ namespace CSMWorld virtual int getNestedRowsCount(const Record& record) const; }; - class FactionReactionsAdapter : public NestedIdAdapter + class FactionReactionsAdapter : public NestedColumnAdapter { public: FactionReactionsAdapter (); @@ -112,7 +112,7 @@ namespace CSMWorld virtual int getNestedRowsCount(const Record& record) const; }; - class RegionSoundListAdapter : public NestedIdAdapter + class RegionSoundListAdapter : public NestedColumnAdapter { public: RegionSoundListAdapter (); @@ -138,7 +138,7 @@ namespace CSMWorld }; template - class SpellListAdapter : public NestedIdAdapter + class SpellListAdapter : public NestedColumnAdapter { public: SpellListAdapter () {} @@ -234,7 +234,7 @@ namespace CSMWorld }; template - class EffectsListAdapter : public NestedIdAdapter + class EffectsListAdapter : public NestedColumnAdapter { public: EffectsListAdapter () {} @@ -476,4 +476,4 @@ namespace CSMWorld }; } -#endif // CSM_WOLRD_IDADAPTERIMP_H +#endif // CSM_WOLRD_NESTEDCOLADAPTERIMP_H diff --git a/apps/opencs/model/world/idadapter.hpp b/apps/opencs/model/world/nestedcolumnadapter.hpp similarity index 77% rename from apps/opencs/model/world/idadapter.hpp rename to apps/opencs/model/world/nestedcolumnadapter.hpp index 84ef2d1f8..e7e66ed4d 100644 --- a/apps/opencs/model/world/idadapter.hpp +++ b/apps/opencs/model/world/nestedcolumnadapter.hpp @@ -1,7 +1,5 @@ -#ifndef CSM_WOLRD_IDADAPTER_H -#define CSM_WOLRD_IDADAPTER_H - -#include "record.hpp" +#ifndef CSM_WOLRD_NESTEDCOLUMNADAPTER_H +#define CSM_WOLRD_NESTEDCOLUMNADAPTER_H class QVariant; @@ -9,14 +7,17 @@ namespace CSMWorld { struct NestedTableWrapperBase; + template + struct Record; + template - class NestedIdAdapter + class NestedColumnAdapter { public: - NestedIdAdapter() {} + NestedColumnAdapter() {} - virtual ~NestedIdAdapter() {} + virtual ~NestedColumnAdapter() {} virtual void addNestedRow(Record& record, int position) const = 0; @@ -36,4 +37,4 @@ namespace CSMWorld }; } -#endif // CSM_WOLRD_IDADAPTER_H +#endif // CSM_WOLRD_NESTEDCOLUMNADAPTER_H diff --git a/apps/opencs/model/world/nestedidcollection.hpp b/apps/opencs/model/world/nestedidcollection.hpp index c7e840955..0cf51b9d8 100644 --- a/apps/opencs/model/world/nestedidcollection.hpp +++ b/apps/opencs/model/world/nestedidcollection.hpp @@ -5,7 +5,7 @@ #include #include "nestedcollection.hpp" -#include "idadapterimp.hpp" +#include "nestedcoladapterimp.hpp" namespace ESM { @@ -23,9 +23,9 @@ namespace CSMWorld template > class NestedIdCollection : public IdCollection, public NestedCollection { - std::map* > mAdapters; + std::map* > mAdapters; - const NestedIdAdapter& getAdapter(const ColumnBase &column) const; + const NestedColumnAdapter& getAdapter(const ColumnBase &column) const; public: @@ -51,7 +51,7 @@ namespace CSMWorld // this method is inherited from NestedCollection, not from Collection virtual NestableColumn *getNestableColumn(int column); - void addAdapter(std::pair* > adapter); + void addAdapter(std::pair* > adapter); }; template @@ -61,21 +61,24 @@ namespace CSMWorld template NestedIdCollection::~NestedIdCollection() { - for (typename std::map* >::iterator iter (mAdapters.begin()); - iter!=mAdapters.end(); ++iter) + for (typename std::map* >::iterator + iter (mAdapters.begin()); iter!=mAdapters.end(); ++iter) + { delete (*iter).second; + } } template - void NestedIdCollection::addAdapter(std::pair* > adapter) + void NestedIdCollection::addAdapter(std::pair* > adapter) { mAdapters.insert(adapter); } template - const NestedIdAdapter& NestedIdCollection::getAdapter(const ColumnBase &column) const + const NestedColumnAdapter& NestedIdCollection::getAdapter(const ColumnBase &column) const { - typename std::map* >::const_iterator iter = + typename std::map* >::const_iterator iter = mAdapters.find (&column); if (iter==mAdapters.end())