2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use qEnvironmentVariable where appropriate

This commit is contained in:
Ilya Fedin
2021-02-19 09:16:17 +04:00
committed by John Preston
parent 513054a307
commit 4fde7852b1
3 changed files with 6 additions and 7 deletions

View File

@@ -14,8 +14,7 @@ namespace DesktopEnvironment {
namespace {
QString GetEnv(const char *name) {
auto result = getenv(name);
auto value = result ? QString::fromLatin1(result) : QString();
auto value = qEnvironmentVariable(name);
LOG(("Getting DE, %1: '%2'").arg(name).arg(value));
return value;
}

View File

@@ -253,7 +253,7 @@ QString EscapeShellInLauncher(const QString &content) {
QString FlatpakID() {
static const auto Result = [] {
if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) {
return QString::fromLatin1(qgetenv("FLATPAK_ID"));
return qEnvironmentVariable("FLATPAK_ID");
} else {
return GetLauncherBasename();
}