forked from qt-creator/qt-creator
Utils: Make some HostInfo functions constexpr
Enables the removal of static function scope variables. Change-Id: I337468c1525546a5cad9e95ae4a859de18ee514d Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -72,12 +72,12 @@ public:
|
||||
: OsSpecificAspects::fileNameCaseSensitivity(hostOs());
|
||||
}
|
||||
|
||||
static QChar pathListSeparator()
|
||||
static constexpr QChar pathListSeparator()
|
||||
{
|
||||
return OsSpecificAspects::pathListSeparator(hostOs());
|
||||
}
|
||||
|
||||
static Qt::KeyboardModifier controlModifier()
|
||||
static constexpr Qt::KeyboardModifier controlModifier()
|
||||
{
|
||||
return OsSpecificAspects::controlModifier(hostOs());
|
||||
}
|
||||
|
@@ -24,22 +24,22 @@ inline QString withExecutableSuffix(OsType osType, const QString &executable)
|
||||
return finalName;
|
||||
}
|
||||
|
||||
inline Qt::CaseSensitivity fileNameCaseSensitivity(OsType osType)
|
||||
constexpr Qt::CaseSensitivity fileNameCaseSensitivity(OsType osType)
|
||||
{
|
||||
return osType == OsTypeWindows || osType == OsTypeMac ? Qt::CaseInsensitive : Qt::CaseSensitive;
|
||||
}
|
||||
|
||||
inline Qt::CaseSensitivity envVarCaseSensitivity(OsType osType)
|
||||
constexpr Qt::CaseSensitivity envVarCaseSensitivity(OsType osType)
|
||||
{
|
||||
return fileNameCaseSensitivity(osType);
|
||||
}
|
||||
|
||||
inline QChar pathListSeparator(OsType osType)
|
||||
constexpr QChar pathListSeparator(OsType osType)
|
||||
{
|
||||
return QLatin1Char(osType == OsTypeWindows ? ';' : ':');
|
||||
}
|
||||
|
||||
inline Qt::KeyboardModifier controlModifier(OsType osType)
|
||||
constexpr Qt::KeyboardModifier controlModifier(OsType osType)
|
||||
{
|
||||
return osType == OsTypeMac ? Qt::MetaModifier : Qt::ControlModifier;
|
||||
}
|
||||
|
Reference in New Issue
Block a user