mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix windows-specific compilation error
This commit is contained in:
parent
bf0b5d08d8
commit
752992760b
|
@ -77,7 +77,7 @@ void TwitchAccount::loadIgnores()
|
||||||
QString url("https://api.twitch.tv/kraken/users/" + this->getUserId() + "/blocks");
|
QString url("https://api.twitch.tv/kraken/users/" + this->getUserId() + "/blocks");
|
||||||
|
|
||||||
util::NetworkRequest req(url);
|
util::NetworkRequest req(url);
|
||||||
req.setRequestType(util::NetworkRequest::GET);
|
req.setRequestType(util::NetworkRequest::GetRequest);
|
||||||
req.setCaller(QThread::currentThread());
|
req.setCaller(QThread::currentThread());
|
||||||
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
|
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
|
||||||
req.onSuccess([=](const rapidjson::Document &document) {
|
req.onSuccess([=](const rapidjson::Document &document) {
|
||||||
|
@ -125,7 +125,7 @@ void TwitchAccount::ignore(const QString &targetName,
|
||||||
targetUserID);
|
targetUserID);
|
||||||
|
|
||||||
util::NetworkRequest req(url);
|
util::NetworkRequest req(url);
|
||||||
req.setRequestType(util::NetworkRequest::PUT);
|
req.setRequestType(util::NetworkRequest::PutRequest);
|
||||||
req.setCaller(QThread::currentThread());
|
req.setCaller(QThread::currentThread());
|
||||||
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
|
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ void TwitchAccount::unignore(const QString &targetName,
|
||||||
targetUserID);
|
targetUserID);
|
||||||
|
|
||||||
util::NetworkRequest req(url);
|
util::NetworkRequest req(url);
|
||||||
req.setRequestType(util::NetworkRequest::DELETE);
|
req.setRequestType(util::NetworkRequest::DeleteRequest);
|
||||||
req.setCaller(QThread::currentThread());
|
req.setCaller(QThread::currentThread());
|
||||||
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
|
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
|
||||||
|
|
||||||
|
|
|
@ -64,10 +64,10 @@ class NetworkRequest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum RequestType {
|
enum RequestType {
|
||||||
GET,
|
GetRequest,
|
||||||
POST,
|
PostRequest,
|
||||||
PUT,
|
PutRequest,
|
||||||
DELETE,
|
DeleteRequest,
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -302,16 +302,16 @@ public:
|
||||||
void execute()
|
void execute()
|
||||||
{
|
{
|
||||||
switch (this->data.requestType) {
|
switch (this->data.requestType) {
|
||||||
case GET: {
|
case GetRequest: {
|
||||||
this->executeGet();
|
this->executeGet();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case PUT: {
|
case PutRequest: {
|
||||||
debug::Log("Call PUT request!");
|
debug::Log("Call PUT request!");
|
||||||
this->executePut();
|
this->executePut();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DELETE: {
|
case DeleteRequest: {
|
||||||
debug::Log("Call DELETE request!");
|
debug::Log("Call DELETE request!");
|
||||||
this->executeDelete();
|
this->executeDelete();
|
||||||
} break;
|
} break;
|
||||||
|
@ -394,15 +394,15 @@ private:
|
||||||
[timer, data = std::move(this->data), worker]() {
|
[timer, data = std::move(this->data), worker]() {
|
||||||
QNetworkReply *reply;
|
QNetworkReply *reply;
|
||||||
switch (data.requestType) {
|
switch (data.requestType) {
|
||||||
case GET: {
|
case GetRequest: {
|
||||||
reply = NetworkManager::NaM.get(data.request);
|
reply = NetworkManager::NaM.get(data.request);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case PUT: {
|
case PutRequest: {
|
||||||
reply = NetworkManager::NaM.put(data.request, data.payload);
|
reply = NetworkManager::NaM.put(data.request, data.payload);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DELETE: {
|
case DeleteRequest: {
|
||||||
reply = NetworkManager::NaM.deleteResource(data.request);
|
reply = NetworkManager::NaM.deleteResource(data.request);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue