mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-19 00:07:15 -04:00
Fix encoding choice is ignored in Add Vector Layer dialog
This commit is contained in:
parent
3c91c624c8
commit
b650fbd92b
@ -394,12 +394,6 @@ QList< QgsMapLayer * > QgsAppLayerHandling::addOgrVectorLayers( const QStringLis
|
|||||||
QgsProject::instance()->addMapLayers( layersToAdd );
|
QgsProject::instance()->addMapLayers( layersToAdd );
|
||||||
for ( QgsMapLayer *l : std::as_const( layersToAdd ) )
|
for ( QgsMapLayer *l : std::as_const( layersToAdd ) )
|
||||||
{
|
{
|
||||||
if ( !encoding.isEmpty() )
|
|
||||||
{
|
|
||||||
if ( QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( l ) )
|
|
||||||
vl->setProviderEncoding( encoding );
|
|
||||||
}
|
|
||||||
|
|
||||||
QgisApp::instance()->askUserForDatumTransform( l->crs(), QgsProject::instance()->crs(), l );
|
QgisApp::instance()->askUserForDatumTransform( l->crs(), QgsProject::instance()->crs(), l );
|
||||||
QgsAppLayerHandling::postProcessAddedLayer( l );
|
QgsAppLayerHandling::postProcessAddedLayer( l );
|
||||||
}
|
}
|
||||||
@ -407,6 +401,16 @@ QList< QgsMapLayer * > QgsAppLayerHandling::addOgrVectorLayers( const QStringLis
|
|||||||
|
|
||||||
ok = true;
|
ok = true;
|
||||||
addedLayers.append( layersToAdd );
|
addedLayers.append( layersToAdd );
|
||||||
|
|
||||||
|
for ( QgsMapLayer *l : std::as_const( addedLayers ) )
|
||||||
|
{
|
||||||
|
if ( !encoding.isEmpty() )
|
||||||
|
{
|
||||||
|
if ( QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( l ) )
|
||||||
|
vl->setProviderEncoding( encoding );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return addedLayers;
|
return addedLayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user