Skip to content

Commit

Permalink
No longer try to concatenate defines
Browse files Browse the repository at this point in the history
Fixes: #8920
  • Loading branch information
TheOneRing committed Sep 23, 2021
1 parent 980d901 commit 97763ad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/8920
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Broken url in branded builds

We fixed a string issue with branded builds resulting in invalid urls.

https://github.com/owncloud/client/issues/8920
5 changes: 2 additions & 3 deletions src/gui/updater/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ QUrlQuery Updater::getQueryParams()
query.addQueryItem(QStringLiteral("buildArch"), QSysInfo::buildCpuArchitecture());
query.addQueryItem(QStringLiteral("currentArch"), QSysInfo::currentCpuArchitecture());

QString suffix = QStringLiteral(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
query.addQueryItem(QStringLiteral("versionsuffix"), suffix);
query.addQueryItem(QStringLiteral("versionsuffix"), MIRALL_VERSION_SUFFIX());

auto channel = ConfigFile().updateChannel();
if (channel != QLatin1String("stable")) {
Expand Down Expand Up @@ -165,7 +164,7 @@ qint64 Updater::Helper::stringVersionToInt(const QString &version)

QString Updater::clientVersion()
{
return QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_FULL));
return QStringLiteral("%1.%2.%3").arg(QString::number(MIRALL_VERSION_MAJOR), QString::number(MIRALL_VERSION_MINOR), QString::number(MIRALL_VERSION_PATCH));
}

} // namespace OCC
2 changes: 1 addition & 1 deletion src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ void ConfigFile::setSkipUpdateCheck(bool skip, const QString &connection)
QString ConfigFile::updateChannel() const
{
QString defaultUpdateChannel = QStringLiteral("stable");
QString suffix = QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION_SUFFIX));
const QString suffix = MIRALL_VERSION_SUFFIX();
if (suffix.startsWith(QLatin1String("daily"))
|| suffix.startsWith(QLatin1String("nightly"))
|| suffix.startsWith(QLatin1String("alpha"))
Expand Down
10 changes: 5 additions & 5 deletions version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
#ifndef VERSION_H
#define VERSION_H

#include <QString>
// TODO: use namespace and functions
#cmakedefine GIT_SHA1 "@GIT_SHA1@"

#define MIRALL_STRINGIFY(...) MIRALL_TOSTRING(__VA_ARGS__)
#define MIRALL_TOSTRING(...) "" #__VA_ARGS__

/* MIRALL version */
#define MIRALL_VERSION_MAJOR @MIRALL_VERSION_MAJOR@
#define MIRALL_VERSION_MINOR @MIRALL_VERSION_MINOR@
#define MIRALL_VERSION_PATCH @MIRALL_VERSION_PATCH@
#define MIRALL_VERSION_BUILD @MIRALL_VERSION_BUILD@

#define MIRALL_VERSION_SUFFIX @MIRALL_VERSION_SUFFIX@
inline auto MIRALL_VERSION_SUFFIX() {
return QStringLiteral("@MIRALL_VERSION_SUFFIX@");
}

#define MIRALL_VERSION @MIRALL_VERSION@
#define MIRALL_VERSION_FULL @MIRALL_VERSION_FULL@

#define MIRALL_VERSION_STRING "@MIRALL_VERSION_STRING@"

Expand Down

0 comments on commit 97763ad

Please sign in to comment.