forked from qt-creator/qt-creator
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:
@@ -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
|
||||
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."));
|
||||
#endif
|
||||
}
|
||||
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 (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")
|
||||
} else if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles") {
|
||||
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Non windows
|
||||
@@ -465,15 +464,14 @@ 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();
|
||||
tc->addToEnvironment(env);
|
||||
|
||||
@@ -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)
|
||||
if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost())
|
||||
// kde bug, we need at least one wildcard character
|
||||
// see QTCREATORBUG-7771
|
||||
filter += QLatin1Char('*');
|
||||
#endif
|
||||
}
|
||||
filter += QLatin1Char(')');
|
||||
return filter;
|
||||
|
||||
Reference in New Issue
Block a user