2012-11-21 17:31:18 +01:00
|
|
|
|
|
|
|
#include "document.hpp"
|
|
|
|
|
2012-11-22 23:42:17 +01:00
|
|
|
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;
|
2012-11-22 23:42:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|