QgsDataSourceURI: add parameters to uri

This commit is contained in:
Juergen E. Fischer 2014-11-03 23:28:35 +01:00
parent 9aa678b963
commit d546de1a4c

View File

@ -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( ")", "\\)" );