Rename InSandbox to InFlatpak

This commit is contained in:
Ilya Fedin 2020-06-01 12:34:51 +04:00 committed by John Preston
parent 7f29f57c3d
commit 16c38b54e2
2 changed files with 9 additions and 9 deletions

View File

@ -240,9 +240,9 @@ void SetApplicationIcon(const QIcon &icon) {
QApplication::setWindowIcon(icon); QApplication::setWindowIcon(icon);
} }
bool InSandbox() { bool InFlatpak() {
static const auto Sandbox = QFileInfo::exists(qsl("/.flatpak-info")); static const auto Flatpak = QFileInfo::exists(qsl("/.flatpak-info"));
return Sandbox; return Flatpak;
} }
bool InSnap() { bool InSnap() {
@ -371,7 +371,7 @@ QString AppRuntimeDirectory() {
auto runtimeDir = QStandardPaths::writableLocation( auto runtimeDir = QStandardPaths::writableLocation(
QStandardPaths::RuntimeLocation); QStandardPaths::RuntimeLocation);
if (InSandbox()) { if (InFlatpak()) {
const auto flatpakId = [&] { const auto flatpakId = [&] {
if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) { if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) {
return QString::fromLatin1(qgetenv("FLATPAK_ID")); return QString::fromLatin1(qgetenv("FLATPAK_ID"));
@ -403,7 +403,7 @@ QString AppRuntimeDirectory() {
} }
QString SingleInstanceLocalServerName(const QString &hash) { QString SingleInstanceLocalServerName(const QString &hash) {
if (InSandbox() || InSnap()) { if (InFlatpak() || InSnap()) {
return AppRuntimeDirectory() + hash; return AppRuntimeDirectory() + hash;
} else { } else {
return AppRuntimeDirectory() + hash + '-' + cGUIDStr(); return AppRuntimeDirectory() + hash + '-' + cGUIDStr();
@ -463,7 +463,7 @@ QString GetLauncherFilename() {
} }
QString GetIconName() { QString GetIconName() {
static const auto IconName = InSandbox() static const auto IconName = InFlatpak()
? GetLauncherBasename() ? GetLauncherBasename()
: kIconName.utf16(); : kIconName.utf16();
return IconName; return IconName;
@ -659,7 +659,7 @@ void start() {
if(IsStaticBinary() if(IsStaticBinary()
|| InAppImage() || InAppImage()
|| InSandbox() || InFlatpak()
|| InSnap() || InSnap()
|| IsQtPluginsBundled()) { || IsQtPluginsBundled()) {
qputenv("QT_WAYLAND_DECORATION", "material"); qputenv("QT_WAYLAND_DECORATION", "material");
@ -802,7 +802,7 @@ void psAutoStart(bool start, bool silent) {
if (home.isEmpty() || cExeName().isEmpty()) if (home.isEmpty() || cExeName().isEmpty())
return; return;
if (InSandbox()) { if (InFlatpak()) {
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION #ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
SandboxAutostart(start, silent); SandboxAutostart(start, silent);
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION #endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION

View File

@ -20,7 +20,7 @@ namespace Platform {
inline void SetWatchingMediaKeys(bool watching) { inline void SetWatchingMediaKeys(bool watching) {
} }
bool InSandbox(); bool InFlatpak();
bool InSnap(); bool InSnap();
bool InAppImage(); bool InAppImage();
bool IsStaticBinary(); bool IsStaticBinary();