Replace some Q_OS_* constructs with their HostOsInfo equivalents.

Change-Id: I023ba83f3dfc8ba51a6dda6236d0156358a2e592
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Christian Kandeler
2012-09-19 11:15:13 +02:00
parent 6fb9e90920
commit c0321ac305
3 changed files with 22 additions and 24 deletions

View File

@@ -38,6 +38,7 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <QCoreApplication> #include <QCoreApplication>
@@ -86,11 +87,11 @@ void SettingsPageWidget::setSettings(const ClearCaseSettings &s)
m_ui.diffWarningLabel->setVisible(false); m_ui.diffWarningLabel->setVisible(false);
} else { } else {
QString diffWarning = tr("In order to use External diff, 'diff' command needs to be accessible."); QString diffWarning = tr("In order to use External diff, 'diff' command needs to be accessible.");
#ifdef Q_OS_WIN if (HostOsInfo::isWindowsHost()) {
diffWarning.append(tr(" DiffUtils is available for free download " diffWarning.append(tr(" DiffUtils is available for free download "
"<a href=\"http://gnuwin32.sourceforge.net/packages/diffutils.htm\">here</a>. " "<a href=\"http://gnuwin32.sourceforge.net/packages/diffutils.htm\">here</a>. "
"Please extract it to a directory in your PATH.")); "Please extract it to a directory in your PATH."));
#endif }
m_ui.diffWarningLabel->setText(diffWarning); m_ui.diffWarningLabel->setText(diffWarning);
m_ui.externalDiffRadioButton->setEnabled(false); m_ui.externalDiffRadioButton->setEnabled(false);
} }

View File

@@ -32,6 +32,7 @@
#include "cmakeprojectmanager.h" #include "cmakeprojectmanager.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
#include <utils/fancylineedit.h> #include <utils/fancylineedit.h>
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
@@ -423,14 +424,12 @@ void CMakeRunPage::initializePage()
if (hasCodeBlocksGenerator && (cachedGenerator.isEmpty() || cachedGenerator == "NMake Makefiles")) if (hasCodeBlocksGenerator && (cachedGenerator.isEmpty() || cachedGenerator == "NMake Makefiles"))
m_generatorComboBox->addItem(tr("NMake Generator (%1)").arg(k->displayName()), kitVariant); m_generatorComboBox->addItem(tr("NMake Generator (%1)").arg(k->displayName()), kitVariant);
} else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) { } else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
#ifdef Q_OS_WIN if (Utils::HostOsInfo::isWindowsHost()) {
if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles") if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles")
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(k->displayName()), kitVariant); m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(k->displayName()), kitVariant);
#else } else if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles") {
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant); m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant);
#endif }
} }
} else { } else {
// Non windows // Non windows
@@ -465,15 +464,14 @@ void CMakeRunPage::runCMake()
QString generator = QLatin1String("-GCodeBlocks - Unix Makefiles"); QString generator = QLatin1String("-GCodeBlocks - Unix Makefiles");
if (tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS) { if (tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS) {
if (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) if (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
#ifdef Q_OS_WIN generator = Utils::HostOsInfo::isWindowsHost()
generator = QLatin1String("-GCodeBlocks - MinGW Makefiles"); ? QLatin1String("-GCodeBlocks - MinGW Makefiles")
#else : QLatin1String("-GCodeBlocks - Unix Makefiles");
generator = QLatin1String("-GCodeBlocks - Unix Makefiles"); } else {
#endif
else
generator = QLatin1String("-GCodeBlocks - NMake Makefiles"); generator = QLatin1String("-GCodeBlocks - NMake Makefiles");
} }
}
Utils::Environment env = m_cmakeWizard->environment(); Utils::Environment env = m_cmakeWizard->environment();
tc->addToEnvironment(env); tc->addToEnvironment(env);

View File

@@ -622,11 +622,10 @@ static QString filterForQmakeFileDialog()
// work around QTBUG-7739 that prohibits filters that don't start with * // work around QTBUG-7739 that prohibits filters that don't start with *
filter += QLatin1Char('*'); filter += QLatin1Char('*');
filter += commands.at(i); filter += commands.at(i);
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost())
// kde bug, we need at least one wildcard character // kde bug, we need at least one wildcard character
// see QTCREATORBUG-7771 // see QTCREATORBUG-7771
filter += QLatin1Char('*'); filter += QLatin1Char('*');
#endif
} }
filter += QLatin1Char(')'); filter += QLatin1Char(')');
return filter; return filter;