aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/function/VersionCheckThread.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-01-04 09:03:18 +0000
committerSaturneric <[email protected]>2022-01-04 09:03:18 +0000
commit4b1c63107929e9c5415e75b696876f65eeac9ac3 (patch)
treef37c79244e141af7600c87518dd1da9edc3378ba /src/ui/function/VersionCheckThread.cpp
parent<fix>(core): fix windows build problem (diff)
downloadGpgFrontend-4b1c63107929e9c5415e75b696876f65eeac9ac3.tar.gz
GpgFrontend-4b1c63107929e9c5415e75b696876f65eeac9ac3.zip
<fix>(ui): improve ui.
Diffstat (limited to '')
-rw-r--r--src/ui/function/VersionCheckThread.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ui/function/VersionCheckThread.cpp b/src/ui/function/VersionCheckThread.cpp
index 091f7cd2..52d1b22a 100644
--- a/src/ui/function/VersionCheckThread.cpp
+++ b/src/ui/function/VersionCheckThread.cpp
@@ -56,12 +56,13 @@ void VersionCheckThread::run() {
QNetworkRequest latest_request, current_request;
latest_request.setUrl(QUrl(latest_version_url.c_str()));
current_request.setUrl(QUrl(current_version_url.c_str()));
- auto reply = manager->get(latest_request);
- while (reply->isRunning()) QApplication::processEvents();
- if (reply->error() != QNetworkReply::NoError) {
+ auto _reply = manager->get(latest_request);
+ while (_reply->isRunning()) QApplication::processEvents();
+ if (_reply->error() != QNetworkReply::NoError) {
LOG(ERROR) << "network error";
version.latest_version = current_version;
} else {
+ latest_reply_bytes_ = _reply->readAll();
auto latest_reply_json =
nlohmann::json::parse(latest_reply_bytes_.toStdString());
@@ -90,11 +91,10 @@ void VersionCheckThread::run() {
version.release_note = release_note;
}
- latest_reply_bytes_ = reply->readAll();
- reply = manager->get(current_request);
- while (reply->isRunning()) QApplication::processEvents();
- current_reply_bytes_ = reply->readAll();
- if (reply->error() != QNetworkReply::NoError) {
+ _reply = manager->get(current_request);
+ while (_reply->isRunning()) QApplication::processEvents();
+ current_reply_bytes_ = _reply->readAll();
+ if (_reply->error() != QNetworkReply::NoError) {
LOG(ERROR) << "network error";
manager->deleteLater();
return;