diff --git a/apps/opencs/model/world/collection.hpp b/apps/opencs/model/world/collection.hpp index d91260a5f..4bb10c1d8 100644 --- a/apps/opencs/model/world/collection.hpp +++ b/apps/opencs/model/world/collection.hpp @@ -102,8 +102,7 @@ namespace CSMWorld virtual void cloneRecord(const std::string& origin, const std::string& destination, - const UniversalId::Type type, - const UniversalId::ArgumentType argumentType); + const UniversalId::Type type); virtual int searchId (const std::string& id) const; ////< Search record with \a id. @@ -203,8 +202,7 @@ namespace CSMWorld template void Collection::cloneRecord(const std::string& origin, const std::string& destination, - const UniversalId::Type type, - const UniversalId::ArgumentType argumentType) + const UniversalId::Type type) { Record copy(getRecord(origin)); copy.mState = RecordBase::State_ModifiedOnly; diff --git a/apps/opencs/model/world/collectionbase.hpp b/apps/opencs/model/world/collectionbase.hpp index d32847490..2473ae741 100644 --- a/apps/opencs/model/world/collectionbase.hpp +++ b/apps/opencs/model/world/collectionbase.hpp @@ -76,8 +76,7 @@ namespace CSMWorld virtual void cloneRecord(const std::string& origin, const std::string& destination, - const UniversalId::Type type, - const UniversalId::ArgumentType argumentType) = 0; + const UniversalId::Type type) = 0; virtual const RecordBase& getRecord (const std::string& id) const = 0; diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index 789e65a21..5eb2e9414 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -27,13 +27,11 @@ CSMWorld::CloneCommand::CloneCommand(CSMWorld::IdTable& model, const std::string& idOrigin, const std::string& IdDestination, const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumentType, QUndoCommand* parent) : QUndoCommand(parent), mModel(model), mIdOrigin(idOrigin), mIdDestination(Misc::StringUtils::lowerCase(IdDestination)), - mArgumentType(argumentType), mType(type) { setText(("Clone record " + idOrigin + " to the " + IdDestination).c_str()); @@ -42,7 +40,7 @@ CSMWorld::CloneCommand::CloneCommand(CSMWorld::IdTable& model, void CSMWorld::CloneCommand::redo() { - mModel.cloneRecord(mIdOrigin, mIdDestination, mArgumentType, mType); + mModel.cloneRecord(mIdOrigin, mIdDestination, mType); for (std::map::const_iterator iter(mValues.begin()); iter != mValues.end(); ++iter) mModel.setData(mModel.getModelIndex(mIdDestination, iter->first), iter->second); diff --git a/apps/opencs/model/world/commands.hpp b/apps/opencs/model/world/commands.hpp index 04eb0afbf..0dedea012 100644 --- a/apps/opencs/model/world/commands.hpp +++ b/apps/opencs/model/world/commands.hpp @@ -45,7 +45,6 @@ namespace CSMWorld std::string mIdOrigin; std::string mIdDestination; UniversalId::Type mType; - UniversalId::ArgumentType mArgumentType; std::map mValues; public: @@ -53,7 +52,6 @@ namespace CSMWorld CloneCommand (IdTable& model, const std::string& idOrigin, const std::string& IdDestination, const UniversalId::Type type, - const UniversalId::ArgumentType argumentType, QUndoCommand* parent = 0); virtual void redo(); diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index f131f7087..bea307aa2 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -126,12 +126,11 @@ void CSMWorld::IdTable::addRecord (const std::string& id, UniversalId::Type type void CSMWorld::IdTable::cloneRecord(const std::string& origin, const std::string& destination, - CSMWorld::UniversalId::ArgumentType argumentType, CSMWorld::UniversalId::Type type) { int index = mIdCollection->getAppendIndex (destination); beginInsertRows (QModelIndex(), index, index); - mIdCollection->cloneRecord(origin, destination, type, argumentType); + mIdCollection->cloneRecord(origin, destination, type); endInsertRows(); } diff --git a/apps/opencs/model/world/idtable.hpp b/apps/opencs/model/world/idtable.hpp index ce47307e3..2d620004c 100644 --- a/apps/opencs/model/world/idtable.hpp +++ b/apps/opencs/model/world/idtable.hpp @@ -65,7 +65,6 @@ namespace CSMWorld void cloneRecord(const std::string& origin, const std::string& destination, - UniversalId::ArgumentType argumentType, UniversalId::Type type = UniversalId::Type_None); QModelIndex getModelIndex (const std::string& id, int column) const; diff --git a/apps/opencs/model/world/refidcollection.cpp b/apps/opencs/model/world/refidcollection.cpp index 75a1b681d..5e8d38117 100644 --- a/apps/opencs/model/world/refidcollection.cpp +++ b/apps/opencs/model/world/refidcollection.cpp @@ -451,15 +451,13 @@ void CSMWorld::RefIdCollection::replace (int index, const RecordBase& record) void CSMWorld::RefIdCollection::cloneRecord(const std::string& origin, const std::string& destination, - const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumentType) + const CSMWorld::UniversalId::Type type) { RecordBase *newRecord = mData.getRecord(mData.searchId(origin)).clone(); newRecord->mState = RecordBase::State_ModifiedOnly; mAdapters.find(type)->second->setId(*newRecord, destination); mData.insertRecord(*newRecord, type, destination); delete newRecord; - //WIP } void CSMWorld::RefIdCollection::appendRecord (const RecordBase& record, diff --git a/apps/opencs/model/world/refidcollection.hpp b/apps/opencs/model/world/refidcollection.hpp index 4ad181004..ebbf2100d 100644 --- a/apps/opencs/model/world/refidcollection.hpp +++ b/apps/opencs/model/world/refidcollection.hpp @@ -71,8 +71,7 @@ namespace CSMWorld virtual void cloneRecord(const std::string& origin, const std::string& destination, - const UniversalId::Type type, - const UniversalId::ArgumentType argumentType); + const UniversalId::Type type); virtual void appendBlankRecord (const std::string& id, UniversalId::Type type); ///< \param type Will be ignored, unless the collection supports multiple record types diff --git a/apps/opencs/view/world/cellcreator.cpp b/apps/opencs/view/world/cellcreator.cpp index ebf88122b..e65501e5f 100644 --- a/apps/opencs/view/world/cellcreator.cpp +++ b/apps/opencs/view/world/cellcreator.cpp @@ -82,10 +82,9 @@ void CSVWorld::CellCreator::valueChanged (int index) } void CSVWorld::CellCreator::cloneMode(const std::string& originid, - const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumentType) + const CSMWorld::UniversalId::Type type) { - CSVWorld::GenericCreator::cloneMode(originid, type, argumentType); + CSVWorld::GenericCreator::cloneMode(originid, type); if (*(originid.begin()) == '#') //if originid points to the exterior cell { setType(1); //enable x and y controls diff --git a/apps/opencs/view/world/cellcreator.hpp b/apps/opencs/view/world/cellcreator.hpp index 3130c1328..472be43b9 100644 --- a/apps/opencs/view/world/cellcreator.hpp +++ b/apps/opencs/view/world/cellcreator.hpp @@ -32,8 +32,7 @@ namespace CSVWorld virtual void toggleWidgets(bool active = true); virtual void cloneMode(const std::string& originid, - const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumentType); + const CSMWorld::UniversalId::Type type); private slots: diff --git a/apps/opencs/view/world/creator.hpp b/apps/opencs/view/world/creator.hpp index 5174232bc..9be619915 100644 --- a/apps/opencs/view/world/creator.hpp +++ b/apps/opencs/view/world/creator.hpp @@ -25,7 +25,8 @@ namespace CSVWorld virtual void reset() = 0; - virtual void cloneMode(const std::string& originid, const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::ArgumentType argumentType) = 0; + virtual void cloneMode(const std::string& originid, + const CSMWorld::UniversalId::Type type) = 0; virtual void setEditLock (bool locked) = 0; diff --git a/apps/opencs/view/world/genericcreator.cpp b/apps/opencs/view/world/genericcreator.cpp index 2a93f0e0f..1f74b9954 100644 --- a/apps/opencs/view/world/genericcreator.cpp +++ b/apps/opencs/view/world/genericcreator.cpp @@ -127,7 +127,7 @@ void CSVWorld::GenericCreator::create() { std::string id = getId(); std::auto_ptr command (new CSMWorld::CloneCommand ( - dynamic_cast (*mData.getTableModel(mListId)), mClonedId, id, mClonedType, mArgumentType)); + dynamic_cast (*mData.getTableModel(mListId)), mClonedId, id, mClonedType)); mUndoStack.push(command.release()); @@ -150,13 +150,11 @@ void CSVWorld::GenericCreator::create() } void CSVWorld::GenericCreator::cloneMode(const std::string& originid, - const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumentType) + const CSMWorld::UniversalId::Type type) { mCloneMode = true; mClonedId = originid; mClonedType = type; - mArgumentType = argumentType; } void CSVWorld::GenericCreator::toggleWidgets(bool active) diff --git a/apps/opencs/view/world/genericcreator.hpp b/apps/opencs/view/world/genericcreator.hpp index 4870ba46c..06b110b11 100644 --- a/apps/opencs/view/world/genericcreator.hpp +++ b/apps/opencs/view/world/genericcreator.hpp @@ -67,8 +67,7 @@ namespace CSVWorld virtual void toggleWidgets (bool active = true); virtual void cloneMode(const std::string& originid, - const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumentType); + const CSMWorld::UniversalId::Type type); virtual std::string getErrors() const; ///< Return formatted error descriptions for the current state of the creator. if an empty diff --git a/apps/opencs/view/world/referencecreator.cpp b/apps/opencs/view/world/referencecreator.cpp index 6991ecf36..069300f42 100644 --- a/apps/opencs/view/world/referencecreator.cpp +++ b/apps/opencs/view/world/referencecreator.cpp @@ -85,8 +85,9 @@ void CSVWorld::ReferenceCreator::toggleWidgets(bool active) mCell->setEnabled(active); } -void CSVWorld::ReferenceCreator::cloneMode(const std::string& originid, const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::ArgumentType argumentType) +void CSVWorld::ReferenceCreator::cloneMode(const std::string& originid, + const CSMWorld::UniversalId::Type type) { - CSVWorld::GenericCreator::cloneMode(originid, type, argumentType); + CSVWorld::GenericCreator::cloneMode(originid, type); cellChanged(); //otherwise ok button will remain disabled } diff --git a/apps/opencs/view/world/referencecreator.hpp b/apps/opencs/view/world/referencecreator.hpp index 2f0897026..96c1bec27 100644 --- a/apps/opencs/view/world/referencecreator.hpp +++ b/apps/opencs/view/world/referencecreator.hpp @@ -26,8 +26,7 @@ namespace CSVWorld const CSMWorld::UniversalId& id); virtual void cloneMode(const std::string& originid, - const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumentType); + const CSMWorld::UniversalId::Type type); virtual void reset(); virtual void toggleWidgets(bool active = true); diff --git a/apps/opencs/view/world/tablebottombox.cpp b/apps/opencs/view/world/tablebottombox.cpp index a6801b6fc..239c7410f 100644 --- a/apps/opencs/view/world/tablebottombox.cpp +++ b/apps/opencs/view/world/tablebottombox.cpp @@ -160,11 +160,10 @@ void CSVWorld::TableBottomBox::createRequest() } void CSVWorld::TableBottomBox::cloneRequest(const std::string& id, - const CSMWorld::UniversalId::Type type, - const CSMWorld::UniversalId::ArgumentType argumnetType) + const CSMWorld::UniversalId::Type type) { mCreator->reset(); - mCreator->cloneMode(id, type, argumnetType); + mCreator->cloneMode(id, type); mLayout->setCurrentWidget(mCreator); mCreator->toggleWidgets(false); setVisible (true); diff --git a/apps/opencs/view/world/tablebottombox.hpp b/apps/opencs/view/world/tablebottombox.hpp index 29afa2277..8f0d85163 100644 --- a/apps/opencs/view/world/tablebottombox.hpp +++ b/apps/opencs/view/world/tablebottombox.hpp @@ -77,7 +77,8 @@ namespace CSVWorld /// \param modified Number of added and modified records void createRequest(); - void cloneRequest(const std::string& id, const CSMWorld::UniversalId::Type type, const CSMWorld::UniversalId::ArgumentType argumentType); + void cloneRequest(const std::string& id, + const CSMWorld::UniversalId::Type type); }; } diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index 3c71d1370..e4dbb64ed 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -49,9 +49,11 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D { connect (mTable, SIGNAL (createRequest()), mBottom, SLOT (createRequest())); - connect (mTable, SIGNAL (cloneRequest(const CSMWorld::UniversalId&)), this, SLOT(cloneRequest(const CSMWorld::UniversalId&))); - connect (this, SIGNAL(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type, const CSMWorld::UniversalId::ArgumentType)), - mBottom, SLOT(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type, const CSMWorld::UniversalId::ArgumentType))); + connect (mTable, SIGNAL (cloneRequest(const CSMWorld::UniversalId&)), this, + SLOT(cloneRequest(const CSMWorld::UniversalId&))); + + connect (this, SIGNAL(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type)), + mBottom, SLOT(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type))); } connect (mBottom, SIGNAL (requestFocus (const std::string&)), mTable, SLOT (requestFocus (const std::string&))); @@ -84,5 +86,5 @@ void CSVWorld::TableSubView::setStatusBar (bool show) void CSVWorld::TableSubView::cloneRequest(const CSMWorld::UniversalId& toClone) { - emit cloneRequest(toClone.getId(), toClone.getType(), toClone.getArgumentType()); + emit cloneRequest(toClone.getId(), toClone.getType()); } diff --git a/apps/opencs/view/world/tablesubview.hpp b/apps/opencs/view/world/tablesubview.hpp index b3a0a5162..9d2d005a8 100644 --- a/apps/opencs/view/world/tablesubview.hpp +++ b/apps/opencs/view/world/tablesubview.hpp @@ -41,8 +41,7 @@ namespace CSVWorld signals: void cloneRequest(const std::string&, - const CSMWorld::UniversalId::Type, - const CSMWorld::UniversalId::ArgumentType); + const CSMWorld::UniversalId::Type); private slots: