Skip to content
Permalink
Browse files

fix promptForRasterSublayers=Load all

  • Loading branch information
etiennesky committed Nov 13, 2012
1 parent 051d396 commit a6033f06a7e2268965e8cde553b1376b6db5e59c
Showing with 6 additions and 5 deletions.
  1. +5 −4 src/app/qgisapp.cpp
  2. +1 −1 src/app/qgsoptions.cpp
@@ -2699,11 +2699,12 @@ bool QgisApp::shouldAskUserForGDALSublayers( QgsRasterLayer *layer )

QSettings settings;
int promptLayers = settings.value( "/qgis/promptForRasterSublayers", 1 ).toInt();
// 0 = always -> always ask (if there are existing sublayers)
// 1 = if needed -> ask if layer has no bands, but has sublayers
// 2 = never
// 0 = Always -> always ask (if there are existing sublayers)
// 1 = If needed -> ask if layer has no bands, but has sublayers
// 2 = Never -> never prompt, will not load anything
// 3 = Load all -> never prompt, but load all sublayers

return promptLayers == 0 || ( promptLayers == 1 && layer->bandCount() == 0 );
return promptLayers == 0 || promptLayers == 3 || ( promptLayers == 1 && layer->bandCount() == 0 );
}

// This method will load with GDAL the layers in parameter.
@@ -216,7 +216,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
// 0 = Always -> always ask (if there are existing sublayers)
// 1 = If needed -> ask if layer has no bands, but has sublayers
// 2 = Never -> never prompt, will not load anything
// 4 = Load all -> never prompt, but load all sublayers
// 3 = Load all -> never prompt, but load all sublayers
cmbPromptRasterSublayers->clear();
cmbPromptRasterSublayers->addItem( tr( "Always" ) );
cmbPromptRasterSublayers->addItem( tr( "If needed" ) ); //this means, prompt if there are sublayers but no band in the main dataset

0 comments on commit a6033f0

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