mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-15 18:39:51 +00:00
implemented check for deletion. But it seems flawed.
This commit is contained in:
parent
38636fab9a
commit
5a52715701
@ -657,6 +657,27 @@ int CSMWorld::Data::count (RecordBase::State state) const
|
|||||||
count (state, mReferenceables);
|
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)
|
void CSMWorld::Data::setDescription (const std::string& description)
|
||||||
{
|
{
|
||||||
mDescription = description;
|
mDescription = description;
|
||||||
|
@ -189,6 +189,8 @@ namespace CSMWorld
|
|||||||
void setAuthor (const std::string& author);
|
void setAuthor (const std::string& author);
|
||||||
|
|
||||||
std::string getAuthor() const;
|
std::string getAuthor() const;
|
||||||
|
|
||||||
|
bool recordDeleted(const std::string& id) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -125,10 +125,13 @@ void CSVWorld::GenericCreator::create()
|
|||||||
{
|
{
|
||||||
if (mCloneMode)
|
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 (
|
std::auto_ptr<CSMWorld::CloneCommand> command (new CSMWorld::CloneCommand (
|
||||||
dynamic_cast<CSMWorld::IdTable&> (*mData.getTableModel(mListId)), mClonedId, id, mClonedType, mArgumentType));
|
dynamic_cast<CSMWorld::IdTable&> (*mData.getTableModel(mListId)), mClonedId, id, mClonedType, mArgumentType));
|
||||||
|
|
||||||
mUndoStack.push(command.release());
|
mUndoStack.push(command.release());
|
||||||
|
|
||||||
emit done();
|
emit done();
|
||||||
|
@ -308,9 +308,10 @@ void CSVWorld::Table::cloneRecord()
|
|||||||
if (!mEditLock)
|
if (!mEditLock)
|
||||||
{
|
{
|
||||||
QModelIndexList selectedRows = selectionModel()->selectedRows();
|
QModelIndexList selectedRows = selectionModel()->selectedRows();
|
||||||
|
|
||||||
if (selectedRows.size()==1)
|
if (selectedRows.size()==1)
|
||||||
|
{
|
||||||
emit cloneRequest (selectedRows.begin()->row());
|
emit cloneRequest (selectedRows.begin()->row());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user