Skip to content

Commit

Permalink
feat(About): Show update available in nightly builds.
Browse files Browse the repository at this point in the history
When users run nightly builds, we still want to tell them when their
nightly build has become older than the newest production release.
  • Loading branch information
iphydf committed Jan 20, 2025
1 parent a8ca17e commit 9266c91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/net/updatecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ struct Version
int patch;
};

QDebug& operator<<(QDebug& stream, const Version& version)
{
stream.noquote()
<< QStringLiteral("v%1.%2.%3").arg(version.major).arg(version.minor).arg(version.patch);
return stream.quote();
}

Version tagToVersion(const QString& tagName)
{
// capture tag name to avoid showing update available on dev builds which include hash as part of describe
Expand Down Expand Up @@ -150,17 +157,16 @@ void UpdateCheck::handleResponse(QNetworkReply* reply)
qWarning() << "Currently running an untested/unstable version of qTox";
emit versionIsUnstable();
reply->deleteLater();
return;
}

const auto currentVer = tagToVersion(VersionInfo::gitDescribe());
const auto availableVer = tagToVersion(latestVersion);

if (isUpdateAvailable(currentVer, availableVer)) {
qInfo() << "Update available to version" << latestVersion;
qInfo() << "Update available from version" << currentVer << "to" << availableVer;
emit updateAvailable(latestVersion, link);
} else {
qInfo() << "qTox is up to date";
qInfo() << "qTox is up to date:" << currentVer;
emit upToDate();
}

Expand Down
1 change: 0 additions & 1 deletion src/widget/form/settings/aboutform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ void AboutForm::reloadTheme()

void AboutForm::onUnstableVersion()
{
bodyUI->updateStack->hide();
bodyUI->unstableVersion->setVisible(true);
}

Expand Down

0 comments on commit 9266c91

Please sign in to comment.