[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    =?utf-8?q?=5Bgraphics/krita/krita/5=2E2=5D_libs/ui=3A_Flesh_out_the_isStoreApplication_method?=
From:       Halla Rempt <null () kde ! org>
Date:       2023-07-27 12:30:19
Message-ID: 20230727123019.AC4221400585 () lerwini ! kde ! org
[Download RAW message or body]

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@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;
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic