From 36117336e7852eac5700454823823144d65ba420 Mon Sep 17 00:00:00 2001 From: Markus Goetz <markus@woboq.com> Date: Sat, 23 Sep 2017 13:48:48 +0200 Subject: [PATCH] Updater: Rudimentary support for beta channel So we can get people update from our alpha to the beta and rc --- src/gui/updater/updater.cpp | 12 ++++++++++++ version.h.in | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/gui/updater/updater.cpp b/src/gui/updater/updater.cpp index 8294bb4be..940f2026b 100644 --- a/src/gui/updater/updater.cpp +++ b/src/gui/updater/updater.cpp @@ -61,6 +61,18 @@ QUrl Updater::addQueryParams(const QUrl &url) paramUrl.addQueryItem(QLatin1String("version"), clientVersion()); paramUrl.addQueryItem(QLatin1String("platform"), platform); paramUrl.addQueryItem(QLatin1String("oem"), theme->appName()); + + QString suffix = QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX)); + paramUrl.addQueryItem(QLatin1String("versionsuffix"), suffix); + if (suffix.startsWith("nightly") + || suffix.startsWith("alpha") + || suffix.startsWith("rc") + || suffix.startsWith("beta")) { + paramUrl.addQueryItem(QLatin1String("channel"), "beta"); + // FIXME: Provide a checkbox in UI to enable regular versions to switch + // to beta channel + } + return paramUrl; } diff --git a/version.h.in b/version.h.in index 064309f52..e96ba1fe0 100644 --- a/version.h.in +++ b/version.h.in @@ -30,6 +30,8 @@ #define MIRALL_VERSION_PATCH @MIRALL_VERSION_PATCH@ #define MIRALL_VERSION_BUILD @MIRALL_VERSION_BUILD@ +#define MIRALL_VERSION_SUFFIX @MIRALL_VERSION_SUFFIX@ + #define MIRALL_VERSION @MIRALL_VERSION@ #define MIRALL_VERSION_FULL @MIRALL_VERSION_FULL@