mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 22:13:12 +02:00
Code Review changes
This commit is contained in:
parent
3708f5ec96
commit
3bd0c7bd87
6 changed files with 26 additions and 26 deletions
|
@ -140,7 +140,7 @@ target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES})
|
||||||
# link required hifi libraries
|
# link required hifi libraries
|
||||||
link_hifi_libraries(shared octree environment gpu model render fbx networking entities avatars
|
link_hifi_libraries(shared octree environment gpu model render fbx networking entities avatars
|
||||||
audio audio-client animation script-engine physics
|
audio audio-client animation script-engine physics
|
||||||
render-utils entities-renderer ui auto-update)
|
render-utils entities-renderer ui auto-updater)
|
||||||
|
|
||||||
add_dependency_external_projects(sdl2)
|
add_dependency_external_projects(sdl2)
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
#include <AmbientOcclusionEffect.h>
|
#include <AmbientOcclusionEffect.h>
|
||||||
#include <AudioInjector.h>
|
#include <AudioInjector.h>
|
||||||
#include <AutoUpdate.h>
|
#include <AutoUpdater.h>
|
||||||
#include <DeferredLightingEffect.h>
|
#include <DeferredLightingEffect.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
#include <EntityScriptingInterface.h>
|
#include <EntityScriptingInterface.h>
|
||||||
|
@ -295,7 +295,7 @@ bool setupEssentials(int& argc, char** argv) {
|
||||||
auto discoverabilityManager = DependencyManager::set<DiscoverabilityManager>();
|
auto discoverabilityManager = DependencyManager::set<DiscoverabilityManager>();
|
||||||
auto sceneScriptingInterface = DependencyManager::set<SceneScriptingInterface>();
|
auto sceneScriptingInterface = DependencyManager::set<SceneScriptingInterface>();
|
||||||
auto offscreenUi = DependencyManager::set<OffscreenUi>();
|
auto offscreenUi = DependencyManager::set<OffscreenUi>();
|
||||||
auto autoUpdate = DependencyManager::set<AutoUpdate>();
|
auto autoUpdater = DependencyManager::set<AutoUpdater>();
|
||||||
auto pathUtils = DependencyManager::set<PathUtils>();
|
auto pathUtils = DependencyManager::set<PathUtils>();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -624,8 +624,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
connect(ddeTracker.data(), &FaceTracker::muteToggled, this, &Application::faceTrackerMuteToggled);
|
connect(ddeTracker.data(), &FaceTracker::muteToggled, this, &Application::faceTrackerMuteToggled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto applicationUpdater = DependencyManager::get<AutoUpdate>();
|
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
||||||
connect(applicationUpdater.data(), &AutoUpdate::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
|
connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
|
||||||
applicationUpdater->checkForUpdate();
|
applicationUpdater->checkForUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include "UpdateDialog.h"
|
#include "UpdateDialog.h"
|
||||||
|
|
||||||
#include <AutoUpdate.h>
|
#include <AutoUpdater.h>
|
||||||
|
|
||||||
#include "DependencyManager.h"
|
#include "DependencyManager.h"
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ HIFI_QML_DEF(UpdateDialog)
|
||||||
UpdateDialog::UpdateDialog(QQuickItem* parent) :
|
UpdateDialog::UpdateDialog(QQuickItem* parent) :
|
||||||
OffscreenQmlDialog(parent)
|
OffscreenQmlDialog(parent)
|
||||||
{
|
{
|
||||||
auto applicationUpdater = DependencyManager::get<AutoUpdate>();
|
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
||||||
int currentVersion = QCoreApplication::applicationVersion().toInt();
|
int currentVersion = QCoreApplication::applicationVersion().toInt();
|
||||||
int latestVersion = applicationUpdater.data()->getBuildData().lastKey();
|
int latestVersion = applicationUpdater.data()->getBuildData().lastKey();
|
||||||
int versionsBehind = latestVersion - currentVersion;
|
int versionsBehind = latestVersion - currentVersion;
|
||||||
|
@ -46,6 +46,6 @@ void UpdateDialog::hide() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateDialog::triggerUpgrade() {
|
void UpdateDialog::triggerUpgrade() {
|
||||||
auto applicationUpdater = DependencyManager::get<AutoUpdate>();
|
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
||||||
applicationUpdater.data()->performAutoUpdate(applicationUpdater.data()->getBuildData().lastKey());
|
applicationUpdater.data()->performAutoUpdate(applicationUpdater.data()->getBuildData().lastKey());
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
set(TARGET_NAME auto-update)
|
set(TARGET_NAME auto-updater)
|
||||||
setup_hifi_library(Network)
|
setup_hifi_library(Network)
|
||||||
link_hifi_libraries(shared networking)
|
link_hifi_libraries(shared networking)
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// AutoUpdate.cpp
|
// AutoUpdater.cpp
|
||||||
// libraries/auto-update/src
|
// libraries/auto-update/src
|
||||||
//
|
//
|
||||||
// Created by Leonardo Murillo on 6/1/2015.
|
// Created by Leonardo Murillo on 6/1/2015.
|
||||||
|
@ -9,12 +9,12 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "AutoUpdate.h"
|
#include "AutoUpdater.h"
|
||||||
|
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
|
||||||
AutoUpdate::AutoUpdate() {
|
AutoUpdater::AutoUpdater() {
|
||||||
#if defined Q_OS_WIN32
|
#if defined Q_OS_WIN32
|
||||||
_operatingSystem = "windows";
|
_operatingSystem = "windows";
|
||||||
#elif defined Q_OS_MAC
|
#elif defined Q_OS_MAC
|
||||||
|
@ -26,19 +26,19 @@ AutoUpdate::AutoUpdate() {
|
||||||
connect(this, SIGNAL(latestVersionDataParsed()), this, SLOT(checkVersionAndNotify()));
|
connect(this, SIGNAL(latestVersionDataParsed()), this, SLOT(checkVersionAndNotify()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdate::checkForUpdate() {
|
void AutoUpdater::checkForUpdate() {
|
||||||
this->getLatestVersionData();
|
this->getLatestVersionData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdate::getLatestVersionData() {
|
void AutoUpdater::getLatestVersionData() {
|
||||||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
QNetworkRequest latestVersionRequest(BUILDS_XML_URL);
|
QNetworkRequest latestVersionRequest(BUILDS_XML_URL);
|
||||||
latestVersionRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
latestVersionRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
||||||
QNetworkReply* reply = networkAccessManager.get(latestVersionRequest);
|
QNetworkReply* reply = networkAccessManager.get(latestVersionRequest);
|
||||||
connect(reply, &QNetworkReply::finished, this, &AutoUpdate::parseLatestVersionData);
|
connect(reply, &QNetworkReply::finished, this, &AutoUpdater::parseLatestVersionData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdate::parseLatestVersionData() {
|
void AutoUpdater::parseLatestVersionData() {
|
||||||
QNetworkReply* sender = qobject_cast<QNetworkReply*>(QObject::sender());
|
QNetworkReply* sender = qobject_cast<QNetworkReply*>(QObject::sender());
|
||||||
|
|
||||||
QXmlStreamReader xml(sender);
|
QXmlStreamReader xml(sender);
|
||||||
|
@ -103,7 +103,7 @@ void AutoUpdate::parseLatestVersionData() {
|
||||||
emit latestVersionDataParsed();
|
emit latestVersionDataParsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdate::checkVersionAndNotify() {
|
void AutoUpdater::checkVersionAndNotify() {
|
||||||
int latestVersionAvailable = _builds.lastKey();
|
int latestVersionAvailable = _builds.lastKey();
|
||||||
if (QCoreApplication::applicationVersion() != "dev" &&
|
if (QCoreApplication::applicationVersion() != "dev" &&
|
||||||
QCoreApplication::applicationVersion().toInt() < latestVersionAvailable) {
|
QCoreApplication::applicationVersion().toInt() < latestVersionAvailable) {
|
||||||
|
@ -111,7 +111,7 @@ void AutoUpdate::checkVersionAndNotify() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdate::performAutoUpdate(int version) {
|
void AutoUpdater::performAutoUpdate(int version) {
|
||||||
// NOTE: This is not yet auto updating - however this is a checkpoint towards that end
|
// NOTE: This is not yet auto updating - however this is a checkpoint towards that end
|
||||||
// Next PR will handle the automatic download, upgrading and application restart
|
// Next PR will handle the automatic download, upgrading and application restart
|
||||||
const QMap<QString, QString>& chosenVersion = _builds.value(version);
|
const QMap<QString, QString>& chosenVersion = _builds.value(version);
|
||||||
|
@ -120,11 +120,11 @@ void AutoUpdate::performAutoUpdate(int version) {
|
||||||
QCoreApplication::quit();
|
QCoreApplication::quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdate::downloadUpdateVersion(int version) {
|
void AutoUpdater::downloadUpdateVersion(int version) {
|
||||||
emit newVersionIsDownloaded();
|
emit newVersionIsDownloaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoUpdate::appendBuildData(int versionNumber,
|
void AutoUpdater::appendBuildData(int versionNumber,
|
||||||
const QString& downloadURL,
|
const QString& downloadURL,
|
||||||
const QString& releaseTime,
|
const QString& releaseTime,
|
||||||
const QString& releaseNotes,
|
const QString& releaseNotes,
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// AutoUpdate.h
|
// AutoUpdater.h
|
||||||
// libraries/auto-update/src
|
// libraries/auto-update/src
|
||||||
//
|
//
|
||||||
// Created by Leonardo Murillo on 6/1/2015.
|
// Created by Leonardo Murillo on 6/1/2015.
|
||||||
|
@ -9,8 +9,8 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef hifi_AutoUpdate_h
|
#ifndef hifi_AutoUpdater_h
|
||||||
#define hifi_AutoUpdate_h
|
#define hifi_AutoUpdater_h
|
||||||
|
|
||||||
|
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
|
@ -31,12 +31,12 @@
|
||||||
|
|
||||||
const QUrl BUILDS_XML_URL("https://highfidelity.com/builds.xml");
|
const QUrl BUILDS_XML_URL("https://highfidelity.com/builds.xml");
|
||||||
|
|
||||||
class AutoUpdate : public QObject, public Dependency {
|
class AutoUpdater : public QObject, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
SINGLETON_DEPENDENCY
|
SINGLETON_DEPENDENCY
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AutoUpdate();
|
AutoUpdater();
|
||||||
|
|
||||||
void checkForUpdate();
|
void checkForUpdate();
|
||||||
const QMap<int, QMap<QString, QString>> &getBuildData() { return _builds; }
|
const QMap<int, QMap<QString, QString>> &getBuildData() { return _builds; }
|
||||||
|
@ -65,4 +65,4 @@ private slots:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _hifi_AutoUpdate_h
|
#endif // _hifi_AutoUpdater_h
|
Loading…
Reference in a new issue