[graphics/krita/krita/5.2] libs/ui: Flesh out the isStoreApplication method
Halla Rempt
null at kde.org
Thu Jul 27 13:30:19 BST 2023
Git commit 48233527a035bb89e727218075ab6970f0284995 by Halla Rempt.
Committed on 27/07/2023 at 14:12.
Pushed by rempt into branch 'krita/5.2'.
Flesh out the isStoreApplication method
Note: the Steam/OSX combination isn't caught yet.
CCMAIL:kimageshop at kde.org
M +22 -0 libs/ui/KisApplication.cpp
https://invent.kde.org/graphics/krita/-/commit/48233527a035bb89e727218075ab6970f0284995
diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cpp
index e232d2c9e97..0b489608665 100644
--- a/libs/ui/KisApplication.cpp
+++ b/libs/ui/KisApplication.cpp
@@ -11,6 +11,7 @@
#ifdef Q_OS_WIN
#include <windows.h>
#include <tchar.h>
+#include "KisWindowsPackageUtils.h"
#endif
#ifdef Q_OS_MACOS
@@ -108,6 +109,7 @@
#include "kis_node_commands_adapter.h"
#include "KisSynchronizedConnection.h"
#include <QThreadStorage>
+#include <KisWindowsPackageUtils.h>
#include <kis_psd_layer_style.h>
@@ -810,6 +812,26 @@ void KisApplication::processPostponedSynchronizationEvents()
bool KisApplication::isStoreApplication()
{
+ if (qEnvironmentVariableIsSet("STEAMAPPID") || qEnvironmentVariableIsSet("SteamAppId")) {
+ return true;
+ }
+
+#ifdef Q_OS_WIN
+ // This is also true for user-installed MSIX, but that's
+ // likely only true in institutional situations, where
+ // we don't want to show the beggin banner either.
+ if (KisWindowsPackageUtils::isRunningInPackage()) {
+ return true;
+ }
+#endif
+
+#ifdef Q_OS_MACOS
+ KisMacosEntitlements entitlements;
+ if (entitlements.sandbox()) {
+ return true;
+ }
+#endif
+
return false;
}
More information about the kimageshop
mailing list