Don't access static functions via Utils::HostOsInfo instance

Change-Id: Ic45b8f324cb7c6a4691545fc8d668eed69dfeced
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Alessandro Portale
2020-11-18 18:42:27 +01:00
parent 30aec82285
commit 871c8e3ffd
5 changed files with 12 additions and 12 deletions

View File

@@ -91,10 +91,10 @@ GeneralSettingsWidget::GeneralSettingsWidget(GeneralSettings *q)
m_ui.showShortcutsInContextMenus->setVisible(false);
#endif
if (Utils::HostOsInfo().isMacHost()) {
if (Utils::HostOsInfo::isMacHost()) {
m_ui.dpiCheckbox->setVisible(false);
} else {
const bool defaultValue = Utils::HostOsInfo().isWindowsHost();
const bool defaultValue = Utils::HostOsInfo::isWindowsHost();
m_ui.dpiCheckbox->setChecked(ICore::settings()->value(settingsKeyDPI, defaultValue).toBool());
connect(m_ui.dpiCheckbox, &QCheckBox::toggled, this, [](bool checked) {
ICore::settings()->setValue(settingsKeyDPI, checked);

View File

@@ -68,18 +68,18 @@ struct Data
static QStringList libraryNameFilter()
{
if (HostOsInfo().isWindowsHost())
if (HostOsInfo::isWindowsHost())
return {"*.dll"};
if (HostOsInfo().isLinuxHost())
if (HostOsInfo::isLinuxHost())
return {"*.so"};
return {"*.dylib"};
}
static bool hasLibSuffix(const FilePath &path)
{
return (HostOsInfo().isWindowsHost() && path.endsWith(".dll"))
|| (HostOsInfo().isLinuxHost() && path.toFileInfo().completeSuffix().startsWith(".so"))
|| (HostOsInfo().isMacHost() && path.endsWith(".dylib"));
return (HostOsInfo::isWindowsHost() && path.endsWith(".dll"))
|| (HostOsInfo::isLinuxHost() && path.toFileInfo().completeSuffix().startsWith(".so"))
|| (HostOsInfo::isMacHost() && path.endsWith(".dylib"));
}
static FilePath pluginInstallPath(bool installIntoApplication)

View File

@@ -615,7 +615,7 @@ static void setKitEnvironment(Kit *k, const McuTarget *mcuTarget,
processPackage(package);
processPackage(qtForMCUsSdkPackage);
const QString path = QLatin1String(HostOsInfo().isWindowsHost() ? "Path" : "PATH");
const QString path = QLatin1String(HostOsInfo::isWindowsHost() ? "Path" : "PATH");
pathAdditions.append("${" + path + "}");
pathAdditions.append(QDir::toNativeSeparators(Core::ICore::libexecPath() + "/clang/bin"));
changes.append({path, pathAdditions.join(HostOsInfo::pathListSeparator())});

View File

@@ -81,7 +81,7 @@ PropertyEditorView::PropertyEditorView(QWidget *parent) :
{
m_qmlDir = PropertyEditorQmlBackend::propertyEditorResourcesPath();
if (Utils::HostOsInfo().isMacHost())
if (Utils::HostOsInfo::isMacHost())
m_updateShortcut = new QShortcut(QKeySequence(Qt::ALT + Qt::Key_F3), m_stackedWidget);
else
m_updateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F3), m_stackedWidget);