From 92ee252eef54b0e9072a39803087e81ccd7bff62 Mon Sep 17 00:00:00 2001 From: Marek Kochanowicz Date: Mon, 20 Jan 2014 16:23:34 +0100 Subject: [PATCH] Small correction. --- apps/opencs/model/world/data.cpp | 21 --------------------- apps/opencs/model/world/data.hpp | 2 -- apps/opencs/view/world/genericcreator.cpp | 7 ++----- apps/opencs/view/world/table.cpp | 1 + apps/opencs/view/world/table.hpp | 2 +- apps/opencs/view/world/tablesubview.cpp | 2 +- 6 files changed, 5 insertions(+), 30 deletions(-) diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 8a7dc3971..04e35cdaa 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -657,27 +657,6 @@ int CSMWorld::Data::count (RecordBase::State state) const count (state, mReferenceables); } -bool CSMWorld::Data::recordDeleted(const std::string& id) const -{ - return - getGlobals().getRecord(id).isDeleted() || - getGmsts().getRecord(id).isDeleted() || - getSkills().getRecord(id).isDeleted() || - getClasses().getRecord(id).isDeleted() || - getFactions().getRecord(id).isDeleted() || - getRaces().getRecord(id).isDeleted() || - getSounds().getRecord(id).isDeleted() || - getScripts().getRecord(id).isDeleted() || - getRegions().getRecord(id).isDeleted() || - getBirthsigns().getRecord(id).isDeleted() || - getSpells().getRecord(id).isDeleted() || - getTopics().getRecord(id).isDeleted() || - getJournals().getRecord(id).isDeleted() || - getCells().getRecord(id).isDeleted() || - getReferenceables().getRecord(id).isDeleted(); -} - - void CSMWorld::Data::setDescription (const std::string& description) { mDescription = description; diff --git a/apps/opencs/model/world/data.hpp b/apps/opencs/model/world/data.hpp index df51c936a..152c3ac41 100644 --- a/apps/opencs/model/world/data.hpp +++ b/apps/opencs/model/world/data.hpp @@ -189,8 +189,6 @@ namespace CSMWorld void setAuthor (const std::string& author); std::string getAuthor() const; - - bool recordDeleted(const std::string& id) const; signals: diff --git a/apps/opencs/view/world/genericcreator.cpp b/apps/opencs/view/world/genericcreator.cpp index 16bd04ece..efdd9ecaf 100644 --- a/apps/opencs/view/world/genericcreator.cpp +++ b/apps/opencs/view/world/genericcreator.cpp @@ -125,13 +125,10 @@ void CSVWorld::GenericCreator::create() { if (mCloneMode) { - const std::string id = getId(); - if (mData.recordDeleted(id)) - { - return; - } + std::string id = getId(); std::auto_ptr command (new CSMWorld::CloneCommand ( dynamic_cast (*mData.getTableModel(mListId)), mClonedId, id, mClonedType, mArgumentType)); + mUndoStack.push(command.release()); emit done(); diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 02a93161c..cc1f814dd 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -308,6 +308,7 @@ void CSVWorld::Table::cloneRecord() if (!mEditLock) { QModelIndexList selectedRows = selectionModel()->selectedRows(); + if (selectedRows.size()==1) { emit cloneRequest (selectedRows.begin()->row(), mModel); diff --git a/apps/opencs/view/world/table.hpp b/apps/opencs/view/world/table.hpp index 118bd3cf2..af2d7877f 100644 --- a/apps/opencs/view/world/table.hpp +++ b/apps/opencs/view/world/table.hpp @@ -74,7 +74,7 @@ namespace CSVWorld /// \param modified Number of added and modified records void createRequest(); - void cloneRequest(int row, const CSMWorld::IdTable* table); + void cloneRequest(int row, const CSMWorld::IdTable*); private slots: diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index 0cdc57f5f..765055610 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -49,7 +49,7 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D { connect (mTable, SIGNAL (createRequest()), mBottom, SLOT (createRequest())); - connect (mTable, SIGNAL (cloneRequest(int, CSMWorld::IdTable*)), this, SLOT(cloneRequest(int, CSMWorld::IdTable*))); + connect (mTable, SIGNAL (cloneRequest(int, const CSMWorld::IdTable*)), this, SLOT(cloneRequest(int, const CSMWorld::IdTable*))); 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))); }