"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/app/qgisapp.cpp" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

qgisapp.cpp  (QGIS-final-3_14_15):qgisapp.cpp  (QGIS-final-3_14_16)
skipping to change at line 5995 skipping to change at line 5995
// Check if the current layer uri contains the // Check if the current layer uri contains the
// We initialize a selection dialog and display it. // We initialize a selection dialog and display it.
QgsSublayersDialog chooseSublayersDialog( QgsSublayersDialog::Ogr, QStringLite ral( "ogr" ), this, nullptr, layer->dataProvider()->dataSourceUri() ); QgsSublayersDialog chooseSublayersDialog( QgsSublayersDialog::Ogr, QStringLite ral( "ogr" ), this, nullptr, layer->dataProvider()->dataSourceUri() );
chooseSublayersDialog.setShowAddToGroupCheckbox( true ); chooseSublayersDialog.setShowAddToGroupCheckbox( true );
chooseSublayersDialog.populateLayerTable( list ); chooseSublayersDialog.populateLayerTable( list );
if ( !chooseSublayersDialog.exec() ) if ( !chooseSublayersDialog.exec() )
return result; return result;
const bool addToGroup = chooseSublayersDialog.addToGroupCheckbox();
QString name = layer->name(); QString name = layer->name();
auto uriParts = QgsProviderRegistry::instance()->decodeUri( auto uriParts = QgsProviderRegistry::instance()->decodeUri(
layer->providerType(), layer->dataProvider()->dataSourceUri( ) ); layer->providerType(), layer->dataProvider()->dataSourceUri( ) );
QString uri( uriParts.value( QStringLiteral( "path" ) ).toString() ); QString uri( uriParts.value( QStringLiteral( "path" ) ).toString() );
// The uri must contain the actual uri of the vectorLayer from which we are // The uri must contain the actual uri of the vectorLayer from which we are
// going to load the sublayers. // going to load the sublayers.
QString fileName = QFileInfo( uri ).baseName(); QString fileName = QFileInfo( uri ).baseName();
const auto constSelection = chooseSublayersDialog.selection(); const auto constSelection = chooseSublayersDialog.selection();
skipping to change at line 6024 skipping to change at line 6026
{ {
// Only use layerId if there are ambiguities with names // Only use layerId if there are ambiguities with names
composedURI += "|layerid=" + QString::number( def.layerId ); composedURI += "|layerid=" + QString::number( def.layerId );
} }
if ( !layerGeometryType.isEmpty() ) if ( !layerGeometryType.isEmpty() )
{ {
composedURI += "|geometrytype=" + layerGeometryType; composedURI += "|geometrytype=" + layerGeometryType;
} }
QgsDebugMsg( "Creating new vector layer using " + composedURI ); QgsDebugMsgLevel( "Creating new vector layer using " + composedURI, 2 );
// if user has opted to add sublayers to a group, then we don't need to incl
ude the
// filename in the layer's name, because the group is already titled with th
e filename.
// But otherwise, we DO include the file name so that users can differentiat
e the source
// when multiple layers are loaded from a GPX file or similar (refs https://
github.com/qgis/QGIS/issues/37551)
const QString name = addToGroup ? def.layerName : fileName + " " + def.layer
Name;
QgsVectorLayer::LayerOptions options { QgsProject::instance()->transformCont ext() }; QgsVectorLayer::LayerOptions options { QgsProject::instance()->transformCont ext() };
options.loadDefaultStyle = false; options.loadDefaultStyle = false;
QgsVectorLayer *layer = new QgsVectorLayer( composedURI, def.layerName, QStr ingLiteral( "ogr" ), options ); QgsVectorLayer *layer = new QgsVectorLayer( composedURI, name, QStringLitera l( "ogr" ), options );
if ( layer && layer->isValid() ) if ( layer && layer->isValid() )
{ {
result << layer; result << layer;
} }
else else
{ {
QString msg = tr( "%1 is not a valid or recognized data source" ).arg( com posedURI ); QString msg = tr( "%1 is not a valid or recognized data source" ).arg( com posedURI );
visibleMessageBar()->pushMessage( tr( "Invalid Data Source" ), msg, Qgis:: Critical, messageTimeout() ); visibleMessageBar()->pushMessage( tr( "Invalid Data Source" ), msg, Qgis:: Critical, messageTimeout() );
delete layer; delete layer;
} }
} }
if ( !result.isEmpty() ) if ( !result.isEmpty() )
{ {
QgsSettings settings; QgsSettings settings;
bool addToGroup = settings.value( QStringLiteral( "/qgis/openSublayersInGrou p" ), true ).toBool();
bool newLayersVisible = settings.value( QStringLiteral( "/qgis/new_layers_vi sible" ), true ).toBool(); bool newLayersVisible = settings.value( QStringLiteral( "/qgis/new_layers_vi sible" ), true ).toBool();
QgsLayerTreeGroup *group = nullptr; QgsLayerTreeGroup *group = nullptr;
if ( addToGroup ) if ( addToGroup )
group = QgsProject::instance()->layerTreeRoot()->insertGroup( 0, name ); group = QgsProject::instance()->layerTreeRoot()->insertGroup( 0, name );
QgsProject::instance()->addMapLayers( result, ! addToGroup ); QgsProject::instance()->addMapLayers( result, ! addToGroup );
for ( QgsMapLayer *l : qgis::as_const( result ) ) for ( QgsMapLayer *l : qgis::as_const( result ) )
{ {
bool ok; bool ok;
l->loadDefaultStyle( ok ); l->loadDefaultStyle( ok );
skipping to change at line 12073 skipping to change at line 12081
const QList< Qgs3DMapCanvasDockWidget * > canvases3D = findChildren< Qgs3DMa pCanvasDockWidget * >(); const QList< Qgs3DMapCanvasDockWidget * > canvases3D = findChildren< Qgs3DMa pCanvasDockWidget * >();
for ( Qgs3DMapCanvasDockWidget *canvas3D : canvases3D ) for ( Qgs3DMapCanvasDockWidget *canvas3D : canvases3D )
{ {
canvas3D->measurementLineTool()->updateSettings(); canvas3D->measurementLineTool()->updateSettings();
} }
#endif #endif
double factor = mySettings.value( QStringLiteral( "qgis/magnifier_factor_def ault" ), 1.0 ).toDouble(); double factor = mySettings.value( QStringLiteral( "qgis/magnifier_factor_def ault" ), 1.0 ).toDouble();
mMagnifierWidget->setDefaultFactor( factor ); mMagnifierWidget->setDefaultFactor( factor );
mMagnifierWidget->updateMagnification( factor ); mMagnifierWidget->updateMagnification( factor );
mWelcomePage->updateNewsFeedVisibility();
} }
} }
void QgisApp::fullHistogramStretch() void QgisApp::fullHistogramStretch()
{ {
histogramStretch( false, QgsRasterMinMaxOrigin::MinMax ); histogramStretch( false, QgsRasterMinMaxOrigin::MinMax );
} }
void QgisApp::localHistogramStretch() void QgisApp::localHistogramStretch()
{ {
 End of changes. 5 change blocks. 
3 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)