dev: specify nightly tag through cmake instead of modes file (#6798)

This commit is contained in:
pajlada
2026-02-08 11:59:34 +01:00
committed by GitHub
parent f7aa5959c1
commit 43ac9c38db
11 changed files with 87 additions and 25 deletions
+1 -6
View File
@@ -22,12 +22,7 @@ Modes::Modes()
{
auto line = QString(file.readLine()).trimmed();
// we need to know if it is a nightly build to disable updates on windows
if (line == "nightly")
{
this->isNightly = true;
}
else if (line == "portable")
if (line == "portable")
{
this->isPortable = true;
}
-1
View File
@@ -13,7 +13,6 @@ public:
static const Modes &instance();
bool isNightly{};
bool isPortable{};
/// Marked by the line `externally-packaged`
+10 -7
View File
@@ -4,24 +4,22 @@
#include "common/Version.hpp"
#include "common/Literals.hpp"
#include "common/Modes.hpp"
#include <QFileInfo>
#include <QStringBuilder>
namespace chatterino {
using namespace Qt::StringLiterals;
using namespace literals;
namespace chatterino {
Version::Version()
: version_(CHATTERINO_VERSION)
, commitHash_(QStringLiteral(CHATTERINO_GIT_HASH))
, isModified_(CHATTERINO_GIT_MODIFIED == 1)
, dateOfBuild_(QStringLiteral(CHATTERINO_CMAKE_GEN_DATE))
, isNightly_(CHATTERINO_NIGHTLY_BUILD == 1)
{
this->fullVersion_ = "Chatterino ";
if (Modes::instance().isNightly)
if (this->isNightly())
{
this->fullVersion_ += "Nightly ";
}
@@ -129,6 +127,11 @@ const QString &Version::extraString() const
return this->extraString_;
}
bool Version::isNightly() const
{
return this->isNightly_;
}
void Version::generateBuildString()
{
// e.g. Chatterino 2.3.5 or Chatterino Nightly 2.3.5
@@ -151,7 +154,7 @@ void Version::generateBuildString()
s += " built";
// If the build is a nightly build (decided with modes atm), include build date information
if (Modes::instance().isNightly)
if (this->isNightly())
{
s += " on " + this->dateOfBuild();
}
+7
View File
@@ -63,6 +63,11 @@ public:
// Returns an extra string about this specific build
const QString &extraString() const;
/// Returns true if this build is classified as a "nightly" (i.e. dev or unstable) build.
///
/// This is controlled by the CMake parameter CHATTERINO_NIGHTLY_BUILD, which defaults to off.
bool isNightly() const;
#ifdef Q_OS_WIN
/// Chatterino's App ID on Windows
///
@@ -92,6 +97,8 @@ private:
// Generate an extra string (e.g. "Built for Fedora 42.<br>Report bugs <a href...>here</a>")
void generateExtraString();
bool isNightly_;
#ifdef Q_OS_WIN
std::wstring appUserModelID_;
#endif