From 5d9a623a33d4ddfc30011be8117434599ec7064f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 22 Feb 2018 08:03:03 +0100 Subject: [PATCH 01/20] Bump version Change-Id: I4ea26ca1bfeedc2b57c9ffcae855035c47189935 Reviewed-by: Eike Ziller --- qbs/modules/qtc/qtc.qbs | 4 ++-- qtcreator.pri | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 54578cc0f7e..36aded329db 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,10 +4,10 @@ import qbs.FileInfo import "qtc.js" as HelperFunctions Module { - property string qtcreator_display_version: '4.5.1' + property string qtcreator_display_version: '4.5.2' property string ide_version_major: '4' property string ide_version_minor: '5' - property string ide_version_release: '1' + property string ide_version_release: '2' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release diff --git a/qtcreator.pri b/qtcreator.pri index 318dd489d20..bc266b0b3c1 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -1,10 +1,10 @@ !isEmpty(QTCREATOR_PRI_INCLUDED):error("qtcreator.pri already included") QTCREATOR_PRI_INCLUDED = 1 -QTCREATOR_VERSION = 4.5.1 +QTCREATOR_VERSION = 4.5.2 QTCREATOR_COMPAT_VERSION = 4.5.0 VERSION = $$QTCREATOR_VERSION -QTCREATOR_DISPLAY_VERSION = 4.5.1 +QTCREATOR_DISPLAY_VERSION = 4.5.2 QTCREATOR_COPYRIGHT_YEAR = 2018 BINARY_ARTIFACTS_BRANCH = master From 4adf04c79fec078e5d8b3806a5f8e6a2c9c30eb1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 21 Feb 2018 17:11:16 +0100 Subject: [PATCH 02/20] Work around Qt issue that setting 1.0 on opacity effect hides widget Issue in Qt 5.9.4 & 5.10.1. This should be reverted the moment that is fixed. Task-number: QTCREATORBUG-19716 Change-Id: I9ae187a43d0054f162491308d30b9a5b96465ec4 Reviewed-by: Alessandro Portale --- src/libs/utils/detailswidget.cpp | 6 +++--- src/plugins/coreplugin/progressmanager/progressmanager.cpp | 6 +++--- src/plugins/projectexplorer/buildstepspage.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libs/utils/detailswidget.cpp b/src/libs/utils/detailswidget.cpp index ff03150af4d..e0e4139f1d1 100644 --- a/src/libs/utils/detailswidget.cpp +++ b/src/libs/utils/detailswidget.cpp @@ -189,9 +189,9 @@ void DetailsWidgetPrivate::changeHoverState(bool hovered) if (!m_toolWidget) return; if (HostOsInfo::isMacHost()) - m_toolWidget->setOpacity(hovered ? 1.0 : 0); + m_toolWidget->setOpacity(hovered ? .999 : 0); else - m_toolWidget->fadeTo(hovered ? 1.0 : 0); + m_toolWidget->fadeTo(hovered ? .999 : 0); m_hovered = hovered; } @@ -387,7 +387,7 @@ void DetailsWidget::setToolWidget(FadingPanel *widget) d->m_grid->addWidget(d->m_toolWidget, 0, 1, 1, 1, Qt::AlignRight); if (HostOsInfo::isMacHost()) - d->m_toolWidget->setOpacity(1.0); + d->m_toolWidget->setOpacity(.999); d->changeHoverState(d->m_hovered); } diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index e583aa0c791..108899bc765 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -273,7 +273,7 @@ ProgressManagerPrivate::ProgressManagerPrivate() m_progressViewPinned(false), m_hovered(false) { - m_opacityEffect->setOpacity(1); + m_opacityEffect->setOpacity(.999); m_instance = this; m_progressView = new ProgressView; // withDelay, so the statusBarWidget has the chance to get the enter event @@ -543,7 +543,7 @@ void ProgressManagerPrivate::stopFadeOfSummaryProgress() { if (m_opacityAnimation) { m_opacityAnimation->stop(); - m_opacityEffect->setOpacity(1.); + m_opacityEffect->setOpacity(.999); delete m_opacityAnimation; } } @@ -689,7 +689,7 @@ void ProgressManagerPrivate::updateStatusDetailsWidget() void ProgressManagerPrivate::summaryProgressFinishedFading() { m_summaryProgressWidget->setVisible(false); - m_opacityEffect->setOpacity(1.); + m_opacityEffect->setOpacity(.999); } void ProgressManagerPrivate::progressDetailsToggled(bool checked) diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 64610a7b3ec..7e17db63e13 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -136,9 +136,9 @@ void ToolWidget::setBuildStepEnabled(bool b) m_firstWidget->fadeTo(m_targetOpacity); } else { if (HostOsInfo::isMacHost()) - m_firstWidget->setOpacity(1.0); + m_firstWidget->setOpacity(.999); else - m_firstWidget->fadeTo(1.0); + m_firstWidget->fadeTo(.999); } m_disableButton->setChecked(!b); } From 16d1561794c0b022c0c848f537e10685295bdc8e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 21 Feb 2018 16:20:05 +0100 Subject: [PATCH 03/20] Improve detection of toolchain and debugger for desktop kits In the situation where a cross-compilation tool chain has the same ABI as the host. Prefer toolchains and debuggers in PATH if the ABI matches. This is just a short-term hack. It is not fail-safe, because either both tool chains could be found somewhere in the PATH, or the "right" desktop tool chain could not be in PATH, but manually added. Anyhow, in many default setups this should improve the result. (In case of failure the user can still change the kit manually.) A better long term solution would be to make our ABI settings more flexible. Change-Id: I6ec5aaf45ef0b983cd949895dacdd5190f786219 Reviewed-by: hjk Reviewed-by: Tobias Hunger --- src/plugins/debugger/debuggeritem.h | 2 +- .../debugger/debuggerkitinformation.cpp | 9 +++++++- .../qmakekitinformation.cpp | 22 ++++++++++++++----- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index 5526c52130a..7dbdf5949dd 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -88,7 +88,7 @@ public: void setAbis(const QList &abis); void setAbi(const ProjectExplorer::Abi &abi); - enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesWell, MatchesPerfectly }; + enum MatchLevel { DoesNotMatch, MatchesSomewhat, MatchesWell, MatchesPerfectly, MatchesPerfectlyInPath }; MatchLevel matchTarget(const ProjectExplorer::Abi &targetAbi) const; QStringList abiNames() const; diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index d5ab9d0aae1..21360c000a1 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -101,13 +101,20 @@ void DebuggerKitInformation::setup(Kit *k) DebuggerItem bestItem; DebuggerItem::MatchLevel bestLevel = DebuggerItem::DoesNotMatch; - + const Environment systemEnvironment = Environment::systemEnvironment(); foreach (const DebuggerItem &item, DebuggerItemManager::debuggers()) { DebuggerItem::MatchLevel level = DebuggerItem::DoesNotMatch; if (rawId.isNull()) { // Initial setup of a kit. level = item.matchTarget(tcAbi); + // Hack to prefer a debugger from PATH (e.g. autodetected) over other matches. + // This improves the situation a bit if a cross-compilation tool chain has the + // same ABI as the host. + if (level == DebuggerItem::MatchesPerfectly + && systemEnvironment.path().contains(item.command().parentDir().toString())) { + level = DebuggerItem::MatchesPerfectlyInPath; + } } else if (rawId.type() == QVariant::String) { // New structure. if (item.id() == rawId) { diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index 57550e2e52f..5e1244768a1 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -92,11 +92,23 @@ void QmakeKitInformation::setup(Kit *k) && version->qtAbis().contains(t->targetAbi()); }); if (!possibleTcs.isEmpty()) { - ToolChain *possibleTc - = Utils::findOr(possibleTcs, possibleTcs.last(), - [&spec](const ToolChain *t) { return t->suggestedMkspecList().contains(spec); }); - if (possibleTc) - ToolChainKitInformation::setAllToolChainsToMatch(k, possibleTc); + const QList goodTcs = Utils::filtered(possibleTcs, + [&spec](const ToolChain *t) { + return t->suggestedMkspecList().contains(spec); + }); + // Hack to prefer a tool chain from PATH (e.g. autodetected) over other matches. + // This improves the situation a bit if a cross-compilation tool chain has the + // same ABI as the host. + const Environment systemEnvironment = Environment::systemEnvironment(); + ToolChain *bestTc = Utils::findOrDefault(goodTcs, + [&systemEnvironment](const ToolChain *t) { + return systemEnvironment.path().contains(t->compilerCommand().parentDir().toString()); + }); + if (!bestTc) { + bestTc = goodTcs.isEmpty() ? possibleTcs.last() : goodTcs.last(); + } + if (bestTc) + ToolChainKitInformation::setAllToolChainsToMatch(k, bestTc); } } } From 30638df441515901c6d43b2c67a5ca4a53eaf814 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 22 Feb 2018 10:42:13 +0100 Subject: [PATCH 04/20] QmlProject: Resolve import paths relative to target directory On desktop the target directory is the same as the source directory. On remote devices, it can be different. We need to resolve when we know where to deploy. Change-Id: I3f2bc088476ae73dac5231cb24f277c055f7d044 Task-number: QTCREATORBUG-19888 Reviewed-by: Tim Jenssen Reviewed-by: Tobias Hunger --- .../fileformat/qmlprojectitem.cpp | 13 ----------- .../fileformat/qmlprojectitem.h | 3 +-- .../qmlprojectrunconfiguration.cpp | 23 +++++++++++++++---- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp index b462bf48b86..426db64df12 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp @@ -47,8 +47,6 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath) this, &QmlProjectItem::qmlFilesChanged); } } - - setImportPaths(m_importPaths); } void QmlProjectItem::setTargetDirectory(const QString &directoryPath) @@ -60,17 +58,6 @@ void QmlProjectItem::setImportPaths(const QStringList &importPaths) { if (m_importPaths != importPaths) m_importPaths = importPaths; - - // convert to absolute paths - QStringList absoluteImportPaths; - const QDir sourceDir(sourceDirectory()); - foreach (const QString &importPath, importPaths) - absoluteImportPaths += QDir::cleanPath(sourceDir.absoluteFilePath(importPath)); - - if (m_absoluteImportPaths == absoluteImportPaths) - return; - - m_absoluteImportPaths = absoluteImportPaths; } /* Returns list of absolute paths */ diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h index e3c65e7ef13..2fcbe5de40c 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h @@ -51,7 +51,7 @@ public: QString targetDirectory() const { return m_targetDirectory; } void setTargetDirectory(const QString &directoryPath); - QStringList importPaths() const { return m_absoluteImportPaths; } + QStringList importPaths() const { return m_importPaths; } void setImportPaths(const QStringList &paths); QStringList files() const; @@ -72,7 +72,6 @@ protected: QString m_sourceDirectory; QString m_targetDirectory; QStringList m_importPaths; - QStringList m_absoluteImportPaths; QString m_mainFile; QList m_environment; QList m_content; // content property diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 11afeee224d..6015d19f9ee 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -121,22 +121,35 @@ QString QmlProjectRunConfiguration::executable() const return qmlscene.isEmpty() ? QString("qmlscene") : qmlscene; } +static QStringList makeAbsolute(const Utils::FileName &path, const QStringList &relativePaths) +{ + if (path.isEmpty()) + return relativePaths; + + const QDir baseDir(path.toString()); + return Utils::transform(relativePaths, [&baseDir](const QString &path) { + return QDir::cleanPath(baseDir.absoluteFilePath(path)); + }); +} + QString QmlProjectRunConfiguration::commandLineArguments() const { // arguments in .user file QString args = m_qmlViewerArgs; - const IDevice::ConstPtr device = DeviceKitInformation::device(target()->kit()); + const Target *currentTarget = target(); + const IDevice::ConstPtr device = DeviceKitInformation::device(currentTarget->kit()); const Utils::OsType osType = device ? device->osType() : Utils::HostOsInfo::hostOs(); // arguments from .qmlproject file - QmlProject *project = static_cast(target()->project()); - foreach (const QString &importPath, project->customImportPaths()) { + const QmlProject *project = static_cast(currentTarget->project()); + foreach (const QString &importPath, + makeAbsolute(project->targetDirectory(currentTarget), project->customImportPaths())) { Utils::QtcProcess::addArg(&args, QLatin1String("-I"), osType); Utils::QtcProcess::addArg(&args, importPath, osType); } - const QString main - = project->targetFile(Utils::FileName::fromString(mainScript()), target()).toString(); ; + const QString main = project->targetFile(Utils::FileName::fromString(mainScript()), + currentTarget).toString(); if (!main.isEmpty()) Utils::QtcProcess::addArg(&args, main, osType); return args; From 8235ed457cb9cbe8a19bef79d6d920d24307a3ba Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Thu, 22 Feb 2018 16:53:34 +0100 Subject: [PATCH 05/20] Move the nullptr check before the first access of the model Change-Id: I2dc972379cac571aafedaa27cf659076d5e46126 Reviewed-by: Tim Jenssen --- .../components/integration/designdocumentview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/integration/designdocumentview.cpp b/src/plugins/qmldesigner/components/integration/designdocumentview.cpp index 89d27cd5f0e..c30a392cef0 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentview.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocumentview.cpp @@ -170,17 +170,17 @@ Model *DesignDocumentView::pasteToModel() { Model *parentModel = currentModel(); - QTC_ASSERT(parentModel, return 0); + QTC_ASSERT(parentModel, return nullptr); Model *pasteModel(Model::create("empty", 1, 0, parentModel)); - pasteModel->setFileUrl(parentModel->fileUrl()); - pasteModel->changeImports(parentModel->imports(), {}); - Q_ASSERT(pasteModel); if (!pasteModel) - return 0; + return nullptr; + + pasteModel->setFileUrl(parentModel->fileUrl()); + pasteModel->changeImports(parentModel->imports(), {}); DesignDocumentView view; pasteModel->attachView(&view); From f60641f3d3d6da91dcba8cbe2c531d529bfcbc47 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 23 Feb 2018 13:34:03 +0100 Subject: [PATCH 06/20] AutoTest: Fix wrong handling of gtest output Task-number: QTCREATORBUG-19912 Change-Id: I23b47fb6ac2e54f0b9980da8c68c41d3ce7d9511 Reviewed-by: David Schulz --- src/plugins/autotest/gtest/gtestoutputreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/autotest/gtest/gtestoutputreader.cpp b/src/plugins/autotest/gtest/gtestoutputreader.cpp index cc82bccc1aa..d3d915d96f2 100644 --- a/src/plugins/autotest/gtest/gtestoutputreader.cpp +++ b/src/plugins/autotest/gtest/gtestoutputreader.cpp @@ -65,7 +65,7 @@ void GTestOutputReader::processOutput(const QByteArray &outputLine) static QRegExp testEnds("^\\[-{10}\\] \\d+ tests? from (.*) \\((.*)\\)$"); static QRegExp newTestSetStarts("^\\[ RUN \\] (.*)$"); static QRegExp testSetSuccess("^\\[ OK \\] (.*) \\((.*)\\)$"); - static QRegExp testSetFail("^\\[ FAILED \\] (.*) \\((.*)\\)$"); + static QRegExp testSetFail("^\\[ FAILED \\] (.*) \\((\\d+ ms)\\)$"); static QRegExp disabledTests("^ YOU HAVE (\\d+) DISABLED TESTS?$"); static QRegExp failureLocation("^(.*):(\\d+): Failure$"); static QRegExp errorLocation("^(.*)\\((\\d+)\\): error:.*$"); From 0474216e2ffa72cc67fe17964466b967de1c5be9 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 26 Feb 2018 14:26:07 +0100 Subject: [PATCH 07/20] QmlProject: Fix import paths for code model This fixes a regression introduced by 30638df441515901c6d43b2c67a5ca4a53eaf814. Custom import paths have to be absolute for the code model. Change-Id: I232229fa58c3900fe684ca4529b2ed08bf93e8be Reviewed-by: Tim Jenssen Reviewed-by: Ulf Hermann --- src/plugins/qmlprojectmanager/qmlproject.cpp | 13 ++++++++++++- src/plugins/qmlprojectmanager/qmlproject.h | 1 + .../qmlprojectrunconfiguration.cpp | 13 +------------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 471ef4a13b5..26e5060b0fb 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -177,7 +177,7 @@ void QmlProject::refresh(RefreshOptions options) QmlJS::ModelManagerInterface::ProjectInfo projectInfo = modelManager->defaultProjectInfoForProject(this); - foreach (const QString &searchPath, customImportPaths()) + foreach (const QString &searchPath, makeAbsolute(canonicalProjectDir(), customImportPaths())) projectInfo.importPaths.maybeInsert(Utils::FileName::fromString(searchPath), QmlJS::Dialect::Qml); @@ -249,6 +249,17 @@ void QmlProject::refreshProjectFile() refresh(QmlProject::ProjectFile | Files); } +QStringList QmlProject::makeAbsolute(const Utils::FileName &path, const QStringList &relativePaths) +{ + if (path.isEmpty()) + return relativePaths; + + const QDir baseDir(path.toString()); + return Utils::transform(relativePaths, [&baseDir](const QString &path) { + return QDir::cleanPath(baseDir.absoluteFilePath(path)); + }); +} + void QmlProject::refreshFiles(const QSet &/*added*/, const QSet &removed) { refresh(Files); diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index 4ecd7b226e6..1728aad36fa 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -75,6 +75,7 @@ public: void refreshProjectFile(); + static QStringList makeAbsolute(const Utils::FileName &path, const QStringList &relativePaths); protected: RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; bool setupTarget(ProjectExplorer::Target *t) override; diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 6015d19f9ee..9e8df4546f8 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -121,17 +121,6 @@ QString QmlProjectRunConfiguration::executable() const return qmlscene.isEmpty() ? QString("qmlscene") : qmlscene; } -static QStringList makeAbsolute(const Utils::FileName &path, const QStringList &relativePaths) -{ - if (path.isEmpty()) - return relativePaths; - - const QDir baseDir(path.toString()); - return Utils::transform(relativePaths, [&baseDir](const QString &path) { - return QDir::cleanPath(baseDir.absoluteFilePath(path)); - }); -} - QString QmlProjectRunConfiguration::commandLineArguments() const { // arguments in .user file @@ -143,7 +132,7 @@ QString QmlProjectRunConfiguration::commandLineArguments() const // arguments from .qmlproject file const QmlProject *project = static_cast(currentTarget->project()); foreach (const QString &importPath, - makeAbsolute(project->targetDirectory(currentTarget), project->customImportPaths())) { + QmlProject::makeAbsolute(project->targetDirectory(currentTarget), project->customImportPaths())) { Utils::QtcProcess::addArg(&args, QLatin1String("-I"), osType); Utils::QtcProcess::addArg(&args, importPath, osType); } From 2acb365dac0b2fc20993a0244466f8abb0ff2221 Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Tue, 27 Feb 2018 13:13:51 +0100 Subject: [PATCH 08/20] qmljs: relax checks for qbs files Types information for qbs is more limited that qml; this causes qtcreator to raise false positives. This patch relax the checks and provide some type information needed by qbs files generated by the wizards. Task-number: QTCREATORBUG-19757 Change-Id: I07a1dd9d8fedaf4c5c751c2f00643f15ae39127a Reviewed-by: Christian Kandeler --- .../qml-type-descriptions/qbs-base.qmltypes | 154 ++++++++++++++++++ src/libs/qmljs/qmljscheck.cpp | 4 + src/libs/qmljs/qmljslink.cpp | 9 + 3 files changed, 167 insertions(+) create mode 100644 share/qtcreator/qml-type-descriptions/qbs-base.qmltypes diff --git a/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes b/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes new file mode 100644 index 00000000000..e19fabc4d92 --- /dev/null +++ b/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes @@ -0,0 +1,154 @@ +import QtQuick.tooling 1.0 + +Module { + Component { + name: "AndroidApk" + exports: ["qbs/AndroidApk 1.0"] + prototype: "Product" + Property { name: "packageName"; type: "string"} + Property { name: "automaticSources"; type: "bool"} + Property { name: "legacyLayout"; type: "bool"} + Property { name: "sourceSetDir"; type: "string"} + Property { name: "resourceDir"; type: "string"} + Property { name: "assetsDir"; type: "string"} + Property { name: "sourcesDir"; type: "string"} + Property { name: "manifestFile"; type: "string"} + Property { name: "defaultManifestFile"; type: "string"; isReadonly: true } + } + Component { + name: "AppleApplicationDiskImage" + exports: ["qbs/AppleApplicationDiskImage 1.0"] + prototype: "AppleDiskImage" + Property { name: "sourceBase"; type: "string" } + Property { name: "absoluteSourceBase"; type: "string"; isReadonly: true} + Property { name: "symlinks"; type: "string"; isList: true } + Property { name: "stageDirectory"; type: "string"; isReadonly: true} + + } + Component { + name: "AppleDiskImage" + exports: ["qbs/AppleDiskImage 1.0"] + prototype: "Product" + } + Component { + name: "ApplicationExtension" + exports: ["qbs/ApplicationExtension 1.0"] + prototype: "XPCService" + Property: { name: "_useLegacyExtensionLibraries"; type: "bool" } + Property: { name: "extensionAttributes"; type: "QVariant" } + Property: { name: "extensionPointIdentifier"; type: "string" } + Property: { name: "extensionPrincipalClass"; type: "string" } + } + Component { + name: "Application" + exports: ["qbs/Application 1.0"] + prototype: "NativeBinary" + } + Component { + name: "AutotestRunner" + exports: ["qbs/AutotestRunner 1.0"] + prototype: "Product" + } + Component { + name: "CppApplication" + exports: ["qbs/CppApplication 1.0"] + prototype: "Application" + } + Component { + name: "DynamicLibrary" + exports: ["qbs/DynamicLibrary 1.0"] + prototype: "Library" + } + Component { + name: "InnoSetup" + exports: ["qbs/InnoSetup 1.0"] + prototype: "Installer" + } + Component { + name: "Installer" + exports: ["qbs/Installer 1.0"] + prototype: "Product" + Property: { name: "dependsOnInstallables"; type: "bool" } + Property: { name: "auxiliaryInputs"; type: "string"; isList: true } + } + Component { + name: "InstallPackage" + exports: ["qbs/InstallPackage 1.0"] + prototype: "Product" + } + Component { + name: "JavaClassCollection" + exports: ["qbs/InstallPackage 1.0"] + prototype: "Product" + } + Component { + name: "JavaJarFile" + exports: ["qbs/JavaJarFile 1.0"] + prototype: "Product" + Property { name: "entryPoint"; type: "string" } + } + Component { + name: "Library" + exports: ["qbs/Library 1.0"] + prototype: "NativeBinary" + } + Component { + name: "LoadableModule" + exports: ["qbs/LoadableModule 1.0"] + prototype: "DynamicLibrary" + } + Component { + name: "NativeBinary" + exports: ["qbs/NativeBinary 1.0"] + prototype: "Product" + Property { name: "isForAndroid"; type: "bool" } + Property { name: "isForDarwin"; type: "bool" } + } + Component { + name: "NetModule" + exports: ["qbs/NetModule 1.0"] + prototype: "Product" + } + Component { + name: "NodeJSApplication" + exports: ["qbs/NodeJSApplication 1.0"] + prototype: "Product" + } + Component { + name: "NSISSetup" + exports: ["qbs/NSISSetup 1.0"] + prototype: "Installer" + } + Component { + name: "QtApplication" + exports: ["qbs/QtApplication 1.0"] + prototype: "CppApplication" + } + Component { + name: "QtGuiApplication" + exports: ["qbs/QtGuiApplication 1.0"] + prototype: "CppApplication" + Property { name: "linkDefaultQpaPlugin"; type: "bool" } + } + Component { + name: "StaticLibrary" + exports: ["qbs/StaticLibrary 1.0"] + prototype: "Library" + } + Component { + name: "WindowsInstallerPackage" + exports: ["qbs/WindowsInstallerPackage 1.0"] + prototype: "Installer" + } + Component { + name: "WindowsSetupPackage" + exports: ["qbs/WindowsSetupPackage 1.0"] + prototype: "Product" + } + Component { + name: "XPCService" + exports: ["qbs/XPCService 1.0"] + prototype: "Application" + Property { name: "xpcServiceType"; type: "string" } + } +} diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 42558f65a4a..5b184d37b0b 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -855,6 +855,10 @@ static bool checkTopLevelBindingForParentReference(ExpressionStatement *expStmt, void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId, UiObjectInitializer *initializer) { + // TODO: currently Qbs checks are not working properly + if (_doc->language() == Dialect::QmlQbs) + return; + // Don't do type checks if it's a grouped property binding. // For instance: anchors { ... } if (_doc->bind()->isGroupedPropertyBinding(ast)) { diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index 61cdcd15d22..9c7855c5fdb 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -392,6 +392,15 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf import.object->setPrototype(valueOwner->cppQmlTypes().objectByCppName(moduleApi.cppName)); } + // TODO: at the moment there is not any types information on Qbs imports. + // Just check that tha the import is listed in the Qbs bundle. + if (doc->language() == Dialect::QmlQbs) { + QmlBundle qbs = ModelManagerInterface::instance() + ->activeBundles().bundleForLanguage(Dialect::QmlQbs); + if (qbs.supportedImports().contains(importInfo.name())) + importFound = true; + } + if (!importFound && importInfo.ast()) { import.valid = false; error(doc, locationFromRange(importInfo.ast()->firstSourceLocation(), From 27723c361bb14ff7126081ff798947f08b7322ee Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 27 Feb 2018 15:50:29 +0100 Subject: [PATCH 09/20] Debugger: Avoid inconsistent state when killing LLDB Avoid having a useless debugger if LLDB gets killed from outside QC. Shut down the debugger engine instead. Task-number: QTCREATORBUG-18723 Change-Id: I92f9b61c559ac43f1fc74af88861f35ca462f71f Reviewed-by: Alexandru Croitor Reviewed-by: hjk --- src/plugins/debugger/lldb/lldbengine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 80f2fd411c5..9cd2e4db0a9 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -743,6 +743,8 @@ void LldbEngine::handleLldbError(QProcess::ProcessError error) showMessage(QString("LLDB PROCESS ERROR: %1").arg(error)); switch (error) { case QProcess::Crashed: + m_lldbProc.disconnect(); + notifyEngineShutdownFinished(); break; // will get a processExited() as well // impossible case QProcess::FailedToStart: case QProcess::ReadError: From 2c89829de4136303cfa5ea510fd1ad05e4e8fd42 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 19 Feb 2018 19:03:44 +0100 Subject: [PATCH 10/20] Squish: Update suite_WELP Change-Id: Icc3169a8af007fb1d42aa44acfd97b02e0d01220 Reviewed-by: Christian Stenger --- tests/system/suite_WELP/tst_WELP01/test.py | 2 +- tests/system/suite_WELP/tst_WELP04/test.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index 700ccdcd8c8..d4d2d25bde7 100755 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -158,7 +158,7 @@ def main(): for (qType, prop, info) in expect: test.verify(checkIfObjectExists(search % (qType, prop)), "Verifying whether %s is shown" % info) - checkTableViewForContent(search % (expect[0][0], expect[0][1]), "Creating.*", "Tutorials", + checkTableViewForContent(search % (expect[0][0], expect[0][1]), "Help: Create .*", "Tutorials", "Verifying that at least one tutorial is displayed.") # exit Qt Creator invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_WELP/tst_WELP04/test.py b/tests/system/suite_WELP/tst_WELP04/test.py index 3d1bff2f7f2..18659f22622 100644 --- a/tests/system/suite_WELP/tst_WELP04/test.py +++ b/tests/system/suite_WELP/tst_WELP04/test.py @@ -53,7 +53,7 @@ def main(): tutorial = findExampleOrTutorial(tableView, ".*", True) test.verify(tutorial is None, "Verifying: 'Tutorials' topic is opened and nothing is shown.") - bnr = "Building and Running an Example Application" + bnr = "Help: Build and Run Examples" replaceEditorContent(searchTutorials, bnr.lower()) waitFor('findExampleOrTutorial(tableView, "%s.*") is not None' % bnr, 3000) tutorial = findExampleOrTutorial(tableView, "%s.*" % bnr, True) @@ -68,8 +68,8 @@ def main(): # check a demonstration video link mouseClick(searchTutorials) replaceEditorContent(searchTutorials, "embedded device") - waitFor('findExampleOrTutorial(tableView, "Qt for Device Creation.*") is not None', 3000) - tutorial = findExampleOrTutorial(tableView, "Qt for Device Creation.*", True) + waitFor('findExampleOrTutorial(tableView, "Online: Qt for Device Creation.*") is not None', 3000) + tutorial = findExampleOrTutorial(tableView, "Online: Qt for Device Creation.*", True) test.verify(tutorial is not None, "Verifying: Link to the expected demonstration video exists.") # exit Qt Creator From a0cb9919f32d8efa26fe3d3c13b8427859049dcc Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 28 Feb 2018 13:30:42 +0100 Subject: [PATCH 11/20] Highlighter: fix crash after context change Context changes might delete rules. Make sure to not dereference these deleted rules by: - save needed rule information before context change - untrack every rule in ProgressData that was deleted Task-number: QTCREATORBUG-19916 Change-Id: Icdbb739c1030bf918dbbe6c3a540a7c8893ce5a9 Reviewed-by: Christian Stenger --- .../generichighlighter/highlighter.cpp | 16 ++++++++++------ .../generichighlighter/progressdata.cpp | 5 +++++ .../texteditor/generichighlighter/progressdata.h | 1 + .../generichighlighter/specificrules.cpp | 8 ++++++++ .../generichighlighter/specificrules.h | 3 ++- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp index 2902f09a635..fd875eae28c 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.cpp +++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp @@ -372,29 +372,33 @@ void Highlighter::iterateThroughRules(const QString &text, progress->clearBracesMatches(); } + const QString itemData = rule->itemData(); + const QSharedPointer definition = rule->definition(); + const bool lookAhead = rule->isLookAhead(); if (progress->isWillContinueLine()) { createWillContinueBlock(); progress->setWillContinueLine(false); } else { if (rule->hasChildren()) iterateThroughRules(text, length, progress, true, rule->children()); - if (!rule->context().isEmpty() && contextChangeRequired(rule->context())) { m_currentCaptures = progress->captures(); - changeContext(rule->context(), rule->definition()); + changeContext(rule->context(), definition); contextChanged = true; } } + // Do NOT access rule frome here on, because a context change might delete rule + // Format is not applied to child rules directly (but relative to the offset of their // parent) nor to look ahead rules. - if (!childRule && !rule->isLookAhead()) { - if (rule->itemData().isEmpty()) + if (!childRule && !lookAhead) { + if (itemData.isEmpty()) applyFormat(startOffset, progress->offset() - startOffset, m_currentContext->itemData(), m_currentContext->definition()); else - applyFormat(startOffset, progress->offset() - startOffset, rule->itemData(), - rule->definition()); + applyFormat(startOffset, progress->offset() - startOffset, itemData, + definition); } // When there is a match of one child rule the others should be skipped. Otherwise diff --git a/src/plugins/texteditor/generichighlighter/progressdata.cpp b/src/plugins/texteditor/generichighlighter/progressdata.cpp index 6075a1a4e49..d79d5b01524 100644 --- a/src/plugins/texteditor/generichighlighter/progressdata.cpp +++ b/src/plugins/texteditor/generichighlighter/progressdata.cpp @@ -108,3 +108,8 @@ void ProgressData::trackRule(Rule *rule) { m_trackedRules.append(rule); } + +void ProgressData::unTrackRule(Rule *rule) +{ + m_trackedRules.removeAll(rule); +} diff --git a/src/plugins/texteditor/generichighlighter/progressdata.h b/src/plugins/texteditor/generichighlighter/progressdata.h index 9563a1601e2..d2b158146d5 100644 --- a/src/plugins/texteditor/generichighlighter/progressdata.h +++ b/src/plugins/texteditor/generichighlighter/progressdata.h @@ -65,6 +65,7 @@ public: const QStringList &captures() const; void trackRule(Rule *rule); + void unTrackRule(Rule *rule); private: int m_offset; diff --git a/src/plugins/texteditor/generichighlighter/specificrules.cpp b/src/plugins/texteditor/generichighlighter/specificrules.cpp index 02e5ed42303..8c4b80dc66c 100644 --- a/src/plugins/texteditor/generichighlighter/specificrules.cpp +++ b/src/plugins/texteditor/generichighlighter/specificrules.cpp @@ -172,6 +172,12 @@ bool StringDetectRule::doMatchSucceed(const QString &text, } // RegExpr +RegExprRule::~RegExprRule() +{ + if (m_progress) + m_progress->unTrackRule(this); +} + void RegExprRule::setPattern(const QString &pattern) { if (pattern.startsWith(QLatin1Char('^'))) @@ -194,6 +200,7 @@ void RegExprRule::doReplaceExpressions(const QStringList &captures) void RegExprRule::doProgressFinished() { + m_progress = nullptr; m_isCached = false; } @@ -234,6 +241,7 @@ bool RegExprRule::doMatchSucceed(const QString &text, return true; m_isCached = true; + m_progress = progress; progress->trackRule(this); return false; diff --git a/src/plugins/texteditor/generichighlighter/specificrules.h b/src/plugins/texteditor/generichighlighter/specificrules.h index 051ab81d26e..63beaf8df93 100644 --- a/src/plugins/texteditor/generichighlighter/specificrules.h +++ b/src/plugins/texteditor/generichighlighter/specificrules.h @@ -114,7 +114,7 @@ private: class RegExprRule : public DynamicRule { public: - virtual ~RegExprRule() {} + virtual ~RegExprRule(); void setPattern(const QString &pattern); void setInsensitive(const QString &insensitive); @@ -136,6 +136,7 @@ private: int m_length = 0; QStringList m_captures; QRegExp m_expression; + ProgressData *m_progress = nullptr; }; class KeywordRule : public Rule From 5489ac10d918a2e5527956489224100968fdb997 Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Wed, 28 Feb 2018 13:53:54 +0100 Subject: [PATCH 12/20] qmljs: fix syntax errors in qbs-base.qmltypes Change-Id: I0e8dc5a345f5a33a0f925f8a3dfe169c6d70e2a1 Reviewed-by: Christian Kandeler --- .../qml-type-descriptions/qbs-base.qmltypes | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes b/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes index e19fabc4d92..a25ea0807e0 100644 --- a/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes +++ b/share/qtcreator/qml-type-descriptions/qbs-base.qmltypes @@ -34,10 +34,10 @@ Module { name: "ApplicationExtension" exports: ["qbs/ApplicationExtension 1.0"] prototype: "XPCService" - Property: { name: "_useLegacyExtensionLibraries"; type: "bool" } - Property: { name: "extensionAttributes"; type: "QVariant" } - Property: { name: "extensionPointIdentifier"; type: "string" } - Property: { name: "extensionPrincipalClass"; type: "string" } + Property { name: "_useLegacyExtensionLibraries"; type: "bool" } + Property { name: "extensionAttributes"; type: "QVariant" } + Property { name: "extensionPointIdentifier"; type: "string" } + Property { name: "extensionPrincipalClass"; type: "string" } } Component { name: "Application" @@ -68,8 +68,8 @@ Module { name: "Installer" exports: ["qbs/Installer 1.0"] prototype: "Product" - Property: { name: "dependsOnInstallables"; type: "bool" } - Property: { name: "auxiliaryInputs"; type: "string"; isList: true } + Property { name: "dependsOnInstallables"; type: "bool" } + Property { name: "auxiliaryInputs"; type: "string"; isList: true } } Component { name: "InstallPackage" From bd6235a94f56fc909f0d3eb1bfdc18cd3148917b Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 28 Feb 2018 08:06:56 +0200 Subject: [PATCH 13/20] GenericHighlighter: Update definitions url Change-Id: I0411354aa89f08bde65c96a71ebc2e5deae34eae Reviewed-by: David Schulz --- src/plugins/texteditor/generichighlighter/manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/texteditor/generichighlighter/manager.cpp b/src/plugins/texteditor/generichighlighter/manager.cpp index 0cd730a1688..d6fdc002b21 100644 --- a/src/plugins/texteditor/generichighlighter/manager.cpp +++ b/src/plugins/texteditor/generichighlighter/manager.cpp @@ -394,7 +394,7 @@ QList Manager::parseAvailableDefinitionsList(QIODevice *d void Manager::downloadAvailableDefinitionsMetaData() { - QUrl url(QLatin1String("https://www.kate-editor.org/syntax/update-5.35.xml")); + QUrl url(QLatin1String("https://www.kate-editor.org/syntax/update-5.60.xml")); QNetworkRequest request(url); // Currently this takes a couple of seconds on Windows 7: QTBUG-10106. QNetworkReply *reply = Utils::NetworkAccessManager::instance()->get(request); From b9fcb30b9aef60d38d839b57a24479f20f92428f Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 28 Feb 2018 14:20:09 +0200 Subject: [PATCH 14/20] ProjectExplorer: Fix crash on debugger stop Blind shot. Task-number: QTCREATORBUG-19946 Change-Id: I629efaad836cf35a7694bafd8d288a6752560c44 Reviewed-by: hjk Reviewed-by: David Schulz --- src/plugins/projectexplorer/appoutputpane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index a5f1d35a753..d6644e12553 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -727,7 +727,7 @@ void AppOutputPane::slotRunControlFinished2(RunControl *sender) #ifdef Q_OS_WIN const bool isRunning = Utils::anyOf(m_runControlTabs, [](const RunControlTab &rt) { - return rt.runControl->isRunning(); + return rt.runControl && rt.runControl->isRunning(); }); if (!isRunning) WinDebugInterface::instance()->stop(); From 383d53ddbd274eaf97a41123f2754c9f72e7c3d5 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 28 Feb 2018 10:50:38 +0100 Subject: [PATCH 15/20] AutoTest: Fix debugging tests Some special characters need to get masked if passed on the commandline. Task-number: QTCREATORBUG-19943 Change-Id: Ib20ccb33ee9fbb50819d3386905df536c5193b3c Reviewed-by: David Schulz --- src/plugins/autotest/testrunner.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 828a9700c84..ff7968453e5 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -45,9 +45,10 @@ #include #include -#include -#include #include +#include +#include +#include #include #include @@ -468,7 +469,9 @@ void TestRunner::debugTests() QStringList omitted; ProjectExplorer::StandardRunnable inferior = config->runnable(); inferior.executable = commandFilePath; - inferior.commandLineArguments = config->argumentsForTestRunner(&omitted).join(' '); + + const QStringList args = config->argumentsForTestRunner(&omitted); + inferior.commandLineArguments = Utils::QtcProcess::joinArgs(args); if (!omitted.isEmpty()) { const QString &details = constructOmittedDetailsString(omitted); emit testResultReady(TestResultPtr(new FaultyTestResult(Result::MessageWarn, From 79e1a8a042c296c1938787e7bad6a05e67871662 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 28 Feb 2018 13:08:05 +0100 Subject: [PATCH 16/20] AutoTest: Correct enabled state of context menu items Permanently enable (De)Select All and allow triggering a rescan also if there is a build running. Task-number: QTCREATORBUG-19940 Change-Id: Ia0e8a5da135c3c59aba4ab179ae2970c25d470f3 Reviewed-by: David Schulz --- src/plugins/autotest/autotestplugin.cpp | 14 +++++++------- src/plugins/autotest/testnavigationwidget.cpp | 5 ----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index eb1079e4b53..ed81d60a28d 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -192,16 +192,16 @@ void AutotestPlugin::onRunSelectedTriggered() void AutotestPlugin::updateMenuItemsEnabledState() { - const bool enabled = !ProjectExplorer::BuildManager::isBuilding() - && !TestRunner::instance()->isTestRunning() - && TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle + const bool canScan = !TestRunner::instance()->isTestRunning() + && TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle; + const bool hasTests = TestTreeModel::instance()->hasTests(); + const bool canRun = hasTests && canScan && ProjectExplorer::ProjectExplorerPlugin::canRunStartupProject( ProjectExplorer::Constants::NORMAL_RUN_MODE); - const bool hasTests = TestTreeModel::instance()->hasTests(); - ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()->setEnabled(enabled && hasTests); - ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()->setEnabled(enabled && hasTests); - ActionManager::command(Constants::ACTION_SCAN_ID)->action()->setEnabled(enabled); + ActionManager::command(Constants::ACTION_RUN_ALL_ID)->action()->setEnabled(canRun); + ActionManager::command(Constants::ACTION_RUN_SELECTED_ID)->action()->setEnabled(canRun); + ActionManager::command(Constants::ACTION_SCAN_ID)->action()->setEnabled(canScan); } QList AutotestPlugin::createTestObjects() const diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp index a5cfd8f09d8..948af3af728 100644 --- a/src/plugins/autotest/testnavigationwidget.cpp +++ b/src/plugins/autotest/testnavigationwidget.cpp @@ -117,7 +117,6 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) const bool enabled = !ProjectExplorer::BuildManager::isBuilding() && !TestRunner::instance()->isTestRunning() && m_model->parser()->state() == TestCodeParser::Idle; - const bool hasTests = m_model->hasTests(); QMenu menu; QAction *runThisTest = nullptr; @@ -172,10 +171,6 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event) connect(selectAll, &QAction::triggered, m_view, &TestTreeView::selectAll); connect(deselectAll, &QAction::triggered, m_view, &TestTreeView::deselectAll); - selectAll->setEnabled(enabled && hasTests); - deselectAll->setEnabled(enabled && hasTests); - rescan->setEnabled(enabled); - if (runThisTest) { menu.addAction(runThisTest); menu.addAction(runWithoutDeploy); From 47355608dbbacc60bc0c60765ef54c427a8144cc Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 19 Feb 2018 13:50:49 +0100 Subject: [PATCH 17/20] Squish: Add workaround for opening qmlprojects Task-number: QTCREATORBUG-19717 Change-Id: I3e3b11785154d5c2c20b68ca0091510d1a77ae04 Reviewed-by: Christian Stenger --- tests/system/shared/workarounds.py | 11 ++++++++++- .../system/suite_debugger/tst_qml_js_console/test.py | 2 ++ tests/system/suite_debugger/tst_qml_locals/test.py | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index cb1cc0ba845..7ab37d44731 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -255,9 +255,18 @@ class JIRA: # for later lookup which function to call for which bug # ALWAYS update this dict when adding a new function for a workaround! def __initBugDict__(self): - self.__bugs__= {} + self.__bugs__= { + 'QTCREATORBUG-19717':self._workaroundCreator19717_, + } # helper function - will be called if no workaround for the requested bug is deposited def _exitFatal_(self, bugType, number): test.fatal("No workaround found for bug %s-%d" % (bugType, number)) ############### functions that hold workarounds ################################# + + def _workaroundCreator19717_(self, *args): + targetname = Targets.getStringForTarget(Targets.DESKTOP_5_3_1_DEFAULT) + switchViewTo(ViewConstants.PROJECTS) + mouseClick(waitForObjectItem(":Projects.ProjectNavigationTreeView", + "Build & Run." + targetname.replace(".", "\\."))) + switchViewTo(ViewConstants.EDIT) diff --git a/tests/system/suite_debugger/tst_qml_js_console/test.py b/tests/system/suite_debugger/tst_qml_js_console/test.py index 7187fc9ceaa..7c324b6970b 100644 --- a/tests/system/suite_debugger/tst_qml_js_console/test.py +++ b/tests/system/suite_debugger/tst_qml_js_console/test.py @@ -124,6 +124,8 @@ def main(): if not startedWithoutPluginError(): return + JIRA.performWorkaroundForBug(19717) + # if Debug is enabled - 1 valid kit is assigned - real check for this is done in tst_qml_locals fancyDebugButton = waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton") if test.verify(waitFor('fancyDebugButton.enabled', 5000), "Start Debugging is enabled."): diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py index fb6d45c649c..54be9f918a7 100644 --- a/tests/system/suite_debugger/tst_qml_locals/test.py +++ b/tests/system/suite_debugger/tst_qml_locals/test.py @@ -43,6 +43,7 @@ def main(): startApplication('qtcreator' + SettingsPath + ' "%s"' % qmlProjFile) if not startedWithoutPluginError(): return + JIRA.performWorkaroundForBug(19717) waitFor('object.exists(":Qt Creator_Utils::NavigationTreeView")', 10000) fancyConfButton = findObject(":*Qt Creator_Core::Internal::FancyToolButton") fancyRunButton = findObject(":*Qt Creator.Run_Core::Internal::FancyToolButton") From 8cece3226c080b621196ead1aff63a1615c9f373 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 26 Feb 2018 16:15:40 +0100 Subject: [PATCH 18/20] QmlDesigner: Fix crash in puppet The infinite recursion occurs because we call QFileInfo::exists() even if no change/fix is done, if a file in a resource if actually missing. If fileName != fixedPath the ":" prefix has been replaced by an absolute path and a new call to ::create will early reject. Typically the directories do not match, so nothing is replaced. This crashed without the fix. With the fix we will always remove the ":" prefix and therefore we do not try to handle the "fixed" case. Even, a broken path that contains multiple ":" we would only handle a finite number of times until all ":" are fixed. Change-Id: Ie13cedc1212bb58a16c61e0137128539d189269d Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp index 35c56d02d26..b437dda89f4 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp @@ -444,6 +444,9 @@ QAbstractFileEngine *QrcEngineHandler::create(const QString &fileName) const QString fixedPath = fileName; fixedPath.replace(":" + qrcDefintion.first(), qrcDefintion.last() + '/'); + if (fileName == fixedPath) + return nullptr; + if (QFileInfo::exists(fixedPath)) { fixedPath.replace("//", "/"); fixedPath.replace('\\', '/'); From 23781b3abc0862900e88445cf2fe0b523a6a82a6 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 1 Mar 2018 09:02:14 +0100 Subject: [PATCH 19/20] Debugger: Fix detection of gdb on older SUSE Broke with e8a8003b16. Change-Id: I0e9662bc8fb4115de0c63d07c82de78ef73004a5 Reviewed-by: hjk --- src/plugins/debugger/debuggerprotocol.cpp | 3 ++- tests/auto/debugger/tst_gdb.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 07f5e1658fe..b0d3e3787e5 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -438,7 +438,8 @@ void extractGdbVersion(const QString &msg, const QChar dot(QLatin1Char('.')); const bool ignoreParenthesisContent = msg.contains(QLatin1String("rubenvb")) - || msg.contains(QLatin1String("SUSE")); + || msg.contains(QLatin1String("openSUSE")) + || msg.contains(QLatin1String("SUSE Linux Enterprise")); const QChar parOpen(QLatin1Char('(')); const QChar parClose(QLatin1Char(')')); diff --git a/tests/auto/debugger/tst_gdb.cpp b/tests/auto/debugger/tst_gdb.cpp index 5b946a19366..1c1c6f73388 100644 --- a/tests/auto/debugger/tst_gdb.cpp +++ b/tests/auto/debugger/tst_gdb.cpp @@ -98,6 +98,10 @@ void tst_gdb::version_data() << "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4)" << 60891 << 20090930 << false << false; + QTest::newRow("SLES") + << "GNU gdb (GDB; SUSE Linux Enterprise 10) 7.9.1" + << 70901 << 0 << false << false; + QTest::newRow("Apple") << "GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2)" << 60350 << 1461 << true << false; From ecced3d3f199994b00e782fbc231e35842c181ba Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Mar 2018 13:57:04 +0100 Subject: [PATCH 20/20] fix ts-all target add forgotten $$. amends b795cc152c0. Change-Id: I39f9e2846bebaf88db98a1abf641f31dbe0025d4 Reviewed-by: David Schulz --- share/qtcreator/translations/translations.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/translations/translations.pro b/share/qtcreator/translations/translations.pro index 9a3e296dda3..0df9762fccd 100644 --- a/share/qtcreator/translations/translations.pro +++ b/share/qtcreator/translations/translations.pro @@ -87,7 +87,7 @@ for(file, files) { $$v = extract QMAKE_EXTRA_TARGETS += ts-$$lang } -ts-all.commands = cd $$wd && $$LUPDATE $$include_options $$sources $$MIME_TR_H $$CUSTOMWIZARD_TR_H $$JSONWIZARD_TR_H $$QMLWIZARD_TR_H $$QTQUICKWIZARD_TR_H $$EXTERNALTOOLS_TR_H SNIPPETS_TR_H -ts $$files +ts-all.commands = cd $$wd && $$LUPDATE $$include_options $$sources $$MIME_TR_H $$CUSTOMWIZARD_TR_H $$JSONWIZARD_TR_H $$QMLWIZARD_TR_H $$QTQUICKWIZARD_TR_H $$EXTERNALTOOLS_TR_H $$SNIPPETS_TR_H -ts $$files ts-all.depends = extract QMAKE_EXTRA_TARGETS += ts-all