Skip to content

Commit

Permalink
Check version of HANA connection file
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksim Rylov authored and mrylov committed Dec 7, 2020
1 parent e30e7b7 commit 6cd4070
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/gui/qgsmanageconnectionsdialog.cpp
Expand Up @@ -1392,7 +1392,15 @@ void QgsManageConnectionsDialog::loadHanaConnections( const QDomDocument &doc, c
return;
}

QString connectionName;
QDomAttr version = root.attributeNode( "version" );
if ( version.value() != QLatin1String( "1.0" ) )
{
QMessageBox::information( this,
tr( "Loading Connections" ),
tr( "The file version '%1' is not supported." ).arg( version.value() ) );
return;
}

QgsSettings settings;
settings.beginGroup( QStringLiteral( "/HANA/connections" ) );
QStringList keys = settings.childGroups();
Expand All @@ -1403,7 +1411,7 @@ void QgsManageConnectionsDialog::loadHanaConnections( const QDomDocument &doc, c

while ( !child.isNull() )
{
connectionName = child.attribute( QStringLiteral( "name" ) );
QString connectionName = child.attribute( QStringLiteral( "name" ) );
if ( !items.contains( connectionName ) )
{
child = child.nextSiblingElement();
Expand Down

0 comments on commit 6cd4070

Please sign in to comment.