Skip to content
Permalink
Browse files

Default to automatically picking encoding when adding shapefiles

via drag and drop or browser, instead of always picking the System encoding
  • Loading branch information
nyalldawson committed Feb 10, 2020
1 parent 5b63955 commit a74b259eaa0bf6e87b1c4f63f0649269f9f18f78
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/app/qgisapp.cpp
@@ -5283,7 +5283,8 @@ bool QgisApp::addVectorLayersPrivate( const QStringList &layerQStringList, const
if ( layer->isValid() )
{
userAskedToAddLayers = true;
layer->setProviderEncoding( enc );
if ( !enc.isEmpty() )
layer->setProviderEncoding( enc );

QStringList sublayers = layer->dataProvider()->subLayers();
QgsDebugMsg( QStringLiteral( "got valid layer with %1 sublayers" ).arg( sublayers.count() ) );
@@ -5513,7 +5514,7 @@ bool QgisApp::askUserForZipItemLayers( const QString &path )
}
else if ( layerItem->providerKey() == QLatin1String( "ogr" ) )
{
if ( addVectorLayers( QStringList( item->path() ), QStringLiteral( "System" ), QStringLiteral( "file" ) ) )
if ( addVectorLayers( QStringList( item->path() ), QString(), QStringLiteral( "file" ) ) )
ok = true;
}
}
@@ -7062,7 +7063,7 @@ bool QgisApp::openLayer( const QString &fileName, bool allowInteractive )
{
if ( allowInteractive )
{
ok = ok || addVectorLayersPrivate( QStringList( fileName ), QStringLiteral( "System" ), QStringLiteral( "file" ), false );
ok = ok || addVectorLayersPrivate( QStringList( fileName ), QString(), QStringLiteral( "file" ), false );
}
else
{

0 comments on commit a74b259

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