Skip to content

Commit da0e4f3

Browse files
committedJun 18, 2013
Mark project dirty in case of composer changes
1 parent f48aff8 commit da0e4f3

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed
 

‎src/core/composer/qgsaddremoveitemcommand.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgsaddremoveitemcommand.h"
1919
#include "qgscomposeritem.h"
2020
#include "qgscomposition.h"
21+
#include "qgsproject.h"
2122

2223
QgsAddRemoveItemCommand::QgsAddRemoveItemCommand( State s, QgsComposerItem* item, QgsComposition* c, const QString& text, QUndoCommand* parent ):
2324
QUndoCommand( text, parent ), mItem( item ), mComposition( c ), mState( s ), mFirstRun( true )
@@ -72,4 +73,5 @@ void QgsAddRemoveItemCommand::switchState()
7273
emit itemAdded( mItem );
7374
mState = Added;
7475
}
76+
QgsProject::instance()->dirty( true );
7577
}

‎src/core/composer/qgsaddremovemultiframecommand.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgsaddremovemultiframecommand.h"
1919
#include "qgscomposermultiframe.h"
2020
#include "qgscomposition.h"
21+
#include "qgsproject.h"
2122

2223

2324
QgsAddRemoveMultiFrameCommand::QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame* multiFrame, QgsComposition* c, const QString& text, QUndoCommand* parent ):
@@ -69,6 +70,7 @@ void QgsAddRemoveMultiFrameCommand::switchState()
6970
mComposition->addMultiFrame( mMultiFrame );
7071
mState = Added;
7172
}
73+
QgsProject::instance()->dirty( true );
7274
}
7375
}
7476

‎src/core/composer/qgscomposeritemcommand.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "qgscomposeritemcommand.h"
1919
#include "qgscomposeritem.h"
20+
#include "qgsproject.h"
2021

2122
QgsComposerItemCommand::QgsComposerItemCommand( QgsComposerItem* item, const QString& text, QUndoCommand* parent ):
2223
QUndoCommand( text, parent ), mItem( item ), mFirstRun( true )
@@ -74,6 +75,7 @@ void QgsComposerItemCommand::restoreState( QDomDocument& stateDoc ) const
7475
{
7576
mItem->readXML( stateDoc.documentElement().firstChild().toElement(), stateDoc );
7677
mItem->repaint();
78+
QgsProject::instance()->dirty( true );
7779
}
7880
}
7981

‎src/core/composer/qgscomposermultiframecommand.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "qgscomposermultiframecommand.h"
1919
#include "qgscomposermultiframe.h"
20+
#include "qgsproject.h"
2021

2122
QgsComposerMultiFrameCommand::QgsComposerMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, QUndoCommand* parent ):
2223
QUndoCommand( text, parent ), mMultiFrame( multiFrame ), mFirstRun( true )
@@ -71,6 +72,7 @@ void QgsComposerMultiFrameCommand::restoreState( QDomDocument& stateDoc )
7172
if ( mMultiFrame )
7273
{
7374
mMultiFrame->readXML( stateDoc.documentElement().firstChild().toElement(), stateDoc );
75+
QgsProject::instance()->dirty( true );
7476
}
7577
}
7678

‎src/core/composer/qgscomposition.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "qgslogger.h"
3535
#include "qgspaintenginehack.h"
3636
#include "qgspaperitem.h"
37+
#include "qgsproject.h"
3738
#include "qgsgeometry.h"
3839
#include "qgsvectorlayer.h"
3940
#include "qgsvectordataprovider.h"
@@ -1572,6 +1573,7 @@ void QgsComposition::endCommand()
15721573
if ( mActiveItemCommand->containsChange() ) //protect against empty commands
15731574
{
15741575
mUndoStack.push( mActiveItemCommand );
1576+
QgsProject::instance()->dirty( true );
15751577
}
15761578
else
15771579
{
@@ -1602,6 +1604,7 @@ void QgsComposition::endMultiFrameCommand()
16021604
if ( mActiveMultiFrameCommand->containsChange() )
16031605
{
16041606
mUndoStack.push( mActiveMultiFrameCommand );
1607+
QgsProject::instance()->dirty( true );
16051608
}
16061609
else
16071610
{
@@ -1796,6 +1799,7 @@ void QgsComposition::pushAddRemoveCommand( QgsComposerItem* item, const QString&
17961799
QgsAddRemoveItemCommand* c = new QgsAddRemoveItemCommand( state, item, this, text );
17971800
connectAddRemoveCommandSignals( c );
17981801
undoStack()->push( c );
1802+
QgsProject::instance()->dirty( true );
17991803
}
18001804

18011805
void QgsComposition::connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c )

0 commit comments

Comments
 (0)
Please sign in to comment.