diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2017-12-08 12:10:28 +0300 |
---|---|---|
committer | Olivier Goffart <ogoffart@woboq.com> | 2017-12-08 18:15:17 +0300 |
commit | 74672d493d68a966095566f329563d701385b47a (patch) | |
tree | 2dffda95e8bf79daac253068e06c9af0b0be6ab2 /src/gui/creds | |
parent | f1b7d506ae534f634f8e0c071820b03ebaf1950c (diff) |
Utility: use QUrlQuery
For QUrl::setQuery is deprecated in Qt5
Diffstat (limited to 'src/gui/creds')
-rw-r--r-- | src/gui/creds/oauth.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/creds/oauth.cpp b/src/gui/creds/oauth.cpp index 85a13f4c1..4980b8db9 100644 --- a/src/gui/creds/oauth.cpp +++ b/src/gui/creds/oauth.cpp @@ -156,12 +156,13 @@ void OAuth::start() QUrl OAuth::authorisationLink() const { Q_ASSERT(_server.isListening()); - QUrl url = Utility::concatUrlPath(_account->url(), QLatin1String("/index.php/apps/oauth2/authorize"), - { { QLatin1String("response_type"), QLatin1String("code") }, - { QLatin1String("client_id"), Theme::instance()->oauthClientId() }, - { QLatin1String("redirect_uri"), QLatin1String("http://localhost:") + QString::number(_server.serverPort()) } }); + QUrlQuery query; + query.setQueryItems({ { QLatin1String("response_type"), QLatin1String("code") }, + { QLatin1String("client_id"), Theme::instance()->oauthClientId() }, + { QLatin1String("redirect_uri"), QLatin1String("http://localhost:") + QString::number(_server.serverPort()) } }); if (!_expectedUser.isNull()) - url.addQueryItem("user", _expectedUser); + query.addQueryItem("user", _expectedUser); + QUrl url = Utility::concatUrlPath(_account->url(), QLatin1String("/index.php/apps/oauth2/authorize"), query); return url; } |