Skip to content

Commit

Permalink
Added option to set initial layer visibility to false for raster and …
Browse files Browse the repository at this point in the history
…postgres providers

git-svn-id: http://svn.osgeo.org/qgis/trunk@2247 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Nov 13, 2004
1 parent 0e31e62 commit 99336b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/qgisapp.cpp
Expand Up @@ -1169,6 +1169,9 @@ void QgisApp::addDatabaseLayer()
QgsVectorLayer *layer = new QgsVectorLayer(connInfo + " table=" + *it, *it, "postgres");
if (layer->isValid())
{
// set initial visibility based on user preference
layer->setVisible(mAddedLayersHidden);

// register this layer with the central layers registry
QgsMapLayerRegistry::instance()->addMapLayer(layer);

Expand Down Expand Up @@ -3595,6 +3598,9 @@ bool QgisApp::addRasterLayer(QStringList const &theFileNameQStringList, bool gui

// create the layer
QgsRasterLayer *layer = new QgsRasterLayer(*myIterator, myBaseNameQString);

// set initial visibility based on user preference
layer->setVisible(mAddedLayersHidden);

addRasterLayer(layer);

Expand Down

0 comments on commit 99336b4

Please sign in to comment.