mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +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 (!Platform::IsMac() || (ratio != 2.)) {
|
||||
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_SCALE_FACTOR='%1'").arg(QString::fromLatin1(qgetenv("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_SCREEN_SCALE_FACTORS='%1'").arg(QString::fromLatin1(qgetenv("QT_SCREEN_SCALE_FACTORS"))));
|
||||
LOG(("Environmental variables: QT_DEVICE_PIXEL_RATIO='%1'").arg(qEnvironmentVariable("QT_DEVICE_PIXEL_RATIO")));
|
||||
LOG(("Environmental variables: QT_SCALE_FACTOR='%1'").arg(qEnvironmentVariable("QT_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(qEnvironmentVariable("QT_SCREEN_SCALE_FACTORS")));
|
||||
}
|
||||
style::SetDevicePixelRatio(int(ratio));
|
||||
cSetScreenScale(style::kScaleDefault);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue