Skip to content
Permalink
Browse files

QgsDataSourceURI: add parameters to uri

  • Loading branch information
jef-n committed Nov 3, 2014
1 parent 9aa678b commit d546de1a4c2d383f66ab5b89d8fbca0beb8ab85f
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/core/qgsdatasourceuri.cpp
@@ -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( ")", "\\)" );

0 comments on commit d546de1

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