Skip to content

Commit

Permalink
fix #2026
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12927 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 11, 2010
1 parent b1e241a commit c3942d4
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/app/ogr/qgsogrhelperfunctions.cpp
Expand Up @@ -97,11 +97,23 @@ QString createDatabaseURI( QString connectionType, QString host, QString databas
uri += password;
}

if ( !host.isEmpty() )
if ( !host.isEmpty() || !database.isEmpty() )
{
uri += "@" + host;
uri += "@";

if ( !host.isEmpty() )
{
uri += host;
if ( !port.isEmpty() )
uri += ":" + port;
}

if ( !database.isEmpty() )
uri += "/" + database;
{
if ( !host.isEmpty() )
uri += "/";
uri += database;
}
}
}
else if ( connectionType == "ODBC" )
Expand Down

0 comments on commit c3942d4

Please sign in to comment.