Commit b52b860c authored by Leander Schulten's avatar Leander Schulten
Browse files

call the checkForUpdate method after creating the QGuiApplication, otherwise...

call the checkForUpdate method after creating the QGuiApplication, otherwise the network is not ready
parent 537ad27f
Pipeline #144106 passed with stage
in 1 minute and 15 seconds
......@@ -52,7 +52,6 @@ int main(int argc, char *argv[])
QObject::connect(&updater,&Updater::needUpdate,[&](){
updater.update();
});
updater.checkForUpdate();
/*Test::TestModulSystem testModulSystem;
testModulSystem.runTest();
return 0;*/
......@@ -127,6 +126,9 @@ int main(int argc, char *argv[])
qRegisterMetaType<Driver::DMXQMLValue*>("DMXQMLValue*");
qRegisterMetaType<DMX::DMXChannelFilter*>("DMXChannelFilter*");
updater.checkForUpdate();
// Load Settings and ApplicationData
Settings::setLocalSettingFile(QFileInfo("settings.ini"));
Settings settings;
......
......@@ -74,6 +74,11 @@ void Updater::update(){
qDebug() << "Update";
state = UpdaterState::DownloadingUpdate;
auto redirect = http->get(QNetworkRequest(QUrl(deployDownloadURL)));
QObject::connect(redirect,static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),[this,redirect](auto error){
qWarning() << "Error while redirecting to deploy.zip! " << error << redirect->errorString();
redirect->deleteLater();
state = UpdaterState::DownloadUpdateFailed;
});
QObject::connect(redirect,&QNetworkReply::finished,[this,redirect](){
redirect->deleteLater();
auto redirectURL = redirect->header(QNetworkRequest::KnownHeaders::LocationHeader);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment