Skip to content

Commit a6033f0

Browse files
committed
fix promptForRasterSublayers=Load all
1 parent 051d396 commit a6033f0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/app/qgisapp.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -2699,11 +2699,12 @@ bool QgisApp::shouldAskUserForGDALSublayers( QgsRasterLayer *layer )
26992699

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

2706-
return promptLayers == 0 || ( promptLayers == 1 && layer->bandCount() == 0 );
2707+
return promptLayers == 0 || promptLayers == 3 || ( promptLayers == 1 && layer->bandCount() == 0 );
27072708
}
27082709

27092710
// This method will load with GDAL the layers in parameter.

src/app/qgsoptions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
216216
// 0 = Always -> always ask (if there are existing sublayers)
217217
// 1 = If needed -> ask if layer has no bands, but has sublayers
218218
// 2 = Never -> never prompt, will not load anything
219-
// 4 = Load all -> never prompt, but load all sublayers
219+
// 3 = Load all -> never prompt, but load all sublayers
220220
cmbPromptRasterSublayers->clear();
221221
cmbPromptRasterSublayers->addItem( tr( "Always" ) );
222222
cmbPromptRasterSublayers->addItem( tr( "If needed" ) ); //this means, prompt if there are sublayers but no band in the main dataset

0 commit comments

Comments
 (0)