mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Use qEnvironmentVariable where appropriate
This commit is contained in:
parent
513054a307
commit
4fde7852b1
3 changed files with 6 additions and 7 deletions
|
@ -203,10 +203,10 @@ void Sandbox::setupScreenScale() {
|
||||||
if (ratio > 1.) {
|
if (ratio > 1.) {
|
||||||
if (!Platform::IsMac() || (ratio != 2.)) {
|
if (!Platform::IsMac() || (ratio != 2.)) {
|
||||||
LOG(("Found non-trivial Device Pixel Ratio: %1").arg(ratio));
|
LOG(("Found non-trivial Device Pixel Ratio: %1").arg(ratio));
|
||||||
LOG(("Environmental variables: QT_DEVICE_PIXEL_RATIO='%1'").arg(QString::fromLatin1(qgetenv("QT_DEVICE_PIXEL_RATIO"))));
|
LOG(("Environmental variables: QT_DEVICE_PIXEL_RATIO='%1'").arg(qEnvironmentVariable("QT_DEVICE_PIXEL_RATIO")));
|
||||||
LOG(("Environmental variables: QT_SCALE_FACTOR='%1'").arg(QString::fromLatin1(qgetenv("QT_SCALE_FACTOR"))));
|
LOG(("Environmental variables: QT_SCALE_FACTOR='%1'").arg(qEnvironmentVariable("QT_SCALE_FACTOR")));
|
||||||
LOG(("Environmental variables: QT_AUTO_SCREEN_SCALE_FACTOR='%1'").arg(QString::fromLatin1(qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR"))));
|
LOG(("Environmental variables: QT_AUTO_SCREEN_SCALE_FACTOR='%1'").arg(qEnvironmentVariable("QT_AUTO_SCREEN_SCALE_FACTOR")));
|
||||||
LOG(("Environmental variables: QT_SCREEN_SCALE_FACTORS='%1'").arg(QString::fromLatin1(qgetenv("QT_SCREEN_SCALE_FACTORS"))));
|
LOG(("Environmental variables: QT_SCREEN_SCALE_FACTORS='%1'").arg(qEnvironmentVariable("QT_SCREEN_SCALE_FACTORS")));
|
||||||
}
|
}
|
||||||
style::SetDevicePixelRatio(int(ratio));
|
style::SetDevicePixelRatio(int(ratio));
|
||||||
cSetScreenScale(style::kScaleDefault);
|
cSetScreenScale(style::kScaleDefault);
|
||||||
|
|
|
@ -14,8 +14,7 @@ namespace DesktopEnvironment {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
QString GetEnv(const char *name) {
|
QString GetEnv(const char *name) {
|
||||||
auto result = getenv(name);
|
auto value = qEnvironmentVariable(name);
|
||||||
auto value = result ? QString::fromLatin1(result) : QString();
|
|
||||||
LOG(("Getting DE, %1: '%2'").arg(name).arg(value));
|
LOG(("Getting DE, %1: '%2'").arg(name).arg(value));
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,7 @@ QString EscapeShellInLauncher(const QString &content) {
|
||||||
QString FlatpakID() {
|
QString FlatpakID() {
|
||||||
static const auto Result = [] {
|
static const auto Result = [] {
|
||||||
if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) {
|
if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) {
|
||||||
return QString::fromLatin1(qgetenv("FLATPAK_ID"));
|
return qEnvironmentVariable("FLATPAK_ID");
|
||||||
} else {
|
} else {
|
||||||
return GetLauncherBasename();
|
return GetLauncherBasename();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue