Make use of QUrlQuery in NetworkRequests where it was hardcoded into url (#3039)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Paweł
2021-07-18 15:21:09 +02:00
committed by GitHub
parent e5fe0999ee
commit ae9f92ded9
2 changed files with 14 additions and 7 deletions
+6 -2
View File
@@ -7,6 +7,7 @@
#include <QJsonObject>
#include <QJsonValue>
#include <QThread>
#include <QUrlQuery>
#include "common/NetworkRequest.hpp"
#include "common/Outcome.hpp"
@@ -24,8 +25,11 @@ void TwitchBadges::loadTwitchBadges()
{
assert(this->loaded_ == false);
static QString url(
"https://badges.twitch.tv/v1/badges/global/display?language=en");
QUrl url("https://badges.twitch.tv/v1/badges/global/display");
QUrlQuery urlQuery;
urlQuery.addQueryItem("language", "en");
url.setQuery(urlQuery);
NetworkRequest(url)
.onSuccess([this](auto result) -> Outcome {