@@ -2081,6 +2081,8 @@ bool QgisApp::addVectorLayers(QStringList const & theLayerQStringList, const QSt
20812081
20822082 // Register this layer with the layers registry
20832083 QgsMapLayerRegistry::instance ()->addMapLayer (layer);
2084+ // notify the project we've made a change
2085+ QgsProject::instance ()->dirty (true );
20842086
20852087 }
20862088 else
@@ -2174,6 +2176,8 @@ void QgisApp::addDatabaseLayer()
21742176 {
21752177 // register this layer with the central layers registry
21762178 QgsMapLayerRegistry::instance ()->addMapLayer (layer);
2179+ // notify the project we've made a change
2180+ QgsProject::instance ()->dirty (true );
21772181 }
21782182 else
21792183 {
@@ -4448,6 +4452,8 @@ QgsVectorLayer* QgisApp::addVectorLayer(QString vectorLayerPath, QString baseNam
44484452 {
44494453 // Register this layer with the layers registry
44504454 QgsMapLayerRegistry::instance ()->addMapLayer (layer);
4455+ // notify the project we've made a change
4456+ QgsProject::instance ()->dirty (true );
44514457
44524458 statusBar ()->showMessage (mMapCanvas ->extent ().stringRep (2 ));
44534459
@@ -4493,6 +4499,8 @@ void QgisApp::addMapLayer(QgsMapLayer *theMapLayer)
44934499 // not necessary since adding to registry adds to canvas mMapCanvas->addLayer(theMapLayer);
44944500
44954501 statusBar ()->showMessage (mMapCanvas ->extent ().stringRep (2 ));
4502+ // notify the project we've made a change
4503+ QgsProject::instance ()->dirty (true );
44964504
44974505 }
44984506 else
@@ -5167,6 +5175,8 @@ bool QgisApp::addRasterLayer(QgsRasterLayer * theRasterLayer)
51675175 SIGNAL (setStatus (QString)),
51685176 this ,
51695177 SLOT (showStatusMessage (QString)));
5178+ // notify the project we've made a change
5179+ QgsProject::instance ()->dirty (true );
51705180
51715181 return true ;
51725182}
0 commit comments