Commit c0321ac3 authored by Christian Kandeler's avatar Christian Kandeler

Replace some Q_OS_* constructs with their HostOsInfo equivalents.

Change-Id: I023ba83f3dfc8ba51a6dda6236d0156358a2e592
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 6fb9e909
......@@ -38,6 +38,7 @@
#include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h>
#include <QCoreApplication>
......@@ -86,11 +87,11 @@ void SettingsPageWidget::setSettings(const ClearCaseSettings &s)
m_ui.diffWarningLabel->setVisible(false);
} else {
QString diffWarning = tr("In order to use External diff, 'diff' command needs to be accessible.");
#ifdef Q_OS_WIN
diffWarning.append(tr(" DiffUtils is available for free download "
"<a href=\"http://gnuwin32.sourceforge.net/packages/diffutils.htm\">here</a>. "
"Please extract it to a directory in your PATH."));
#endif
if (HostOsInfo::isWindowsHost()) {
diffWarning.append(tr(" DiffUtils is available for free download "
"<a href=\"http://gnuwin32.sourceforge.net/packages/diffutils.htm\">here</a>. "
"Please extract it to a directory in your PATH."));
}
m_ui.diffWarningLabel->setText(diffWarning);
m_ui.externalDiffRadioButton->setEnabled(false);
}
......
......@@ -32,6 +32,7 @@
#include "cmakeprojectmanager.h"
#include <coreplugin/icore.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h>
#include <utils/fancylineedit.h>
#include <projectexplorer/kitinformation.h>
......@@ -423,14 +424,12 @@ void CMakeRunPage::initializePage()
if (hasCodeBlocksGenerator && (cachedGenerator.isEmpty() || cachedGenerator == "NMake Makefiles"))
m_generatorComboBox->addItem(tr("NMake Generator (%1)").arg(k->displayName()), kitVariant);
} else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
#ifdef Q_OS_WIN
if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles")
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(k->displayName()), kitVariant);
#else
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
if (Utils::HostOsInfo::isWindowsHost()) {
if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles")
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(k->displayName()), kitVariant);
} else if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles") {
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant);
#endif
}
}
} else {
// Non windows
......@@ -465,14 +464,13 @@ void CMakeRunPage::runCMake()
QString generator = QLatin1String("-GCodeBlocks - Unix Makefiles");
if (tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS) {
if (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor)
#ifdef Q_OS_WIN
generator = QLatin1String("-GCodeBlocks - MinGW Makefiles");
#else
generator = QLatin1String("-GCodeBlocks - Unix Makefiles");
#endif
else
if (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
generator = Utils::HostOsInfo::isWindowsHost()
? QLatin1String("-GCodeBlocks - MinGW Makefiles")
: QLatin1String("-GCodeBlocks - Unix Makefiles");
} else {
generator = QLatin1String("-GCodeBlocks - NMake Makefiles");
}
}
Utils::Environment env = m_cmakeWizard->environment();
......
......@@ -622,11 +622,10 @@ static QString filterForQmakeFileDialog()
// work around QTBUG-7739 that prohibits filters that don't start with *
filter += QLatin1Char('*');
filter += commands.at(i);
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
// kde bug, we need at least one wildcard character
// see QTCREATORBUG-7771
filter += QLatin1Char('*');
#endif
if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost())
// kde bug, we need at least one wildcard character
// see QTCREATORBUG-7771
filter += QLatin1Char('*');
}
filter += QLatin1Char(')');
return filter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment