mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-13 20:06:46 +00:00
prevent deleting already deleted record
This commit is contained in:
parent
ea9b6fa37e
commit
ad2f9a69a1
1 changed files with 7 additions and 1 deletions
|
@ -596,9 +596,15 @@ void CSVWorld::DialogueSubView::revertRecord()
|
||||||
void CSVWorld::DialogueSubView::deleteRecord()
|
void CSVWorld::DialogueSubView::deleteRecord()
|
||||||
{
|
{
|
||||||
int rows = mTable->rowCount();
|
int rows = mTable->rowCount();
|
||||||
|
|
||||||
|
//easier than disabling the button
|
||||||
|
CSMWorld::RecordBase::State state = static_cast<CSMWorld::RecordBase::State>(mTable->data (mTable->index (mRow, 1)).toInt());
|
||||||
|
bool deledetedOrErased = (state == CSMWorld::RecordBase::State_Deleted || state == CSMWorld::RecordBase::State_Erased);
|
||||||
|
|
||||||
if (!mLocked &&
|
if (!mLocked &&
|
||||||
mTable->columnCount() > 0 &&
|
mTable->columnCount() > 0 &&
|
||||||
mRow < mTable->rowCount() &&
|
!deledetedOrErased &&
|
||||||
|
mRow < rows &&
|
||||||
mBottom->canCreateAndDelete())
|
mBottom->canCreateAndDelete())
|
||||||
{
|
{
|
||||||
mUndoStack.push(new CSMWorld::DeleteCommand(*mTable, mTable->data(mTable->index (mRow, 0)).toString().toStdString()));
|
mUndoStack.push(new CSMWorld::DeleteCommand(*mTable, mTable->data(mTable->index (mRow, 0)).toString().toStdString()));
|
||||||
|
|
Loading…
Reference in a new issue