chore: factor out AUMID creation (#6321)
This commit is contained in:
@@ -71,6 +71,7 @@
|
|||||||
- Dev: Emoji style / set is now stored lowercase (and matched case-insensitively). Changing emoji style from this point on and then running an old version might mean you will use the Twitter emoji style by default. (#6300)
|
- Dev: Emoji style / set is now stored lowercase (and matched case-insensitively). Changing emoji style from this point on and then running an old version might mean you will use the Twitter emoji style by default. (#6300)
|
||||||
- Dev: Refactored `OnceFlag`. (#6237, #6316)
|
- Dev: Refactored `OnceFlag`. (#6237, #6316)
|
||||||
- Dev: Bumped clang-format requirement to 19. (#6236)
|
- Dev: Bumped clang-format requirement to 19. (#6236)
|
||||||
|
- Dev: Factored out AUMID to `Version`. (#6321)
|
||||||
|
|
||||||
## 2.5.3
|
## 2.5.3
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ Version::Version()
|
|||||||
|
|
||||||
this->generateBuildString();
|
this->generateBuildString();
|
||||||
this->generateRunningString();
|
this->generateRunningString();
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// keep in sync with .CI/chatterino-installer.iss
|
||||||
|
this->appUserModelID_ = L"ChatterinoTeam.Chatterino";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const Version &Version::instance()
|
const Version &Version::instance()
|
||||||
@@ -165,4 +170,11 @@ void Version::generateRunningString()
|
|||||||
this->runningString_ = s;
|
this->runningString_ = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
const std::wstring &Version::appUserModelID() const
|
||||||
|
{
|
||||||
|
return this->appUserModelID_;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
# include <string>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,6 +56,13 @@ public:
|
|||||||
// Returns a string about the current running system
|
// Returns a string about the current running system
|
||||||
const QString &runningString() const;
|
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:
|
private:
|
||||||
Version();
|
Version();
|
||||||
|
|
||||||
@@ -69,6 +80,10 @@ private:
|
|||||||
QString runningString_;
|
QString runningString_;
|
||||||
// Generate a running string (e.g. Running on Arch Linux, kernel 5.14.3) and store it in runningString_ for future use
|
// Generate a running string (e.g. Running on Arch Linux, kernel 5.14.3) and store it in runningString_ for future use
|
||||||
void generateRunningString();
|
void generateRunningString();
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
std::wstring appUserModelID_;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace chatterino
|
}; // namespace chatterino
|
||||||
|
|||||||
+2
-1
@@ -40,7 +40,8 @@ int main(int argc, char **argv)
|
|||||||
QCoreApplication::setApplicationVersion(CHATTERINO_VERSION);
|
QCoreApplication::setApplicationVersion(CHATTERINO_VERSION);
|
||||||
QCoreApplication::setOrganizationDomain("chatterino.com");
|
QCoreApplication::setOrganizationDomain("chatterino.com");
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
SetCurrentProcessExplicitAppUserModelID(L"ChatterinoTeam.Chatterino");
|
SetCurrentProcessExplicitAppUserModelID(
|
||||||
|
Version::instance().appUserModelID().c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::unique_ptr<Paths> paths;
|
std::unique_ptr<Paths> paths;
|
||||||
|
|||||||
@@ -285,8 +285,7 @@ void Toasts::ensureInitialized()
|
|||||||
|
|
||||||
auto *instance = WinToast::instance();
|
auto *instance = WinToast::instance();
|
||||||
instance->setAppName(L"Chatterino");
|
instance->setAppName(L"Chatterino");
|
||||||
instance->setAppUserModelId(
|
instance->setAppUserModelId(Version::instance().appUserModelID());
|
||||||
WinToast::configureAUMI(L"ChatterinoTeam", L"Chatterino", L"", L""));
|
|
||||||
if (!getSettings()->createShortcutForToasts)
|
if (!getSettings()->createShortcutForToasts)
|
||||||
{
|
{
|
||||||
instance->setShortcutPolicy(WinToast::SHORTCUT_POLICY_IGNORE);
|
instance->setShortcutPolicy(WinToast::SHORTCUT_POLICY_IGNORE);
|
||||||
|
|||||||
Reference in New Issue
Block a user