[Companion] Centralize download URLs; URLs now based on build major.minor version macros; Remove AVR fw download URL; Make some QStrings cheaper.

This commit is contained in:
Max Paperno
2018-07-16 17:36:33 -04:00
parent 71c5132c57
commit df5722717a
5 changed files with 40 additions and 53 deletions
+1 -7
View File
@@ -24,12 +24,6 @@
#include "helpers.h"
#include "appdata.h"
const char * const OPENTX_SDCARD_DOWNLOAD_URL[] = {
"https://downloads.open-tx.org/2.2/release/sdcard/",
"https://downloads.open-tx.org/2.2/rc/sdcard/",
"https://downloads.open-tx.org/2.2/nightlies/sdcard/"
};
FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget * parent) :
QDialog(parent),
ui(new Ui::FirmwarePreferencesDialog)
@@ -69,7 +63,7 @@ void FirmwarePreferencesDialog::on_fw_dnld_clicked()
void FirmwarePreferencesDialog::on_sd_dnld_clicked()
{
QString url = OPENTX_SDCARD_DOWNLOAD_URL[g.boundedOpenTxBranch()];
QString url = g.openTxCurrentDownloadBranchUrl() % QStringLiteral("sdcard/");
QString fwType = g.profile[g.id()].fwType();
QStringList list = fwType.split("-");
QString firmware = QString("%1-%2").arg(list[0]).arg(list[1]);