mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 06:42:57 +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());
|
||||
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);
|
||||
|
||||
|
@ -4426,6 +4426,7 @@ void Application::parseVersionXml() {
|
|||
QString releaseDate;
|
||||
QString releaseNotes;
|
||||
QString latestVersion;
|
||||
QUrl downloadUrl;
|
||||
|
||||
QXmlStreamReader xml(_latestVersionReply);
|
||||
while (!xml.atEnd() && !xml.hasError()) {
|
||||
|
@ -4446,13 +4447,13 @@ void Application::parseVersionXml() {
|
|||
}
|
||||
if (xml.name() == operatingSystem) {
|
||||
xml.readNext();
|
||||
_downloadUrl = QUrl(xml.text().toString());
|
||||
downloadUrl = QUrl(xml.text().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!shouldSkipVersion(latestVersion) && applicationVersion() != latestVersion) {
|
||||
new UpdateDialog(_glWidget, releaseNotes, latestVersion, _downloadUrl);
|
||||
new UpdateDialog(_glWidget, releaseNotes, latestVersion, downloadUrl);
|
||||
}
|
||||
|
||||
delete _latestVersionReply;
|
||||
|
|
|
@ -19,10 +19,11 @@
|
|||
#include "SharedUtil.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) {
|
||||
|
||||
_latestVersion = new QString(latestVersion);
|
||||
_latestVersion = latestVersion;
|
||||
_downloadUrl = downloadURL;
|
||||
|
||||
QUiLoader updateDialogLoader;
|
||||
QWidget* updateDialog;
|
||||
|
@ -46,22 +47,16 @@ UpdateDialog::UpdateDialog(QWidget *parent, QString releaseNotes, QString latest
|
|||
|
||||
connect(downloadButton, SIGNAL(released()), this, SLOT(handleDownload()));
|
||||
connect(skipButton, SIGNAL(released()), this, SLOT(handleSkip()));
|
||||
connect(closeButton, SIGNAL(released()), this, SLOT(handleClose()));
|
||||
connect(closeButton, SIGNAL(released()), this, SLOT(close()));
|
||||
updateDialog->show();
|
||||
}
|
||||
|
||||
void UpdateDialog::handleDownload() {
|
||||
Application* application = Application::getInstance();
|
||||
QDesktopServices::openUrl(application->_downloadUrl);
|
||||
application->quit();
|
||||
QDesktopServices::openUrl(_downloadUrl);
|
||||
Application::getInstance()->quit();
|
||||
}
|
||||
|
||||
void UpdateDialog::handleSkip() {
|
||||
Application* application = Application::getInstance();
|
||||
application->skipVersion(*_latestVersion);
|
||||
this->close();
|
||||
}
|
||||
|
||||
void UpdateDialog::handleClose() {
|
||||
Application::getInstance()->skipVersion(_latestVersion);
|
||||
this->close();
|
||||
}
|
|
@ -9,24 +9,21 @@
|
|||
#ifndef __hifi__UpdateDialog__
|
||||
#define __hifi__UpdateDialog__
|
||||
|
||||
#include <QDialog>
|
||||
#include <QWidget>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class UpdateDialog : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
UpdateDialog(QWidget* parent, QString releaseNotes, QString latestVersion, QUrl downloadURL);
|
||||
UpdateDialog(QWidget* parent, const QString& releaseNotes, const QString& latestVersion, const QUrl& downloadURL);
|
||||
|
||||
private:
|
||||
QString* _latestVersion;
|
||||
QString _latestVersion;
|
||||
QUrl _downloadUrl;
|
||||
|
||||
private slots:
|
||||
void handleDownload();
|
||||
void handleSkip();
|
||||
void handleClose();
|
||||
};
|
||||
|
||||
#endif /* defined(__hifi__UpdateDialog__) */
|
||||
|
|
Loading…
Reference in a new issue