chore: factor out AUMID creation (#6321)

This commit is contained in:
nerix
2025-07-06 14:19:36 +02:00
committed by GitHub
parent 2581d7293e
commit f2d7e4d073
5 changed files with 31 additions and 3 deletions
+12
View File
@@ -36,6 +36,11 @@ Version::Version()
this->generateBuildString();
this->generateRunningString();
#ifdef Q_OS_WIN
// keep in sync with .CI/chatterino-installer.iss
this->appUserModelID_ = L"ChatterinoTeam.Chatterino";
#endif
}
const Version &Version::instance()
@@ -165,4 +170,11 @@ void Version::generateRunningString()
this->runningString_ = s;
}
#ifdef Q_OS_WIN
const std::wstring &Version::appUserModelID() const
{
return this->appUserModelID_;
}
#endif
} // namespace chatterino
+15
View File
@@ -2,6 +2,10 @@
#include <QString>
#ifdef Q_OS_WIN
# include <string>
#endif
namespace chatterino {
/**
@@ -52,6 +56,13 @@ public:
// Returns a string about the current running system
const QString &runningString() const;
#ifdef Q_OS_WIN
/// Chatterino's App ID on Windows
///
/// See https://learn.microsoft.com/en-us/windows/win32/shell/appids
const std::wstring &appUserModelID() const;
#endif
private:
Version();
@@ -69,6 +80,10 @@ private:
QString runningString_;
// Generate a running string (e.g. Running on Arch Linux, kernel 5.14.3) and store it in runningString_ for future use
void generateRunningString();
#ifdef Q_OS_WIN
std::wstring appUserModelID_;
#endif
};
}; // namespace chatterino