Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(About): Show update available in nightly builds. #452

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading