forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/4.10' into 4.11" into 4.11
This commit is contained in:
@@ -182,7 +182,6 @@ public:
|
||||
m_maximumActiveSize = QSize(maxWidth, activeHeight);
|
||||
|
||||
auto layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
layout->setContentsMargins(4, 0, 0, 0);
|
||||
layout->addWidget(m_titleLabel);
|
||||
|
@@ -105,6 +105,7 @@ void BoostCodeParser::handleIdentifier()
|
||||
} else if (identifier == "BOOST_TEST_CASE") {
|
||||
handleTestCase(TestCaseType::Functions);
|
||||
} else if (identifier == "BOOST_PARAM_TEST_CASE") {
|
||||
m_currentState.setFlag(BoostTestTreeItem::Parameterized);
|
||||
handleTestCase(TestCaseType::Parameter);
|
||||
} else if (identifier == "BOOST_AUTO_TEST_CASE") {
|
||||
handleTestCase(TestCaseType::Auto);
|
||||
@@ -203,8 +204,6 @@ void BoostCodeParser::handleTestCase(TestCaseType testCaseType)
|
||||
m_currentState = BoostTestTreeItem::Enabled;
|
||||
return;
|
||||
}
|
||||
if (testCaseType == TestCaseType::Parameter)
|
||||
m_currentState |= BoostTestTreeItem::Parameterized;
|
||||
} else if (m_currentState.testFlag(BoostTestTreeItem::Fixture)) {
|
||||
// ignore first parameter (fixture) and first comma
|
||||
if (!skipCommentsUntil(T_IDENTIFIER))
|
||||
|
@@ -238,6 +238,8 @@ QList<TestConfiguration *> BoostTestTreeItem::getSelectedTestConfigurations() co
|
||||
QString tcName = item->name();
|
||||
if (item->state().testFlag(BoostTestTreeItem::Templated))
|
||||
tcName.append("<*");
|
||||
else if (item->state().testFlag(BoostTestTreeItem::Parameterized))
|
||||
tcName.append('*');
|
||||
tcName = handleSpecialFunctionNames(tcName);
|
||||
testCasesForProjectFile[item->proFile()].testCases.append(
|
||||
item->prependWithParentsSuitePaths(tcName));
|
||||
@@ -275,6 +277,8 @@ TestConfiguration *BoostTestTreeItem::testConfiguration() const
|
||||
QString tcName = handleSpecialFunctionNames(boostItem->name());
|
||||
if (boostItem->type() == TestSuite) // execute everything below a suite
|
||||
tcName.append("/*");
|
||||
else if (boostItem->state().testFlag(BoostTestTreeItem::Parameterized))
|
||||
tcName.append('*');
|
||||
else if (boostItem->state().testFlag(BoostTestTreeItem::Templated))
|
||||
tcName.append("<*");
|
||||
testCases.append(boostItem->prependWithParentsSuitePaths(tcName));
|
||||
@@ -285,6 +289,8 @@ TestConfiguration *BoostTestTreeItem::testConfiguration() const
|
||||
QString tcName = name();
|
||||
if (state().testFlag(BoostTestTreeItem::Templated))
|
||||
tcName.append("<*");
|
||||
else if (state().testFlag(BoostTestTreeItem::Parameterized))
|
||||
tcName.append('*');
|
||||
testCases.append(prependWithParentsSuitePaths(handleSpecialFunctionNames(tcName)));
|
||||
}
|
||||
|
||||
|
@@ -169,31 +169,24 @@ public:
|
||||
// running, as this can be triggered by moving the breakpoint to
|
||||
// the next line that generated code.
|
||||
|
||||
m_gbp->m_params.lineNumber = lineNumber;
|
||||
m_gbp->updateMarker();
|
||||
m_gbp->update();
|
||||
m_gbp->updateLineNumber(lineNumber);
|
||||
}
|
||||
|
||||
void updateFileName(const FilePath &fileName) final
|
||||
{
|
||||
TextMark::updateFileName(fileName);
|
||||
QTC_ASSERT(m_gbp, return);
|
||||
m_gbp->m_params.fileName = fileName.toString();
|
||||
m_gbp->update();
|
||||
m_gbp->updateFileName(fileName);
|
||||
}
|
||||
|
||||
bool isDraggable() const final { return true; }
|
||||
|
||||
void dragToLine(int line) final
|
||||
{
|
||||
TextMark::move(line);
|
||||
QTC_ASSERT(m_gbp, return);
|
||||
QTC_ASSERT(BreakpointManager::globalBreakpoints().contains(m_gbp), return);
|
||||
BreakpointParameters params = m_gbp->m_params;
|
||||
params.lineNumber = line;
|
||||
GlobalBreakpoint gbp = m_gbp;
|
||||
m_gbp = GlobalBreakpoint();
|
||||
gbp->deleteBreakpoint();
|
||||
m_gbp = BreakpointManager::createBreakpoint(params);
|
||||
m_gbp->updateLineNumber(line);
|
||||
}
|
||||
|
||||
bool isClickable() const final { return true; }
|
||||
@@ -2273,6 +2266,23 @@ void GlobalBreakpointItem::removeBreakpointFromModel()
|
||||
theBreakpointManager->destroyItem(this);
|
||||
}
|
||||
|
||||
void GlobalBreakpointItem::updateLineNumber(int lineNumber)
|
||||
{
|
||||
if (m_params.lineNumber == lineNumber)
|
||||
return;
|
||||
m_params.lineNumber = lineNumber;
|
||||
update();
|
||||
}
|
||||
|
||||
void GlobalBreakpointItem::updateFileName(const FilePath &fileName)
|
||||
{
|
||||
const QString &file = fileName.toString();
|
||||
if (m_params.fileName == file)
|
||||
return;
|
||||
m_params.fileName = file;
|
||||
update();
|
||||
}
|
||||
|
||||
QString GlobalBreakpointItem::markerFileName() const
|
||||
{
|
||||
// Some heuristics to find a "good" file name.
|
||||
@@ -2308,11 +2318,14 @@ void GlobalBreakpointItem::updateMarker()
|
||||
|
||||
const FilePath file = FilePath::fromString(m_params.fileName);
|
||||
const int line = m_params.lineNumber;
|
||||
if (m_marker && (file != m_marker->fileName() || line != m_marker->lineNumber()))
|
||||
destroyMarker();
|
||||
|
||||
if (!m_marker && !file.isEmpty() && line > 0)
|
||||
if (m_marker) {
|
||||
if (file != m_marker->fileName())
|
||||
m_marker->updateFileName(file);
|
||||
if (line != m_marker->lineNumber())
|
||||
m_marker->move(line);
|
||||
} else if (!file.isEmpty() && line > 0) {
|
||||
m_marker = new GlobalBreakpointMarker(this, file, line);
|
||||
}
|
||||
|
||||
if (m_marker)
|
||||
m_marker->setToolTip(toolTip());
|
||||
|
@@ -93,7 +93,6 @@ private:
|
||||
friend class BreakHandler;
|
||||
friend class BreakpointManager;
|
||||
friend class BreakpointMarker;
|
||||
friend class GlobalBreakpointMarker;
|
||||
|
||||
void updateMarker();
|
||||
void updateMarkerIcon();
|
||||
|
@@ -776,39 +776,51 @@ void MsvcToolChain::updateEnvironmentModifications(Utils::EnvironmentItems modif
|
||||
|
||||
void MsvcToolChain::detectInstalledAbis()
|
||||
{
|
||||
if (!m_supportedAbis.isEmpty()) // Build Tools 2015
|
||||
return;
|
||||
static QMap<QString, Abis> abiCache;
|
||||
const QString vcVarsBase
|
||||
= QDir::fromNativeSeparators(m_vcvarsBat).left(m_vcvarsBat.lastIndexOf('/'));
|
||||
if (abiCache.contains(vcVarsBase)) {
|
||||
m_supportedAbis = abiCache.value(vcVarsBase);
|
||||
return;
|
||||
} else {
|
||||
// Clear previously detected m_supportedAbis to repopulate it.
|
||||
m_supportedAbis.clear();
|
||||
const Abi baseAbi = targetAbi();
|
||||
for (MsvcPlatform platform : platforms) {
|
||||
bool toolchainInstalled = false;
|
||||
QString perhapsVcVarsPath = vcVarsBase + QLatin1Char('/') + QLatin1String(platform.bat);
|
||||
const Platform p = platform.platform;
|
||||
if (QFileInfo(perhapsVcVarsPath).isFile()) {
|
||||
toolchainInstalled = true;
|
||||
} else {
|
||||
// MSVC 2015 and below had various versions of vcvars scripts in subfolders. Try these
|
||||
// as fallbacks.
|
||||
perhapsVcVarsPath = vcVarsBase + platform.prefix + QLatin1Char('/')
|
||||
+ QLatin1String(platform.bat);
|
||||
toolchainInstalled = QFileInfo(perhapsVcVarsPath).isFile();
|
||||
}
|
||||
if (hostSupportsPlatform(platform.platform) && toolchainInstalled) {
|
||||
Abi newAbi(archForPlatform(p),
|
||||
baseAbi.os(),
|
||||
baseAbi.osFlavor(),
|
||||
baseAbi.binaryFormat(),
|
||||
wordWidthForPlatform(p));
|
||||
if (!m_supportedAbis.contains(newAbi))
|
||||
m_supportedAbis.append(newAbi);
|
||||
}
|
||||
}
|
||||
|
||||
abiCache.insert(vcVarsBase, m_supportedAbis);
|
||||
}
|
||||
|
||||
QTC_ASSERT(m_supportedAbis.isEmpty(), return);
|
||||
const Abi baseAbi = targetAbi();
|
||||
for (MsvcPlatform platform : platforms) {
|
||||
bool toolchainInstalled = false;
|
||||
QString perhapsVcVarsPath = vcVarsBase + QLatin1Char('/') + QLatin1String(platform.bat);
|
||||
const Platform p = platform.platform;
|
||||
if (QFileInfo(perhapsVcVarsPath).isFile()) {
|
||||
toolchainInstalled = true;
|
||||
} else {
|
||||
// MSVC 2015 and below had various versions of vcvars scripts in subfolders. Try these
|
||||
// as fallbacks.
|
||||
perhapsVcVarsPath = vcVarsBase + platform.prefix + QLatin1Char('/')
|
||||
+ QLatin1String(platform.bat);
|
||||
toolchainInstalled = QFileInfo(perhapsVcVarsPath).isFile();
|
||||
}
|
||||
if (hostSupportsPlatform(platform.platform) && toolchainInstalled) {
|
||||
Abi newAbi(archForPlatform(p), baseAbi.os(), baseAbi.osFlavor(), baseAbi.binaryFormat(),
|
||||
wordWidthForPlatform(p));
|
||||
if (!m_supportedAbis.contains(newAbi))
|
||||
m_supportedAbis.append(newAbi);
|
||||
}
|
||||
}
|
||||
abiCache.insert(vcVarsBase, m_supportedAbis);
|
||||
// Always add targetAbi in supportedAbis if it is empty.
|
||||
// targetAbi is the abi with which the toolchain was detected.
|
||||
// This is necessary for toolchains that don't have vcvars32.bat and the like in their
|
||||
// vcVarsBase path, like msvc2010.
|
||||
// Also, don't include that one in abiCache to avoid polluting it with values specific
|
||||
// to one toolchain as the cache is global for a vcVarsBase path. For this reason, the
|
||||
// targetAbi needs to be added manually.
|
||||
if (m_supportedAbis.empty())
|
||||
m_supportedAbis.append(targetAbi());
|
||||
}
|
||||
|
||||
Utils::Environment MsvcToolChain::readEnvironmentSetting(const Utils::Environment &env) const
|
||||
@@ -1253,13 +1265,6 @@ void MsvcToolChain::resetVarsBat()
|
||||
m_varsBatArg.clear();
|
||||
}
|
||||
|
||||
void MsvcToolChain::setSupportedAbi(const Abi &abi)
|
||||
{
|
||||
// Hack for Build Tools 2015 only.
|
||||
QTC_CHECK(m_supportedAbis.isEmpty());
|
||||
m_supportedAbis = { abi };
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// MsvcBasedToolChainConfigWidget: Creates a simple GUI without error label
|
||||
// to display name and varsBat. Derived classes should add the error label and
|
||||
@@ -1864,7 +1869,6 @@ static void detectCppBuildTools2015(QList<ToolChain *> *list)
|
||||
tc->setDisplayName(name + QLatin1String(e.postFix));
|
||||
tc->setDetection(ToolChain::AutoDetection);
|
||||
tc->setLanguage(language);
|
||||
tc->setSupportedAbi(abi);
|
||||
list->append(tc);
|
||||
}
|
||||
}
|
||||
|
@@ -95,8 +95,6 @@ public:
|
||||
void setupVarsBat(const Abi &abi, const QString &varsBat, const QString &varsBatArg);
|
||||
void resetVarsBat();
|
||||
|
||||
void setSupportedAbi(const Abi &abi);
|
||||
|
||||
bool operator==(const ToolChain &) const override;
|
||||
|
||||
bool isJobCountSupported() const override { return false; }
|
||||
|
@@ -53,7 +53,6 @@
|
||||
#include <QHeaderView>
|
||||
#include <QLabel>
|
||||
#include <QMouseEvent>
|
||||
#include <QOpenGLWidget>
|
||||
#include <QPainter>
|
||||
#include <QScrollArea>
|
||||
#include <QStackedWidget>
|
||||
@@ -352,12 +351,6 @@ WelcomeMode::WelcomeMode()
|
||||
layout->addWidget(new StyledBar(m_modeWidget));
|
||||
layout->addItem(hbox);
|
||||
|
||||
if (Utils::HostOsInfo::isMacHost()) { // workaround QTBUG-61384
|
||||
auto openglWidget = new QOpenGLWidget;
|
||||
openglWidget->hide();
|
||||
layout->addWidget(openglWidget);
|
||||
}
|
||||
|
||||
setWidget(m_modeWidget);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user