From 160b96229e4b95d7c976773a3b163ab9bf4e73a5 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 31 Jul 2023 18:58:02 -0400 Subject: [PATCH] Add way to detect if Steam Deck in the UI --- launcher/include/launchercore.h | 2 ++ launcher/src/launchercore.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/launcher/include/launchercore.h b/launcher/include/launchercore.h index 1bc3ea3..fbab217 100755 --- a/launcher/include/launchercore.h +++ b/launcher/include/launchercore.h @@ -54,6 +54,7 @@ class LauncherCore : public QObject Q_PROPERTY(bool loadingFinished READ isLoadingFinished NOTIFY loadingFinished) Q_PROPERTY(bool hasAccount READ hasAccount NOTIFY accountChanged) Q_PROPERTY(bool isSteam READ isSteam CONSTANT) + Q_PROPERTY(bool isSteamDeck READ isSteamDeck CONSTANT) Q_PROPERTY(SquareBoot *squareBoot MEMBER squareBoot) Q_PROPERTY(ProfileManager *profileManager READ profileManager CONSTANT) Q_PROPERTY(AccountManager *accountManager READ accountManager CONSTANT) @@ -129,6 +130,7 @@ public: bool isLoadingFinished() const; bool hasAccount() const; bool isSteam() const; + bool isSteamDeck() const; Q_INVOKABLE void refreshNews(); Headline *headline(); diff --git a/launcher/src/launchercore.cpp b/launcher/src/launchercore.cpp index e3ec264..5849f0e 100755 --- a/launcher/src/launchercore.cpp +++ b/launcher/src/launchercore.cpp @@ -589,3 +589,8 @@ void LauncherCore::openConfigBackup(Profile *profile) auto configProcess = new QProcess(this); launchExecutable(*profile, configProcess, {profile->gamePath() + "/boot/ffxivconfig64.exe"}, false, false); } + +bool LauncherCore::isSteamDeck() const +{ + return steamApi->isDeck(); +}