Fix some obvious warnings
Ignore some stupid warnings
This commit is contained in:
+6
-10
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "accountmanager.hpp"
|
||||
#include "credentials.hpp"
|
||||
#include "debug/log.hpp"
|
||||
#include "util/networkmanager.hpp"
|
||||
|
||||
#include <QEventLoop>
|
||||
@@ -9,13 +10,9 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <functional>
|
||||
|
||||
@@ -59,24 +56,24 @@ static void getUserID(QString username, const QObject *caller,
|
||||
get("https://api.twitch.tv/kraken/users?login=" + username, caller,
|
||||
[=](const QJsonObject &root) {
|
||||
if (!root.value("users").isArray()) {
|
||||
qDebug() << "API Error while getting user id, users is not an array";
|
||||
debug::Log("API Error while getting user id, users is not an array");
|
||||
return;
|
||||
}
|
||||
|
||||
auto users = root.value("users").toArray();
|
||||
if (users.size() != 1) {
|
||||
qDebug() << "API Error while getting user id, users array size is not 1";
|
||||
debug::Log("API Error while getting user id, users array size is not 1");
|
||||
return;
|
||||
}
|
||||
if (!users[0].isObject()) {
|
||||
qDebug() << "API Error while getting user id, first user is not an object";
|
||||
debug::Log("API Error while getting user id, first user is not an object");
|
||||
return;
|
||||
}
|
||||
auto firstUser = users[0].toObject();
|
||||
auto id = firstUser.value("_id");
|
||||
if (!id.isString()) {
|
||||
qDebug() << "API Error: while getting user id, first user object `_id` key is not "
|
||||
"a string";
|
||||
debug::Log("API Error: while getting user id, first user object `_id` key is not a "
|
||||
"string");
|
||||
return;
|
||||
}
|
||||
successCallback(id.toString());
|
||||
@@ -84,7 +81,6 @@ static void getUserID(QString username, const QObject *caller,
|
||||
}
|
||||
static void put(QUrl url, std::function<void(QJsonObject)> successCallback)
|
||||
{
|
||||
auto manager = new QNetworkAccessManager();
|
||||
QNetworkRequest request(url);
|
||||
|
||||
auto &accountManager = AccountManager::getInstance();
|
||||
|
||||
Reference in New Issue
Block a user