mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
implemented check for deletion. But it seems flawed.
This commit is contained in:
parent
38636fab9a
commit
5a52715701
4 changed files with 30 additions and 3 deletions
|
@ -657,6 +657,27 @@ 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;
|
||||
|
|
|
@ -190,6 +190,8 @@ namespace CSMWorld
|
|||
|
||||
std::string getAuthor() const;
|
||||
|
||||
bool recordDeleted(const std::string& id) const;
|
||||
|
||||
signals:
|
||||
|
||||
void idListChanged();
|
||||
|
|
|
@ -125,10 +125,13 @@ void CSVWorld::GenericCreator::create()
|
|||
{
|
||||
if (mCloneMode)
|
||||
{
|
||||
std::string id = getId();
|
||||
const std::string id = getId();
|
||||
if (mData.recordDeleted(id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::auto_ptr<CSMWorld::CloneCommand> command (new CSMWorld::CloneCommand (
|
||||
dynamic_cast<CSMWorld::IdTable&> (*mData.getTableModel(mListId)), mClonedId, id, mClonedType, mArgumentType));
|
||||
|
||||
mUndoStack.push(command.release());
|
||||
|
||||
emit done();
|
||||
|
|
|
@ -308,9 +308,10 @@ void CSVWorld::Table::cloneRecord()
|
|||
if (!mEditLock)
|
||||
{
|
||||
QModelIndexList selectedRows = selectionModel()->selectedRows();
|
||||
|
||||
if (selectedRows.size()==1)
|
||||
{
|
||||
emit cloneRequest (selectedRows.begin()->row());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue