Add release channels for autoupdater (#2362)

Fetch releases from github and find corresponding installers on bintray
This commit is contained in:
ctrlaltca 2017-03-01 09:43:09 +01:00 committed by GitHub
parent b9cd942308
commit 7373819c32
16 changed files with 507 additions and 237 deletions

View file

@ -1,4 +1,6 @@
#include "settingscache.h"
#include "releasechannel.h"
#include <QSettings>
#include <QFile>
#include <QDir>
@ -162,7 +164,13 @@ SettingsCache::SettingsCache()
if(!QFile(settingsPath+"global.ini").exists())
translateLegacySettings();
// updates - don't reorder them or their index in the settings won't match
releaseChannels << new StableReleaseChannel()
<< new DevReleaseChannel();
notifyAboutUpdates = settings->value("personal/updatenotification", true).toBool();
updateReleaseChannel = settings->value("personal/updatereleasechannel", 0).toInt();
lang = settings->value("personal/lang").toString();
keepalive = settings->value("personal/keepalive", 5).toInt();
@ -642,4 +650,10 @@ void SettingsCache::setNotifyAboutUpdate(int _notifyaboutupdate)
{
notifyAboutUpdates = _notifyaboutupdate;
settings->setValue("personal/updatenotification", notifyAboutUpdates);
}
}
void SettingsCache::setUpdateReleaseChannel(int _updateReleaseChannel)
{
updateReleaseChannel = _updateReleaseChannel;
settings->setValue("personal/updatereleasechannel", updateReleaseChannel);
}