Fix that an URL without a port resulted in wrong portnumber being used. Closes #75
This commit is contained in:
parent
7dc665948d
commit
a5069bb2b9
1 changed files with 1 additions and 3 deletions
|
|
@ -4,8 +4,6 @@
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
|
|
||||||
//PostgresqlUrlParser::PostgresqlUrlParser() {}
|
|
||||||
|
|
||||||
bool TryParsePostgresqlUrl(const QString &urlString, ConnectionConfig &out)
|
bool TryParsePostgresqlUrl(const QString &urlString, ConnectionConfig &out)
|
||||||
{
|
{
|
||||||
const char* shortPrefix = "postgres";
|
const char* shortPrefix = "postgres";
|
||||||
|
|
@ -19,7 +17,7 @@ bool TryParsePostgresqlUrl(const QString &urlString, ConnectionConfig &out)
|
||||||
out.setPassword(url.password());
|
out.setPassword(url.password());
|
||||||
out.setHost(url.host());
|
out.setHost(url.host());
|
||||||
out.setDbname(url.fileName());
|
out.setDbname(url.fileName());
|
||||||
out.setPort(url.port());
|
out.setPort(url.port(5432));
|
||||||
|
|
||||||
QUrlQuery query(url.query());
|
QUrlQuery query(url.query());
|
||||||
for (auto && param : query.queryItems())
|
for (auto && param : query.queryItems())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue