Merge pull request #1380 from softrabbit/journalling-killswitch

Master kill switch for journalling, useful when closing program.
This commit is contained in:
Vesa V
2014-12-06 11:41:16 +02:00
4 changed files with 25 additions and 7 deletions

View File

@@ -74,7 +74,7 @@ public:
}
void clearJournal();
void stopAllJournalling();
JournallingObject * journallingObject( const jo_id_t _id )
{
if( m_joIDs.contains( _id ) )

View File

@@ -70,14 +70,19 @@ void JournallingObject::addJournalCheckPoint()
QDomElement JournallingObject::saveState( QDomDocument & _doc,
QDomElement & _parent )
{
QDomElement _this = SerializingObject::saveState( _doc, _parent );
if( isJournalling() )
{
QDomElement _this = SerializingObject::saveState( _doc, _parent );
QDomElement journalNode = _doc.createElement( "journallingObject" );
journalNode.setAttribute( "id", id() );
journalNode.setAttribute( "metadata", true );
_this.appendChild( journalNode );
QDomElement journalNode = _doc.createElement( "journallingObject" );
journalNode.setAttribute( "id", id() );
journalNode.setAttribute( "metadata", true );
_this.appendChild( journalNode );
return _this;
return _this;
} else {
return QDomElement();
}
}

View File

@@ -168,5 +168,17 @@ void ProjectJournal::clearJournal()
}
}
void ProjectJournal::stopAllJournalling()
{
for( JoIdMap::Iterator it = m_joIDs.begin(); it != m_joIDs.end(); ++it)
{
if( it.value() != NULL )
{
it.value()->setJournalling(false);
}
}
setJournalling(false);
}

View File

@@ -115,6 +115,7 @@ void engine::init( const bool _has_gui )
void engine::destroy()
{
s_projectJournal->stopAllJournalling();
s_mixer->stopProcessing();
deleteHelper( &s_projectNotes );