openmw/apps/opencs/model/doc/document.cpp

27 lines
489 B
C++
Raw Normal View History

2012-11-21 17:31:18 +01:00
#include "document.hpp"
CSMDoc::Document::Document()
{
connect (&mUndoStack, SIGNAL (cleanChanged (bool)), this, SLOT (modificationStateChanged (bool)));
}
2012-11-22 15:54:31 +01:00
QUndoStack& CSMDoc::Document::getUndoStack()
{
return mUndoStack;
}
int CSMDoc::Document::getState() const
{
int state = 0;
if (!mUndoStack.isClean())
state |= State_Modified;
return state;
}
void CSMDoc::Document::modificationStateChanged (bool clean)
{
emit stateChanged (getState(), this);
2012-11-22 15:54:31 +01:00
}