mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
QgsDataSourceURI: add parameters to uri
This commit is contained in:
parent
9aa678b963
commit
d546de1a4c
@ -240,7 +240,8 @@ QgsDataSourceURI::QgsDataSourceURI( QString uri )
|
||||
}
|
||||
else
|
||||
{
|
||||
QgsDebugMsg( "invalid connection option \"" + pname + "\" ignored" );
|
||||
QgsDebugMsg( "parameter \"" + pname + "\":\"" + pval + "\" added" );
|
||||
setParam( pname, pval );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -590,6 +591,17 @@ QString QgsDataSourceURI::uri() const
|
||||
theUri += QString( " selectatid=false" );
|
||||
}
|
||||
|
||||
for ( QMap<QString, QString>::const_iterator it = mParams.begin(); it != mParams.end(); ++it )
|
||||
{
|
||||
if ( it.key().contains( "=" ) || it.key().contains( " " ) )
|
||||
{
|
||||
QgsDebugMsg( QString( "invalid uri parameter %1 skipped" ).arg( it.key() ) );
|
||||
continue;
|
||||
}
|
||||
|
||||
theUri += " " + it.key() + "='" + escape( it.value() ) + "'";
|
||||
}
|
||||
|
||||
QString columnName( mGeometryColumn );
|
||||
columnName.replace( "\\", "\\\\" );
|
||||
columnName.replace( ")", "\\)" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user