minor fixes

This commit is contained in:
fourtf 2018-05-16 15:42:45 +02:00
parent c2c3b67f6b
commit 7b192897da
2 changed files with 48 additions and 51 deletions

View file

@ -321,7 +321,7 @@ public:
debug::Log("Unhandled request type {}", (int)this->data.requestType);
} break;
}
} // namespace util
}
private:
void useCache()
@ -372,8 +372,6 @@ private:
if (this->data.caller != nullptr) {
QObject::connect(worker, &NetworkWorker::doneUrl,
this->data.caller, [data = this->data](auto reply) mutable {
auto &dat = data;
if (reply->error() != QNetworkReply::NetworkError::NoError) {
if (data.onError) {
data.onError(reply->error());
@ -389,16 +387,15 @@ private:
reply->deleteLater();
});
} // namespace chatterino
}
if (timer != nullptr) {
timer->start(this->data.timeoutMS);
}
QObject::connect(
&requester, &NetworkRequester::requestUrl, worker,
QObject::connect(&requester, &NetworkRequester::requestUrl, worker,
[ timer, data = std::move(this->data), worker ]() {
QNetworkReply *reply;
QNetworkReply *reply = nullptr;
switch (data.requestType) {
case GetRequest: {
reply = NetworkManager::NaM.get(data.request);
@ -411,7 +408,7 @@ private:
case DeleteRequest: {
reply = NetworkManager::NaM.deleteResource(data.request);
} break;
} // namespace chatterino
}
if (reply == nullptr) {
debug::Log("Unhandled request type {}", (int)data.requestType);
@ -419,7 +416,8 @@ private:
}
if (timer != nullptr) {
QObject::connect(timer, &QTimer::timeout, worker, [reply, timer, data]() {
QObject::connect(timer, &QTimer::timeout, worker,
[reply, timer, data]() {
debug::Log("Aborted!");
reply->abort();
timer->deleteLater();
@ -445,11 +443,10 @@ private:
delete worker;
});
} // namespace util
);
});
emit requester.requestUrl();
} // namespace chatterino
}
void executeGet()
{
@ -467,7 +464,7 @@ private:
{
this->doRequest();
}
}; // namespace util
};
} // namespace util
} // namespace chatterino

View file

@ -137,7 +137,7 @@ bool SplitOverlay::ButtonEventFilter::eventFilter(QObject *watched, QEvent *even
dynamic_cast<QGraphicsOpacityEffect *>(((QWidget *)watched)->graphicsEffect());
if (effect != nullptr) {
effect->setOpacity(1);
effect->setOpacity(0.99);
}
this->parent->hoveredElement = this->hoveredElement;