From d0a52b7b242e114d39a5fd25720a62a972eebcbe Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 20 Jan 2014 18:28:06 +0100 Subject: [PATCH] mostly refreshing view. --- apps/opencs/model/world/idtable.cpp | 5 +++++ apps/opencs/model/world/refidcollection.cpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index daa6bc51b..d4008fb87 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -129,7 +129,12 @@ void CSMWorld::IdTable::cloneRecord(const std::string& origin, CSMWorld::UniversalId::ArgumentType argumentType, CSMWorld::UniversalId::Type type) { + int index = mIdCollection->getAppendIndex (destination); + beginInsertRows (QModelIndex(), index, index); mIdCollection->cloneRecord(origin, destination, type, argumentType); + endInsertRows(); + emit dataChanged (CSMWorld::IdTable::index (0, 0), + CSMWorld::IdTable::index (mIdCollection->getSize()-1, mIdCollection->getColumns()-1)); } diff --git a/apps/opencs/model/world/refidcollection.cpp b/apps/opencs/model/world/refidcollection.cpp index 896ee9010..74f6f1359 100644 --- a/apps/opencs/model/world/refidcollection.cpp +++ b/apps/opencs/model/world/refidcollection.cpp @@ -454,7 +454,11 @@ void CSMWorld::RefIdCollection::cloneRecord(const std::string& origin, const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::ArgumentType argumentType) { - + RecordBase *newRecord = mData.getRecord(mData.searchId(origin)).clone(); + newRecord->mState = RecordBase::State_ModifiedOnly; + mAdapters.find(type)->second->setId(*newRecord, destination); + mData.getAppendIndex(type); + //WIP } void CSMWorld::RefIdCollection::appendRecord (const RecordBase& record,