History

CR fixes

Leonardo Murillo committed 12 years ago

Commit b8aaf4e1 parent 746b45d4 files · +44 −61Browse files

Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all

Unified · Split

interface/src/Application.cpp+20−16
@@ -4422,18 +4422,22 @@ void Application::checkVersion() { · 4421 unmodified lines
44224422 }
44234423
44244424 void Application::parseVersionXml(QNetworkReply *reply) {
4425− QString *_operatingSystem;
4425+ QString *operatingSystem;
44264426
44274427 #ifdef Q_OS_WIN32
4428− _operatingSystem = new QString("win");
4428+ operatingSystem = new QString("win");
44294429 #endif
44304430
44314431 #ifdef Q_OS_MAC
4432− _operatingSystem = new QString("mac");
4432+ operatingSystem = new QString("mac");
44334433 #endif
44344434
4435− QString _releaseDate;
4436− QString _releaseNotes;
4435+ QString releaseDate;
4436+ QString releaseNotes;
4437+ QString latestVersion;
4438+ QUrl downloadURL;
4439+
4440+ QWidget *updateDialog;
44374441
44384442 QXmlStreamReader xml(reply);
44394443 while (!xml.atEnd() && !xml.hasError()) {
@@ -4442,25 +4446,25 @@ void Application::parseVersionXml(QNetworkReply *reply) { · 2 unmodified lines
44424446 if (token == QXmlStreamReader::StartElement) {
44434447 if (xml.name() == "ReleaseDate") {
44444448 xml.readNext();
4445− _releaseDate = xml.text().toString();
4449+ releaseDate = xml.text().toString();
44464450 }
44474451 if (xml.name() == "ReleaseNotes") {
44484452 xml.readNext();
4449− _releaseNotes = xml.text().toString();
4453+ releaseNotes = xml.text().toString();
44504454 }
44514455 if (xml.name() == "Version") {
44524456 xml.readNext();
4453− _latestVersion = new QString(xml.text().toString());
4457+ latestVersion = xml.text().toString();
44544458 }
4455− if (xml.name() == _operatingSystem) {
4459+ if (xml.name() == operatingSystem) {
44564460 xml.readNext();
4457− _downloadURL = new QUrl(xml.text().toString());
4461+ downloadURL = QUrl(xml.text().toString());
44584462 }
44594463 }
44604464 }
44614465
4462− if (!shouldSkipVersion() && applicationVersion() != _latestVersion) {
4463− _updateDialog = new UpdateDialog(_glWidget, _releaseNotes);
4466+ if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) {
4467+ updateDialog = new UpdateDialog(_glWidget, releaseNotes);
44644468 }
44654469 }
44664470
@@ -4472,20 +4476,20 @@ QFile *Application::loadSkipFile() { · 5 unmodified lines
44724476 return file;
44734477 }
44744478
4475−bool Application::shouldSkipVersion() {
4479+bool Application::shouldSkipVersion(QString latestVersion) {
44764480 QFile *skipFile = loadSkipFile();
44774481 QByteArray skipFileContents = skipFile->readAll();
44784482 QString *skipVersion = new QString(skipFileContents);
44794483 skipFile->close();
4480− if (*skipVersion == *_latestVersion || applicationVersion() == "0.1") {
4484+ if (*skipVersion == latestVersion || applicationVersion() == "0.1") {
44814485 return true;
44824486 }
44834487 return false;
44844488 }
44854489
4486−void Application::skipVersion() {
4490+void Application::skipVersion(QString latestVersion) {
44874491 QFile *skipFile = loadSkipFile();
44884492 skipFile->seek(0);
4489− skipFile->write(_latestVersion->toStdString().c_str());
4493+ skipFile->write(latestVersion.toStdString().c_str());
44904494 skipFile->close();
44914495 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t