Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -36,6 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | #include <QNetworkReply> |
| 37 | 37 | #include <QNetworkDiskCache> |
| 38 | 38 | #include <QOpenGLFramebufferObject> |
| 39 | +#include <QObject> | |
| 39 | 40 | #include <QWheelEvent> |
| 40 | 41 | #include <QSettings> |
| 41 | 42 | #include <QShortcut> |
| @@ -4402,16 +4403,12 @@ void Application::updateLocalOctreeCache(bool firstTime) { · 4360 unmodified lines | ||
| 4402 | 4403 | } |
| 4403 | 4404 | |
| 4404 | 4405 | void Application::checkVersion() { |
| 4405 | − qDebug() << "################### in check version"; | |
| 4406 | 4406 | QNetworkRequest latestVersionRequest((QUrl(CHECK_VERSION_URL))); |
| 4407 | 4407 | latestVersionRequest.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); |
| 4408 | − _latestVersionReply = Application::getInstance()->getNetworkAccessManager()->get(latestVersionRequest); | |
| 4409 | − | |
| 4410 | − connect(_latestVersionReply, SIGNAL(finished()), SLOT(parseVersionXml())); | |
| 4408 | + connect(Application::getInstance()->getNetworkAccessManager()->get(latestVersionRequest), SIGNAL(finished()), SLOT(parseVersionXml())); | |
| 4411 | 4409 | } |
| 4412 | 4410 | |
| 4413 | 4411 | void Application::parseVersionXml() { |
| 4414 | − qDebug() << "################### in parse version xml"; | |
| 4415 | 4412 | |
| 4416 | 4413 | #ifdef Q_OS_WIN32 |
| 4417 | 4414 | QString operatingSystem("win"); |
| @@ -4430,7 +4427,7 @@ void Application::parseVersionXml() { · 12 unmodified lines | ||
| 4430 | 4427 | QString latestVersion; |
| 4431 | 4428 | QUrl downloadUrl; |
| 4432 | 4429 | |
| 4433 | − QXmlStreamReader xml(_latestVersionReply); | |
| 4430 | + QXmlStreamReader xml(qobject_cast<QNetworkReply*>(QObject::sender())); | |
| 4434 | 4431 | while (!xml.atEnd() && !xml.hasError()) { |
| 4435 | 4432 | QXmlStreamReader::TokenType token = xml.readNext(); |
| 4436 | 4433 | |
| @@ -4453,12 +4450,9 @@ void Application::parseVersionXml() { · 16 unmodified lines | ||
| 4453 | 4450 | } |
| 4454 | 4451 | } |
| 4455 | 4452 | } |
| 4456 | − | |
| 4457 | 4453 | if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) { |
| 4458 | 4454 | new UpdateDialog(_glWidget, releaseNotes, latestVersion, downloadUrl); |
| 4459 | 4455 | } |
| 4460 | − | |
| 4461 | − delete _latestVersionReply; | |
| 4462 | 4456 | } |
| 4463 | 4457 | |
| 4464 | 4458 | bool Application::shouldSkipVersion(QString latestVersion) { |