Skip to content

Commit

Permalink
fix promptForRasterSublayers=Load all
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennesky committed Nov 13, 2012
1 parent 051d396 commit a6033f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsoptions.cpp
Expand Up @@ -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
Expand Down

0 comments on commit a6033f0

Please sign in to comment.