1
0
Fork 1
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:
Marek Kochanowicz 2014-01-20 15:58:19 +01:00
parent 38636fab9a
commit 5a52715701
4 changed files with 30 additions and 3 deletions

View file

@ -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;

View file

@ -190,6 +190,8 @@ namespace CSMWorld
std::string getAuthor() const;
bool recordDeleted(const std::string& id) const;
signals:
void idListChanged();

View file

@ -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();

View file

@ -308,11 +308,12 @@ void CSVWorld::Table::cloneRecord()
if (!mEditLock)
{
QModelIndexList selectedRows = selectionModel()->selectedRows();
if (selectedRows.size()==1)
{
emit cloneRequest (selectedRows.begin()->row());
}
}
}
void CSVWorld::Table::moveUpRecord()
{