1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
/*
* SPDX-FileCopyrightText: 2020 Jonah BrĂ¼chert <jbb@kaidan.im>
*
* SPDX-License-Identifier: LGPL-2.0-only
*/
#include <QByteArray>
#include <QString>
#include <QtGlobal>
#include "settingshelper.h"
inline bool parseQuickControlsMobile()
{
if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE")) {
const QByteArray str = qgetenv("QT_QUICK_CONTROLS_MOBILE");
return str == "1" || str == "true";
}
if (qEnvironmentVariable("XDG_CURRENT_DESKTOP").contains(QStringLiteral("Phosh"), Qt::CaseInsensitive)) {
return true;
}
return false;
}
bool SettingsHelper::isMobile()
{
static bool mobile = parseQuickControlsMobile();
return mobile;
}
|