@@ -2081,6 +2081,8 @@ bool QgisApp::addVectorLayers(QStringList const & theLayerQStringList, const QSt
2081
2081
2082
2082
// Register this layer with the layers registry
2083
2083
QgsMapLayerRegistry::instance ()->addMapLayer (layer);
2084
+ // notify the project we've made a change
2085
+ QgsProject::instance ()->dirty (true );
2084
2086
2085
2087
}
2086
2088
else
@@ -2174,6 +2176,8 @@ void QgisApp::addDatabaseLayer()
2174
2176
{
2175
2177
// register this layer with the central layers registry
2176
2178
QgsMapLayerRegistry::instance ()->addMapLayer (layer);
2179
+ // notify the project we've made a change
2180
+ QgsProject::instance ()->dirty (true );
2177
2181
}
2178
2182
else
2179
2183
{
@@ -4448,6 +4452,8 @@ QgsVectorLayer* QgisApp::addVectorLayer(QString vectorLayerPath, QString baseNam
4448
4452
{
4449
4453
// Register this layer with the layers registry
4450
4454
QgsMapLayerRegistry::instance ()->addMapLayer (layer);
4455
+ // notify the project we've made a change
4456
+ QgsProject::instance ()->dirty (true );
4451
4457
4452
4458
statusBar ()->showMessage (mMapCanvas ->extent ().stringRep (2 ));
4453
4459
@@ -4493,6 +4499,8 @@ void QgisApp::addMapLayer(QgsMapLayer *theMapLayer)
4493
4499
// not necessary since adding to registry adds to canvas mMapCanvas->addLayer(theMapLayer);
4494
4500
4495
4501
statusBar ()->showMessage (mMapCanvas ->extent ().stringRep (2 ));
4502
+ // notify the project we've made a change
4503
+ QgsProject::instance ()->dirty (true );
4496
4504
4497
4505
}
4498
4506
else
@@ -5167,6 +5175,8 @@ bool QgisApp::addRasterLayer(QgsRasterLayer * theRasterLayer)
5167
5175
SIGNAL (setStatus (QString)),
5168
5176
this ,
5169
5177
SLOT (showStatusMessage (QString)));
5178
+ // notify the project we've made a change
5179
+ QgsProject::instance ()->dirty (true );
5170
5180
5171
5181
return true ;
5172
5182
}
0 commit comments