Skip to content
Permalink
Browse files

[layertree] Fix last bit of #10384 (update on capitalization change)

  • Loading branch information
wonder-sk committed Jun 13, 2014
1 parent 559b810 commit 98683342ec764998e6bf8613b394ea0736930357
Showing with 10 additions and 0 deletions.
  1. +9 −0 src/app/qgisapp.cpp
  2. +1 −0 src/gui/layertree/qgslayertreemodel.cpp
@@ -7245,6 +7245,8 @@ void QgisApp::showOptionsDialog( QWidget *parent, QString currentPage )
QSettings mySettings;
QString oldScales = mySettings.value( "Map/scales", PROJECT_SCALES ).toString();

bool oldCapitalise = mySettings.value( "/qgis/capitaliseLayerName", QVariant( false ) ).toBool();

QgsOptions *optionsDialog = new QgsOptions( parent );
if ( !currentPage.isEmpty() )
{
@@ -7272,6 +7274,13 @@ void QgisApp::showOptionsDialog( QWidget *parent, QString currentPage )

mMapCanvas->setMapUpdateInterval( mySettings.value( "/qgis/map_update_interval", 250 ).toInt() );

if ( oldCapitalise != mySettings.value( "/qgis/capitaliseLayerName", QVariant( false ) ).toBool() )
{
// if the layer capitalization has changed, we need to update all layer names
foreach ( QgsMapLayer* layer, QgsMapLayerRegistry::instance()->mapLayers() )
layer->setLayerName( layer->originalName() );
}

//update any open compositions so they reflect new composer settings
//we have to push the changes to the compositions here, because compositions
//have no access to qgisapp and accordingly can't listen in to changes
@@ -745,6 +745,7 @@ void QgsLayerTreeModel::connectToLayer( QgsLayerTreeLayer* nodeLayer )
connect( layer, SIGNAL( editingStarted() ), this, SLOT( layerNeedsUpdate() ), Qt::UniqueConnection );
connect( layer, SIGNAL( editingStopped() ), this, SLOT( layerNeedsUpdate() ), Qt::UniqueConnection );
connect( layer, SIGNAL( layerModified() ), this, SLOT( layerNeedsUpdate() ), Qt::UniqueConnection );
connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNeedsUpdate() ), Qt::UniqueConnection );
}
}

0 comments on commit 9868334

Please sign in to comment.
You can’t perform that action at this time.