From c4e738677032425b6dcc0daf2db78cb6b081e5c9 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Wed, 4 Jun 2014 21:12:23 +0200 Subject: [PATCH] Revert "added changed reference tracking for cells" This reverts commit f4334da42ec0076c073aed1a3aec6a4a17f1ba5a. --- apps/opencs/model/world/cell.hpp | 7 ++-- apps/opencs/model/world/columnimp.hpp | 40 ----------------------- apps/opencs/model/world/refcollection.cpp | 6 ---- 3 files changed, 2 insertions(+), 51 deletions(-) diff --git a/apps/opencs/model/world/cell.hpp b/apps/opencs/model/world/cell.hpp index 8a2781590..a47dbf45d 100644 --- a/apps/opencs/model/world/cell.hpp +++ b/apps/opencs/model/world/cell.hpp @@ -1,7 +1,7 @@ #ifndef CSM_WOLRD_CELL_H #define CSM_WOLRD_CELL_H -#include +#include #include #include @@ -16,11 +16,8 @@ namespace CSMWorld { std::string mId; - /// These are the references modified by the edited content file. These are stored in - /// mModified only. - std::set mTouchedRefs; - void load (ESM::ESMReader &esm); + }; } diff --git a/apps/opencs/model/world/columnimp.hpp b/apps/opencs/model/world/columnimp.hpp index 6b276d151..6976b454d 100644 --- a/apps/opencs/model/world/columnimp.hpp +++ b/apps/opencs/model/world/columnimp.hpp @@ -10,7 +10,6 @@ #include "columnbase.hpp" #include "columns.hpp" #include "info.hpp" -#include "cell.hpp" namespace CSMWorld { @@ -88,45 +87,6 @@ namespace CSMWorld } }; - /// \brief Specialisation that takes care of the modified reference tracking - template<> - struct RecordStateColumn : public Column - { - RecordStateColumn() - : Column (Columns::ColumnId_Modification, ColumnBase::Display_RecordState) - {} - - virtual QVariant get (const Record& record) const - { - if (record.mState==Record::State_Erased) - return static_cast (Record::State_Deleted); - - if (!record.mModified.mTouchedRefs.empty() && - !record.mState==Record::State_Deleted && - !record.mState==Record::State_ModifiedOnly) - { - static_cast (Record::State_Modified); - } - - return static_cast (record.mState); - } - - virtual void set (Record& record, const QVariant& data) - { - record.mState = static_cast (data.toInt()); - } - - virtual bool isEditable() const - { - return true; - } - - virtual bool isUserEditable() const - { - return false; - } - }; - template struct FixedRecordTypeColumn : public Column { diff --git a/apps/opencs/model/world/refcollection.cpp b/apps/opencs/model/world/refcollection.cpp index 36518f0fa..c516e2c3e 100644 --- a/apps/opencs/model/world/refcollection.cpp +++ b/apps/opencs/model/world/refcollection.cpp @@ -53,8 +53,6 @@ void CSMWorld::RefCollection::load (ESM::ESMReader& reader, int cellIndex, bool } else { - cell.mModified.mTouchedRefs.insert (Misc::StringUtils::lowerCase ( - mCells.getId (cellIndex))); record.mState = RecordBase::State_Deleted; setRecord (index, record); } @@ -62,10 +60,6 @@ void CSMWorld::RefCollection::load (ESM::ESMReader& reader, int cellIndex, bool continue; } - if (!base) - cell.mModified.mTouchedRefs.insert (Misc::StringUtils::lowerCase ( - mCells.getId (cellIndex))); - if (iter==cache.end()) { // new reference