Add versionSuffix function to Theme.

Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Camila Ayres 2024-06-26 20:18:41 +02:00
parent 07f31f7b36
commit 3f9bf0ab9c
No known key found for this signature in database
GPG key ID: 7A4A6121E88E2AD4
4 changed files with 8 additions and 2 deletions

View file

@ -99,7 +99,7 @@ QUrlQuery Updater::getQueryParams()
query.addQueryItem(QStringLiteral("buildArch"), QSysInfo::buildCpuArchitecture());
query.addQueryItem(QStringLiteral("currentArch"), QSysInfo::currentCpuArchitecture());
const auto suffix = QStringLiteral(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
const auto suffix = Theme::instance()->versionSuffix();
query.addQueryItem(QStringLiteral("versionsuffix"), suffix);
ConfigFile config;

View file

@ -686,7 +686,7 @@ int ConfigFile::updateSegment() const
QString ConfigFile::updateChannel() const
{
auto defaultUpdateChannel = QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
auto defaultUpdateChannel = Theme::instance()->versionSuffix();
QSettings settings(configFile(), QSettings::IniFormat);
const auto channel = settings.value(QLatin1String(updateChannelC), defaultUpdateChannel).toString();
if (!validUpdateChannels().contains(channel)) {

View file

@ -195,6 +195,11 @@ QString Theme::version() const
return MIRALL_VERSION_STRING;
}
QString Theme::versionSuffix() const
{
return QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
}
QString Theme::configFileName() const
{
return QStringLiteral(APPLICATION_CONFIG_NAME ".cfg");

View file

@ -196,6 +196,7 @@ public:
[[nodiscard]] QString statusHeaderText(SyncResult::Status) const;
[[nodiscard]] QString version() const;
[[nodiscard]] QString versionSuffix() const;
/**
* Characteristics: bool if more than one sync folder is allowed