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:
@@ -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;
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user