mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 00:57:24 +02:00
PR Fixes
This commit is contained in:
parent
a9c294099e
commit
b972d4260c
3 changed files with 14 additions and 21 deletions
|
@ -203,7 +203,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
||||||
setOrganizationName(applicationInfo.value("organizationName").toString());
|
setOrganizationName(applicationInfo.value("organizationName").toString());
|
||||||
setOrganizationDomain(applicationInfo.value("organizationDomain").toString());
|
setOrganizationDomain(applicationInfo.value("organizationDomain").toString());
|
||||||
|
|
||||||
qDebug("[VERSION] Build sequence: %s\n", applicationVersion().toStdString().c_str());
|
qDebug() << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
|
||||||
|
|
||||||
_settings = new QSettings(this);
|
_settings = new QSettings(this);
|
||||||
|
|
||||||
|
@ -4426,6 +4426,7 @@ void Application::parseVersionXml() {
|
||||||
QString releaseDate;
|
QString releaseDate;
|
||||||
QString releaseNotes;
|
QString releaseNotes;
|
||||||
QString latestVersion;
|
QString latestVersion;
|
||||||
|
QUrl downloadUrl;
|
||||||
|
|
||||||
QXmlStreamReader xml(_latestVersionReply);
|
QXmlStreamReader xml(_latestVersionReply);
|
||||||
while (!xml.atEnd() && !xml.hasError()) {
|
while (!xml.atEnd() && !xml.hasError()) {
|
||||||
|
@ -4446,13 +4447,13 @@ void Application::parseVersionXml() {
|
||||||
}
|
}
|
||||||
if (xml.name() == operatingSystem) {
|
if (xml.name() == operatingSystem) {
|
||||||
xml.readNext();
|
xml.readNext();
|
||||||
_downloadUrl = QUrl(xml.text().toString());
|
downloadUrl = QUrl(xml.text().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) {
|
if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) {
|
||||||
new UpdateDialog(_glWidget, releaseNotes, latestVersion, _downloadUrl);
|
new UpdateDialog(_glWidget, releaseNotes, latestVersion, downloadUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete _latestVersionReply;
|
delete _latestVersionReply;
|
||||||
|
|
|
@ -19,10 +19,11 @@
|
||||||
#include "SharedUtil.h"
|
#include "SharedUtil.h"
|
||||||
#include "UpdateDialog.h"
|
#include "UpdateDialog.h"
|
||||||
|
|
||||||
UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latestVersion, QUrl downloadURL) :
|
UpdateDialog::UpdateDialog(QWidget *parent, const QString& releaseNotes, const QString& latestVersion, const QUrl& downloadURL) :
|
||||||
QWidget(parent, Qt::Widget) {
|
QWidget(parent, Qt::Widget) {
|
||||||
|
|
||||||
_latestVersion = new QString(latestVersion);
|
_latestVersion = latestVersion;
|
||||||
|
_downloadUrl = downloadURL;
|
||||||
|
|
||||||
QUiLoader updateDialogLoader;
|
QUiLoader updateDialogLoader;
|
||||||
QWidget* updateDialog;
|
QWidget* updateDialog;
|
||||||
|
@ -46,22 +47,16 @@ UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latest
|
||||||
|
|
||||||
connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload()));
|
connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload()));
|
||||||
connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip()));
|
connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip()));
|
||||||
connect(closeButton, SIGNAL(released()), this, SLOT(handleClose()));
|
connect(closeButton, SIGNAL(released()), this, SLOT(close()));
|
||||||
updateDialog->show();
|
updateDialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateDialog::handleDownload() {
|
void UpdateDialog::handleDownload() {
|
||||||
Application* application = Application::getInstance();
|
QDesktopServices::openUrl(_downloadUrl);
|
||||||
QDesktopServices::openUrl(application->_downloadUrl);
|
Application::getInstance()->quit();
|
||||||
application->quit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateDialog::handleSkip() {
|
void UpdateDialog::handleSkip() {
|
||||||
Application* application = Application::getInstance();
|
Application::getInstance()->skipVersion(_latestVersion);
|
||||||
application->skipVersion(*_latestVersion);
|
|
||||||
this->close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateDialog::handleClose() {
|
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
|
@ -9,24 +9,21 @@
|
||||||
#ifndef __hifi__UpdateDialog__
|
#ifndef __hifi__UpdateDialog__
|
||||||
#define __hifi__UpdateDialog__
|
#define __hifi__UpdateDialog__
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
class UpdateDialog : public QWidget {
|
class UpdateDialog : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UpdateDialog(QWidget* parent, QString releaseNotes, QString latestVersion, QUrl downloadURL);
|
UpdateDialog(QWidget* parent, const QString& releaseNotes, const QString& latestVersion, const QUrl& downloadURL);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString* _latestVersion;
|
QString _latestVersion;
|
||||||
|
QUrl _downloadUrl;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleDownload();
|
void handleDownload();
|
||||||
void handleSkip();
|
void handleSkip();
|
||||||
void handleClose();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* defined(__hifi__UpdateDialog__) */
|
#endif /* defined(__hifi__UpdateDialog__) */
|
||||||
|
|
Loading…
Reference in a new issue