Fix windows-specific compilation error

This commit is contained in:
Rasmus Karlsson 2018-05-12 19:50:22 +02:00
parent bf0b5d08d8
commit 752992760b
2 changed files with 13 additions and 13 deletions

View file

@ -77,7 +77,7 @@ void TwitchAccount::loadIgnores()
QString url("https://api.twitch.tv/kraken/users/" + this->getUserId() + "/blocks");
util::NetworkRequest req(url);
req.setRequestType(util::NetworkRequest::GET);
req.setRequestType(util::NetworkRequest::GetRequest);
req.setCaller(QThread::currentThread());
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
req.onSuccess([=](const rapidjson::Document &document) {
@ -125,7 +125,7 @@ void TwitchAccount::ignore(const QString &targetName,
targetUserID);
util::NetworkRequest req(url);
req.setRequestType(util::NetworkRequest::PUT);
req.setRequestType(util::NetworkRequest::PutRequest);
req.setCaller(QThread::currentThread());
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());
@ -177,7 +177,7 @@ void TwitchAccount::unignore(const QString &targetName,
targetUserID);
util::NetworkRequest req(url);
req.setRequestType(util::NetworkRequest::DELETE);
req.setRequestType(util::NetworkRequest::DeleteRequest);
req.setCaller(QThread::currentThread());
req.makeAuthorizedV5(this->getOAuthClient(), this->getOAuthToken());

View file

@ -64,10 +64,10 @@ class NetworkRequest
{
public:
enum RequestType {
GET,
POST,
PUT,
DELETE,
GetRequest,
PostRequest,
PutRequest,
DeleteRequest,
};
private:
@ -302,16 +302,16 @@ public:
void execute()
{
switch (this->data.requestType) {
case GET: {
case GetRequest: {
this->executeGet();
} break;
case PUT: {
case PutRequest: {
debug::Log("Call PUT request!");
this->executePut();
} break;
case DELETE: {
case DeleteRequest: {
debug::Log("Call DELETE request!");
this->executeDelete();
} break;
@ -394,15 +394,15 @@ private:
[timer, data = std::move(this->data), worker]() {
QNetworkReply *reply;
switch (data.requestType) {
case GET: {
case GetRequest: {
reply = NetworkManager::NaM.get(data.request);
} break;
case PUT: {
case PutRequest: {
reply = NetworkManager::NaM.put(data.request, data.payload);
} break;
case DELETE: {
case DeleteRequest: {
reply = NetworkManager::NaM.deleteResource(data.request);
} break;
}