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
937fffc34b
commit
88e97325f8
|
@ -176,7 +176,7 @@ void TwitchAccount::ignoreByID(const QString &targetUserID, const QString &targe
|
||||||
});
|
});
|
||||||
|
|
||||||
req.execute();
|
req.execute();
|
||||||
}
|
} // namespace twitch
|
||||||
|
|
||||||
void TwitchAccount::unignore(const QString &targetName,
|
void TwitchAccount::unignore(const QString &targetName,
|
||||||
std::function<void(UnignoreResult, const QString &message)> onFinished)
|
std::function<void(UnignoreResult, const QString &message)> onFinished)
|
||||||
|
|
|
@ -151,26 +151,15 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRawHeader(const char *headerName, const char *value)
|
void setRawHeader(const char *headerName, const char *value)
|
||||||
<<<<<<< 5b26cdaa0777562a0b3c663a203528eca56bd5df
|
|
||||||
=======
|
|
||||||
{
|
{
|
||||||
this->data.request.setRawHeader(headerName, value);
|
this->data.request.setRawHeader(headerName, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setRawHeader(const char *headerName, const QByteArray &value)
|
void setRawHeader(const char *headerName, const QByteArray &value)
|
||||||
>>>>>>> Implement /ignore and /unignore commands
|
|
||||||
{
|
{
|
||||||
this->data.request.setRawHeader(headerName, value);
|
this->data.request.setRawHeader(headerName, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< 5b26cdaa0777562a0b3c663a203528eca56bd5df
|
|
||||||
void setRawHeader(const char *headerName, const QByteArray &value)
|
|
||||||
{
|
|
||||||
this->data.request.setRawHeader(headerName, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> Implement /ignore and /unignore commands
|
|
||||||
void setRawHeader(const char *headerName, const QString &value)
|
void setRawHeader(const char *headerName, const QString &value)
|
||||||
{
|
{
|
||||||
this->data.request.setRawHeader(headerName, value.toUtf8());
|
this->data.request.setRawHeader(headerName, value.toUtf8());
|
||||||
|
@ -313,28 +302,17 @@ public:
|
||||||
void execute()
|
void execute()
|
||||||
{
|
{
|
||||||
switch (this->data.requestType) {
|
switch (this->data.requestType) {
|
||||||
<<<<<<< 5b26cdaa0777562a0b3c663a203528eca56bd5df
|
|
||||||
case GetRequest: {
|
case GetRequest: {
|
||||||
|
debug::Log("Call GET request!");
|
||||||
this->executeGet();
|
this->executeGet();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case PutRequest: {
|
case PutRequest: {
|
||||||
=======
|
|
||||||
case GET: {
|
|
||||||
this->executeGet();
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case PUT: {
|
|
||||||
>>>>>>> Implement /ignore and /unignore commands
|
|
||||||
debug::Log("Call PUT request!");
|
debug::Log("Call PUT request!");
|
||||||
this->executePut();
|
this->executePut();
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
<<<<<<< 5b26cdaa0777562a0b3c663a203528eca56bd5df
|
|
||||||
case DeleteRequest: {
|
case DeleteRequest: {
|
||||||
=======
|
|
||||||
case DELETE: {
|
|
||||||
>>>>>>> Implement /ignore and /unignore commands
|
|
||||||
debug::Log("Call DELETE request!");
|
debug::Log("Call DELETE request!");
|
||||||
this->executeDelete();
|
this->executeDelete();
|
||||||
} break;
|
} break;
|
||||||
|
@ -343,7 +321,7 @@ public:
|
||||||
debug::Log("Unhandled request type {}", (int)this->data.requestType);
|
debug::Log("Unhandled request type {}", (int)this->data.requestType);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
} // namespace util
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void useCache()
|
void useCache()
|
||||||
|
@ -392,7 +370,6 @@ private:
|
||||||
worker->moveToThread(&NetworkManager::workerThread);
|
worker->moveToThread(&NetworkManager::workerThread);
|
||||||
|
|
||||||
if (this->data.caller != nullptr) {
|
if (this->data.caller != nullptr) {
|
||||||
<<<<<<< 5b26cdaa0777562a0b3c663a203528eca56bd5df
|
|
||||||
QObject::connect(worker, &NetworkWorker::doneUrl,
|
QObject::connect(worker, &NetworkWorker::doneUrl,
|
||||||
this->data.caller, [data = this->data](auto reply) mutable {
|
this->data.caller, [data = this->data](auto reply) mutable {
|
||||||
auto &dat = data;
|
auto &dat = data;
|
||||||
|
@ -401,12 +378,6 @@ private:
|
||||||
if (data.onError) {
|
if (data.onError) {
|
||||||
data.onError(reply->error());
|
data.onError(reply->error());
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
QObject::connect(worker, &NetworkWorker::doneUrl,
|
|
||||||
this->data.caller, [data = this->data](auto reply) mutable {
|
|
||||||
if (reply->error() != QNetworkReply::NetworkError::NoError) {
|
|
||||||
// TODO: We might want to call an onError callback here
|
|
||||||
>>>>>>> Implement /ignore and /unignore commands
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,14 +389,14 @@ private:
|
||||||
|
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
});
|
});
|
||||||
}
|
} // namespace chatterino
|
||||||
|
|
||||||
if (timer != nullptr) {
|
if (timer != nullptr) {
|
||||||
timer->start(this->data.timeoutMS);
|
timer->start(this->data.timeoutMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject::connect(&requester, &NetworkRequester::requestUrl, worker,
|
QObject::connect(
|
||||||
<<<<<<< 5b26cdaa0777562a0b3c663a203528eca56bd5df
|
&requester, &NetworkRequester::requestUrl, worker,
|
||||||
[ timer, data = std::move(this->data), worker ]() {
|
[ timer, data = std::move(this->data), worker ]() {
|
||||||
QNetworkReply *reply;
|
QNetworkReply *reply;
|
||||||
switch (data.requestType) {
|
switch (data.requestType) {
|
||||||
|
@ -438,23 +409,9 @@ private:
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DeleteRequest: {
|
case DeleteRequest: {
|
||||||
=======
|
|
||||||
[ timer, data = std::move(this->data), worker ]() {
|
|
||||||
QNetworkReply *reply;
|
|
||||||
switch (data.requestType) {
|
|
||||||
case GET: {
|
|
||||||
reply = NetworkManager::NaM.get(data.request);
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case PUT: {
|
|
||||||
reply = NetworkManager::NaM.put(data.request, data.payload);
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case DELETE: {
|
|
||||||
>>>>>>> Implement /ignore and /unignore commands
|
|
||||||
reply = NetworkManager::NaM.deleteResource(data.request);
|
reply = NetworkManager::NaM.deleteResource(data.request);
|
||||||
} break;
|
} break;
|
||||||
}
|
} // namespace chatterino
|
||||||
|
|
||||||
if (reply == nullptr) {
|
if (reply == nullptr) {
|
||||||
debug::Log("Unhandled request type {}", (int)data.requestType);
|
debug::Log("Unhandled request type {}", (int)data.requestType);
|
||||||
|
@ -462,8 +419,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timer != nullptr) {
|
if (timer != nullptr) {
|
||||||
QObject::connect(timer, &QTimer::timeout, worker,
|
QObject::connect(timer, &QTimer::timeout, worker, [reply, timer, data]() {
|
||||||
[reply, timer, data]() {
|
|
||||||
debug::Log("Aborted!");
|
debug::Log("Aborted!");
|
||||||
reply->abort();
|
reply->abort();
|
||||||
timer->deleteLater();
|
timer->deleteLater();
|
||||||
|
@ -476,11 +432,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject::connect(reply, &QNetworkReply::finished, worker,
|
QObject::connect(reply, &QNetworkReply::finished, worker,
|
||||||
<<<<<<< 5b26cdaa0777562a0b3c663a203528eca56bd5df
|
|
||||||
[ data = std::move(data), worker, reply ]() mutable {
|
[ data = std::move(data), worker, reply ]() mutable {
|
||||||
=======
|
|
||||||
[ data = std::move(data), worker, reply ]() mutable {
|
|
||||||
>>>>>>> Implement /ignore and /unignore commands
|
|
||||||
if (data.caller == nullptr) {
|
if (data.caller == nullptr) {
|
||||||
QByteArray bytes = reply->readAll();
|
QByteArray bytes = reply->readAll();
|
||||||
data.writeToCache(bytes);
|
data.writeToCache(bytes);
|
||||||
|
@ -493,10 +445,11 @@ private:
|
||||||
|
|
||||||
delete worker;
|
delete worker;
|
||||||
});
|
});
|
||||||
});
|
} // namespace util
|
||||||
|
);
|
||||||
|
|
||||||
emit requester.requestUrl();
|
emit requester.requestUrl();
|
||||||
}
|
} // namespace chatterino
|
||||||
|
|
||||||
void executeGet()
|
void executeGet()
|
||||||
{
|
{
|
||||||
|
@ -514,7 +467,7 @@ private:
|
||||||
{
|
{
|
||||||
this->doRequest();
|
this->doRequest();
|
||||||
}
|
}
|
||||||
};
|
}; // namespace util
|
||||||
|
|
||||||
} // namespace util
|
} // namespace util
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
Loading…
Reference in a new issue