From 12c74e6664bc910b40de7fb96a163d511711b7b1 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 20 Jan 2020 11:20:09 +0200 Subject: [PATCH 01/17] Handle Qt < 5.14.0 androiddeployqt settings file This file is needed by cmake projects. Fixes: QTCREATORBUG-23306 Change-Id: Ie0ffd325ca01ac5638620c258d5e8ed5bbd3259e Reviewed-by: Assam Boudjelthia Reviewed-by: Cristian Adam --- src/plugins/android/androidbuildapkstep.cpp | 81 ++++++++++++--------- src/plugins/android/androidbuildapkstep.h | 1 + src/plugins/android/androidmanager.cpp | 43 +++++++++-- src/plugins/android/androidmanager.h | 2 + 4 files changed, 85 insertions(+), 42 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index ccd9bec14d7..b2bb8849d35 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -221,11 +221,10 @@ bool AndroidBuildApkStep::init() QString outputDir = bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString(); - QString inputFile; if (node) - inputFile = node->data(Constants::AndroidDeploySettingsFile).toString(); + m_inputFile = node->data(Constants::AndroidDeploySettingsFile).toString(); - if (inputFile.isEmpty()) { + if (m_inputFile.isEmpty()) { m_skipBuilding = true; return true; } @@ -237,7 +236,7 @@ bool AndroidBuildApkStep::init() return false; } - QStringList arguments = {"--input", inputFile, + QStringList arguments = {"--input", m_inputFile, "--output", outputDir, "--android-platform", AndroidManager::buildTargetSDK(target()), "--jdk", AndroidConfigurations::currentConfig().openJDKLocation().toString()}; @@ -353,6 +352,8 @@ bool AndroidBuildApkStep::verifyCertificatePassword() static bool copyFileIfNewer(const QString &sourceFileName, const QString &destinationFileName) { + if (sourceFileName == destinationFileName) + return true; if (QFile::exists(destinationFileName)) { QFileInfo destinationFileInfo(destinationFileName); QFileInfo sourceFileInfo(sourceFileName); @@ -393,48 +394,56 @@ void AndroidBuildApkStep::doRun() if (!node) return false; - FilePath deploymentSettingsFile = FilePath::fromString(node->data(Android::Constants::AndroidDeploySettingsFile).toString()); - if (deploymentSettingsFile.exists()) - return true; // cmake creates this file for us + bool inputExists = QFile::exists(m_inputFile); + if (inputExists && !AndroidManager::isQtCreatorGenerated(FilePath::fromString(m_inputFile))) + return true; // use the generated file if it was not generated by qtcreator auto targets = node->data(Android::Constants::AndroidTargets).toStringList(); if (targets.isEmpty()) - return true; // qmake does this job for us + return inputExists; // qmake does this job for us + + + QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(target()->kit()); + if (!version) + return false; QJsonObject deploySettings = Android::AndroidManager::deploymentSettings(target()); - QJsonObject architectures; - - // Copy targets to android build folder - QString applicationBinary = target()->activeRunConfiguration()->buildTargetInfo().targetFilePath.toFileInfo().fileName(); - for (const auto &abi : androidAbis) { - QString targetSuffix = QString{"_%1.so"}.arg(abi); - if (applicationBinary.endsWith(targetSuffix)) { - // Keep only TargetName from "lib[TargetName]_abi.so" - applicationBinary.remove(0, 3).chop(targetSuffix.size()); - } - - Utils::FilePath androidLibsDir = bc->buildDirectory() - .pathAppended("android-build/libs") - .pathAppended(abi); + QString applicationBinary; + if (version->qtVersion() < QtSupport::QtVersionNumber(5, 14, 0)) { + QTC_ASSERT(androidAbis.size() == 1, return false); + applicationBinary = target()->activeRunConfiguration()->buildTargetInfo().targetFilePath.toString(); + Utils::FilePath androidLibsDir = bc->buildDirectory().pathAppended("android-build/libs").pathAppended(androidAbis.first()); for (const auto &target : targets) { - if (target.endsWith(targetSuffix)) { - if (!copyFileIfNewer(target, androidLibsDir.pathAppended(QFileInfo{target}.fileName()).toString())) - return false; - if (abi == "x86") { - architectures[abi] = "i686-linux-android"; - } else if (abi == "x86_64") { - architectures[abi] = "x86_64-linux-android"; - } else if (abi == "arm64-v8a") { - architectures[abi] = "aarch64-linux-android"; - } else { - architectures[abi] = "arm-linux-androideabi"; + if (!copyFileIfNewer(target, androidLibsDir.pathAppended(QFileInfo{target}.fileName()).toString())) + return false; + } + deploySettings["target-architecture"] = androidAbis.first(); + } else { + applicationBinary = target()->activeRunConfiguration()->buildTargetInfo().targetFilePath.toFileInfo().fileName(); + QJsonObject architectures; + + // Copy targets to android build folder + for (const auto &abi : androidAbis) { + QString targetSuffix = QString{"_%1.so"}.arg(abi); + if (applicationBinary.endsWith(targetSuffix)) { + // Keep only TargetName from "lib[TargetName]_abi.so" + applicationBinary.remove(0, 3).chop(targetSuffix.size()); + } + + Utils::FilePath androidLibsDir = bc->buildDirectory() + .pathAppended("android-build/libs") + .pathAppended(abi); + for (const auto &target : targets) { + if (target.endsWith(targetSuffix)) { + if (!copyFileIfNewer(target, androidLibsDir.pathAppended(QFileInfo{target}.fileName()).toString())) + return false; + architectures[abi] = AndroidManager::archTriplet(abi); } } } + deploySettings["architectures"] = architectures; } - deploySettings["application-binary"] = applicationBinary; - deploySettings["architectures"] = architectures; QString extraLibs = node->data(Android::Constants::AndroidExtraLibs).toString(); if (!extraLibs.isEmpty()) @@ -453,7 +462,7 @@ void AndroidBuildApkStep::doRun() qmlRootPath = target()->project()->rootProjectDirectory().toString(); deploySettings["qml-root-path"] = qmlRootPath; - QFile f{deploymentSettingsFile.toString()}; + QFile f{m_inputFile}; if (!f.open(QIODevice::WriteOnly)) return false; f.write(QJsonDocument{deploySettings}.toJson()); diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index 2ed137ccc3e..f7f8b069996 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -110,6 +110,7 @@ private: QString m_command; QString m_argumentsPasswordConcealed; bool m_skipBuilding = false; + QString m_inputFile; }; namespace Internal { diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index d883496e6cc..29c4f4e6eba 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -54,17 +54,18 @@ #include #include +#include #include +#include #include +#include #include #include +#include #include #include -#include -#include -#include -#include #include +#include namespace { const QLatin1String AndroidManifestName("AndroidManifest.xml"); @@ -76,6 +77,7 @@ namespace { const QString activityRegEx("(?launchable-activity: )(.*?)(name=)'(?.*?)'"); const QString apkVersionRegEx("(?package: )(.*?)(versionCode=)'(?.*?)'"); const QString versionCodeRegEx("(?versionCode=)(?\\d*)"); + const QString qtcSignature("This file is generated by QtCreator to be read by androiddeployqt and should not be modified by hand."); Q_LOGGING_CATEGORY(androidManagerLog, "qtc.android.androidManager", QtWarningMsg) @@ -264,6 +266,18 @@ QStringList AndroidManager::applicationAbis(const Target *target) return qt->androidAbis(); } +QString AndroidManager::archTriplet(const QString &abi) +{ + if (abi == "x86") { + return "i686-linux-android"; + } else if (abi == "x86_64") { + return "x86_64-linux-android"; + } else if (abi == "arm64-v8a") { + return "aarch64-linux-android"; + } + return "arm-linux-androideabi"; +} + QJsonObject AndroidManager::deploymentSettings(const Target *target) { QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit()); @@ -274,11 +288,20 @@ QJsonObject AndroidManager::deploymentSettings(const Target *target) if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_TYPEID) return {}; QJsonObject settings; - settings["_description"] = "This file is generated by QtCreator to be read by androiddeployqt and should not be modified by hand."; + settings["_description"] = qtcSignature; settings["qt"] = qt->prefix().toString(); settings["ndk"] = AndroidConfigurations::currentConfig().ndkLocation().toString(); settings["sdk"] = AndroidConfigurations::currentConfig().sdkLocation().toString(); - settings["stdcpp-path"] = AndroidConfigurations::currentConfig().toolchainPath().pathAppended("sysroot/usr/lib/").toString(); + if (qt->qtVersion() < QtSupport::QtVersionNumber(5, 14, 0)) { + const QStringList abis = applicationAbis(target); + QTC_ASSERT(abis.size() == 1, return {}); + settings["stdcpp-path"] = AndroidConfigurations::currentConfig().toolchainPath() + .pathAppended("sysroot/usr/lib/") + .pathAppended(archTriplet(abis.first())) + .pathAppended("libc++_shared.so").toString(); + } else { + settings["stdcpp-path"] = AndroidConfigurations::currentConfig().toolchainPath().pathAppended("sysroot/usr/lib/").toString(); + } settings["toolchain-prefix"] = "llvm"; settings["tool-prefix"] = "llvm"; settings["useLLVM"] = true; @@ -286,6 +309,14 @@ QJsonObject AndroidManager::deploymentSettings(const Target *target) return settings; } +bool AndroidManager::isQtCreatorGenerated(const FilePath &deploymentFile) +{ + QFile f{deploymentFile.toString()}; + if (!f.open(QIODevice::ReadOnly)) + return false; + return QJsonDocument::fromJson(f.readAll()).object()["_description"].toString() == qtcSignature; +} + Utils::FilePath AndroidManager::dirPath(const ProjectExplorer::Target *target) { if (auto *bc = target->activeBuildConfiguration()) diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index 49fc786b5fe..ac94fdbdc3d 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -96,6 +96,7 @@ public: static int minimumSDK(const ProjectExplorer::Kit *kit); static QStringList applicationAbis(const ProjectExplorer::Target *target); + static QString archTriplet(const QString &abi); static Utils::FilePath dirPath(const ProjectExplorer::Target *target); static Utils::FilePath manifestPath(ProjectExplorer::Target *target); @@ -127,6 +128,7 @@ public: static SdkToolResult runAaptCommand(const QStringList &args, int timeoutS = 30); static QJsonObject deploymentSettings(const ProjectExplorer::Target *target); + static bool isQtCreatorGenerated(const Utils::FilePath &deploymentFile); private: static SdkToolResult runCommand(const Utils::CommandLine &command, From 4979b5286e1bcc85c18b2ce22d98d2858ebafebb Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 21 Jan 2020 06:57:40 +0100 Subject: [PATCH 02/17] Android: Fix compile for gcc 5.3 Change-Id: I535b5873390910ca2a9963c70ed2912820c1df0e Reviewed-by: Orgad Shaneh --- src/plugins/android/androidmanager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 29c4f4e6eba..5a98a39c128 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -269,13 +269,13 @@ QStringList AndroidManager::applicationAbis(const Target *target) QString AndroidManager::archTriplet(const QString &abi) { if (abi == "x86") { - return "i686-linux-android"; + return {"i686-linux-android"}; } else if (abi == "x86_64") { - return "x86_64-linux-android"; + return {"x86_64-linux-android"}; } else if (abi == "arm64-v8a") { - return "aarch64-linux-android"; + return {"aarch64-linux-android"}; } - return "arm-linux-androideabi"; + return {"arm-linux-androideabi"}; } QJsonObject AndroidManager::deploymentSettings(const Target *target) From 68fbd15299847858c95c7991b812f80ae475ad28 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 3 Dec 2019 09:36:32 +0100 Subject: [PATCH 03/17] Squish: Remove old hack for the Mac Change-Id: I8655b8fe5a1a448995a3798fd587a01919129434 Reviewed-by: Christian Stenger --- tests/system/shared/editor_utils.py | 7 ----- tests/system/shared/project_explorer.py | 6 +---- tests/system/shared/workarounds.py | 27 ------------------- .../suite_general/tst_rename_file/test.py | 12 +++------ .../suite_general/tst_tasks_handling/test.py | 9 +++---- .../tst_designer_autocomplete/test.py | 6 +---- .../tst_designer_goto_slot/test.py | 6 +---- 7 files changed, 10 insertions(+), 63 deletions(-) diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index b1ea1bb1bd9..8410e986ef9 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -70,13 +70,6 @@ def placeCursorToLine(editor, line, isRegex=False): def menuVisibleAtEditor(editor, menuInList): menuInList[0] = None try: - # Hack for Squish 5.0.1 handling menus of Qt5.2 on Mac (avoids crash) - remove asap - if platform.system() == 'Darwin': - for obj in object.topLevelObjects(): - if className(obj) == "QMenu" and obj.visible and widgetContainsPoint(editor, obj.mapToGlobal(QPoint(0, 0))): - menuInList[0] = obj - return True - return False menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500) topLeft = menu.mapToGlobal(QPoint(0, 0)) bottomLeft = menu.mapToGlobal(QPoint(0, menu.height)) diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py index 60b3af9f206..01a2e81c997 100644 --- a/tests/system/shared/project_explorer.py +++ b/tests/system/shared/project_explorer.py @@ -143,11 +143,7 @@ def invokeContextMenuOnProject(projectName, menuItem): return openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"), str(projItem.text).replace("_", "\\_").replace(".", "\\."), 5, 5, 0) - # Hack for Squish 5.0.1 handling menus of Qt5.2 on Mac (avoids crash) - remove asap - if platform.system() == 'Darwin': - waitFor("macHackActivateContextMenuItem(menuItem)", 6000) - else: - activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1'}", menuItem)) + activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1'}", menuItem)) return projItem def addAndActivateKit(kit): diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 697625945f9..ab8e338ad7f 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -25,33 +25,6 @@ import urllib2 -############ functions not related to issues tracked inside jira ############ - -def __checkWithoutWidget__(*args): - return className(args[0]) == 'QMenu' and args[0].visible - -def __checkWithWidget__(*args): - return (__checkWithoutWidget__(args[0]) - and widgetContainsPoint(waitForObject(args[1]), args[0].mapToGlobal(QPoint(0 ,0)))) - -# hack for activating context menus on Mac because of Squish5/Qt5.2 problems -# param item a string holding the menu item to invoke (just the label) -# param widget an object; if provided there will be an additional check if the menu's top left -# corner is placed on this widget -def macHackActivateContextMenuItem(item, widget=None): - if widget: - func = __checkWithWidget__ - else: - func = __checkWithoutWidget__ - for obj in object.topLevelObjects(): - try: - if func(obj, widget): - activateItem(waitForObjectItem(obj, item)) - return True - except: - pass - return False - ################ workarounds for issues tracked inside jira ################# JIRA_URL='https://bugreports.qt.io/browse' diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py index a5568f85b54..5c296973b02 100644 --- a/tests/system/suite_general/tst_rename_file/test.py +++ b/tests/system/suite_general/tst_rename_file/test.py @@ -96,15 +96,11 @@ def renameFile(projectDir, proFile, branch, oldname, newname): itemWithWildcard = addBranchWildcardToRoot(itemText) waitForObjectItem(treeview, itemWithWildcard, 10000) openItemContextMenu(treeview, itemWithWildcard, 5, 5, 0) - # hack for Squish5/Qt5.2 problems of handling menus on Mac - remove asap - if platform.system() == 'Darwin': - waitFor("macHackActivateContextMenuItem('Rename...')", 5000) + if oldname.lower().endswith(".qrc"): + menu = ":Qt Creator.Project.Menu.Folder_QMenu" else: - if oldname.lower().endswith(".qrc"): - menu = ":Qt Creator.Project.Menu.Folder_QMenu" - else: - menu = ":Qt Creator.Project.Menu.File_QMenu" - activateItem(waitForObjectItem(menu, "Rename...")) + menu = ":Qt Creator.Project.Menu.File_QMenu" + activateItem(waitForObjectItem(menu, "Rename...")) replaceEdit = waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit") test.compare(replaceEdit.selectedText, oldname.rsplit(".", 1)[0], "Only the filename without the extension is selected?") diff --git a/tests/system/suite_general/tst_tasks_handling/test.py b/tests/system/suite_general/tst_tasks_handling/test.py index d7acc4c9404..429e711f5c6 100644 --- a/tests/system/suite_general/tst_tasks_handling/test.py +++ b/tests/system/suite_general/tst_tasks_handling/test.py @@ -75,12 +75,9 @@ def generateMockTasksFile(): def checkOrUncheckMyTasks(): filterButton = waitForObject(toolButton % 'Filter by categories') clickButton(filterButton) - if platform.system() == 'Darwin': - waitFor("macHackActivateContextMenuItem('My Tasks')", 5000) - else: - activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}", - "My Tasks")) + activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}", + "My Tasks")) def getBuildIssuesTypeCounts(model): issueTypes = map(lambda x: x.data(Qt.UserRole + 5).toInt(), dumpIndices(model)) diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py index 0b97efec6a0..6e49d7ba48e 100644 --- a/tests/system/suite_tools/tst_designer_autocomplete/test.py +++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py @@ -38,11 +38,7 @@ def main(): if buttonName: openContextMenu(waitForObject("{container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack'" "text='PushButton' type='QPushButton' visible='1'}"), 5, 5, 1) - # hack for Squish5/Qt5.2 problems of handling menus on Mac - remove asap - if platform.system() == 'Darwin': - waitFor("macHackActivateContextMenuItem('Change objectName...')", 6000) - else: - activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Change objectName...")) + activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Change objectName...")) typeLines(waitForObject(":FormEditorStack_qdesigner_internal::PropertyLineEdit"), buttonName) else: # Verify that everything works without ever changing the name diff --git a/tests/system/suite_tools/tst_designer_goto_slot/test.py b/tests/system/suite_tools/tst_designer_goto_slot/test.py index 11a1b4d6719..5e6352454a3 100644 --- a/tests/system/suite_tools/tst_designer_goto_slot/test.py +++ b/tests/system/suite_tools/tst_designer_goto_slot/test.py @@ -45,11 +45,7 @@ def main(): selectFromLocator("mainwindow.ui") openContextMenu(waitForObject(con[0]), 5, 5, 0) snooze(1) - # hack for Squish 5/Qt5.2 problems of handling menus on Mac - remove asap - if platform.system() == 'Darwin': - waitFor("macHackActivateContextMenuItem('Go to slot...', con[0])", 6000) - else: - activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot...")) + activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot...")) signalWidgetObject = waitForObject(":Select signal.signalList_QTreeView") signalName = con[1] + "." + con[2] mouseClick(waitForObjectItem(signalWidgetObject, signalName), 5, 5, 0, Qt.LeftButton) From c16e205a7712cd0f0d8b68cfcaa7baf41acb368f Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 17 Dec 2019 15:12:49 +0100 Subject: [PATCH 04/17] Doc: Describe saving Clang-Tidy configuration as a file Fixes: QTCREATORBUG-23223 Change-Id: Ia78220bb959e9bafb9101e3f130ab75180c1b816 Reviewed-by: Paul Wicking --- .../creator-clang-static-analyzer.qdoc | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/src/analyze/creator-clang-static-analyzer.qdoc b/doc/src/analyze/creator-clang-static-analyzer.qdoc index b3785534954..b098943269c 100644 --- a/doc/src/analyze/creator-clang-static-analyzer.qdoc +++ b/doc/src/analyze/creator-clang-static-analyzer.qdoc @@ -181,4 +181,28 @@ at each level. To include the checks from the lower levels automatically, select the \uicontrol {Enable lower levels automatically} check box. + \section2 Creating Clang-Tidy Configuration Files + + Clang-Tidy reads the configuration for each source file from a .clang-tidy + file located in the closest parent directory of the source file. If any + configuration options have a corresponding command-line option, the + command-line option takes precedence. The effective configuration can be + inspected using \c {-dump-config}. + + \QC creates the configuration for you based on the checks you select. To + store the checks in file format, you can create a .clang-tidy file, as + follows: + + \list 1 + \li Select \uicontrol {Edit Checks as String} and copy the contents of + the field. + \li Pipe the output of \c {clang-tidy -dump-config} into a file named + \c {.clang-tidy}. For example: + \c {clang-tidy -checks=-*,bugprone-*,cppcoreguidelines-avoid-* -dump-config > .clang-tidy} + \li Move the .clang-tidy file to the parent directory of the sources. + \endlist + + To add more checks using \QC later on, copy the checks from your .clang-tidy + file into the \uicontrol {Edit Checks as String} field, select additional + checks, and copy-paste the contents of the field to the .clang-tidy file. */ From b59785c4b55cc45d01a77d1f67b0f5875a906a05 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 21 Jan 2020 16:24:50 +0100 Subject: [PATCH 05/17] GenericProjectManager: Fix crash updating deployment data Fixes: QTCREATORBUG-23501 Change-Id: Ia36fe567edf26c293a8db2446d1ee2344b96433e Reviewed-by: Christian Stenger --- src/plugins/genericprojectmanager/genericproject.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 1c280eb4906..384152b454a 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -546,10 +546,12 @@ void GenericProject::updateDeploymentData() hasDeploymentData = QFileInfo::exists(deploymentFilePath.toString()); } if (hasDeploymentData) { - DeploymentData deploymentData; - deploymentData.addFilesFromDeploymentFile(deploymentFilePath.toString(), - projectDirectory().toString()); - activeTarget()->setDeploymentData(deploymentData); + if (activeTarget()) { + DeploymentData deploymentData; + deploymentData.addFilesFromDeploymentFile(deploymentFilePath.toString(), + projectDirectory().toString()); + activeTarget()->setDeploymentData(deploymentData); + } if (m_deployFileWatcher->files() != QStringList(deploymentFilePath.toString())) { m_deployFileWatcher->removeFiles(m_deployFileWatcher->files()); m_deployFileWatcher->addFile(deploymentFilePath.toString(), From 5f1fd0caeea9a78a521ecc88d5315f2829da28d8 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 22 Jan 2020 10:34:30 +0100 Subject: [PATCH 06/17] LanguageClient: keep the project on client reset It won't be set again when restarting the server. Task-number: QTCREATORBUG-23497 Change-Id: I28b4c4f9169a2de94d7ea7f6712c3900fd7099ee Reviewed-by: Christian Stenger --- src/plugins/languageclient/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 78b1ddedda1..7a8d305550c 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -811,7 +811,6 @@ bool Client::reset() m_openedDocument.clear(); m_serverCapabilities = ServerCapabilities(); m_dynamicCapabilities.reset(); - m_project = nullptr; for (const DocumentUri &uri : m_diagnostics.keys()) removeDiagnostics(uri); for (TextEditor::TextDocument *document : m_resetAssistProvider.keys()) From de2fc39aa11aba1f94646f055b71bf42ad711f0b Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Fri, 24 Jan 2020 18:04:19 +0300 Subject: [PATCH 07/17] BareMetal: Fix Keil toolchains detection on Windows A problem is that a latest installed toolchain overrides a previous installed toolchain. In this case a previous toolchain will be skipped from the search. We need to fetch an information from the 'uninstall' registry entry, which describes all installed toolchains. Change-Id: I662e2696900909607d5ce618a728804e3683c856 Reviewed-by: hjk Reviewed-by: Christian Kandeler --- src/plugins/baremetal/keiltoolchain.cpp | 99 +++++++++++++++++-------- 1 file changed, 70 insertions(+), 29 deletions(-) diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index eb6afe8e0ed..ce3da730a16 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -401,48 +401,89 @@ KeilToolchainFactory::KeilToolchainFactory() setUserCreatable(true); } +// Parse the 'tools.ini' file to fetch a toolchain version. +// Note: We can't use QSettings here! +static QString extractVersion(const QString &toolsFile, const QString §ion) +{ + QFile f(toolsFile); + if (!f.open(QIODevice::ReadOnly)) + return {}; + QTextStream in(&f); + enum State { Enter, Lookup, Exit } state = Enter; + while (!in.atEnd()) { + const QString line = in.readLine().trimmed(); + // Search for section. + const int firstBracket = line.indexOf('['); + const int lastBracket = line.lastIndexOf(']'); + const bool hasSection = (firstBracket == 0 && lastBracket != -1 + && (lastBracket + 1) == line.size()); + switch (state) { + case Enter: + if (hasSection) { + const auto content = line.midRef(firstBracket + 1, + lastBracket - firstBracket - 1); + if (content == section) + state = Lookup; + } + break; + case Lookup: { + if (hasSection) + return {}; // Next section found. + const int versionIndex = line.indexOf("VERSION="); + if (versionIndex < 0) + continue; + QString version = line.mid(8); + if (version.startsWith('V')) + version.remove(0, 1); + return version; + } + break; + default: + return {}; + } + } + return {}; +} + QList KeilToolchainFactory::autoDetect(const QList &alreadyKnown) { #ifdef Q_OS_WIN64 - static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Keil\\Products"; + static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\" \ + "Windows\\CurrentVersion\\Uninstall\\Keil µVision4" #else - static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Keil\\Products"; + static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \ + "Windows\\CurrentVersion\\Uninstall\\Keil µVision4"; #endif - struct Entry { - QString productKey; - QString subExePath; - }; - - // Dictionary for know toolchains. - static const std::array knowToolchains = {{ - {QString("MDK"), QString("\\ARMCC\\bin\\armcc.exe")}, - {QString("C51"), QString("\\BIN\\c51.exe")}, - }}; - Candidates candidates; QSettings registry(kRegistryNode, QSettings::NativeFormat); const auto productGroups = registry.childGroups(); for (const QString &productKey : productGroups) { - const Entry entry = Utils::findOrDefault(knowToolchains, - [productKey](const Entry &entry) { - return entry.productKey == productKey; }); - - if (entry.productKey.isEmpty()) + if (!productKey.startsWith("App")) continue; - registry.beginGroup(productKey); - QString compilerPath = registry.value("Path").toString(); - if (!compilerPath.isEmpty()) { - // Build full compiler path. - compilerPath += entry.subExePath; - const FilePath fn = FilePath::fromString(compilerPath); - if (compilerExists(fn)) { - QString version = registry.value("Version").toString(); - if (version.startsWith('V')) - version.remove(0, 1); - candidates.push_back({fn, version}); + const FilePath productPath(FilePath::fromString(registry.value("ProductDir") + .toString())); + // Fetch the toolchain executable path. + FilePath compilerPath; + if (productPath.endsWith("ARM")) + compilerPath = productPath.pathAppended("\\ARMCC\\bin\\armcc.exe"); + else if (productPath.endsWith("C51")) + compilerPath = productPath.pathAppended("\\BIN\\c51.exe"); + + if (compilerPath.exists()) { + // Fetch the toolchain version. + const QDir rootDir(registry.value("Directory").toString()); + const QString toolsFilePath = rootDir.absoluteFilePath("tools.ini"); + for (auto index = 1; index <= 2; ++index) { + const QString section = registry.value( + QStringLiteral("Section %1").arg(index)).toString(); + const QString version = extractVersion(toolsFilePath, section); + if (!version.isEmpty()) { + candidates.push_back({compilerPath, version}); + break; + } } } registry.endGroup(); From 652a6da4b3491c9dc217d247a4a059bca12db57c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 28 Jan 2020 07:59:34 +0100 Subject: [PATCH 08/17] Baremetal: Fix missing semicolon on Win Change-Id: I6a2195c680411242a90e86d5be0c2e956ac807c1 Reviewed-by: hjk --- src/plugins/baremetal/keiltoolchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index ce3da730a16..80ae51240eb 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -449,7 +449,7 @@ QList KeilToolchainFactory::autoDetect(const QList &al { #ifdef Q_OS_WIN64 static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\" \ - "Windows\\CurrentVersion\\Uninstall\\Keil µVision4" + "Windows\\CurrentVersion\\Uninstall\\Keil µVision4"; #else static const char kRegistryNode[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" \ "Windows\\CurrentVersion\\Uninstall\\Keil µVision4"; From c50e928e7698d24e5ed070a3f638067e40abe2ca Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 30 Jan 2020 12:57:34 +0100 Subject: [PATCH 09/17] Fix progressbar example so that it compiles and related doc Change-Id: I17423a57cf4e86492462caacd3ba0a9d5d4dd6be Reviewed-by: Paul Wicking Reviewed-by: Leena Miettinen --- doc/examples/progressbar/main.cpp | 2 +- doc/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/progressbar/main.cpp b/doc/examples/progressbar/main.cpp index d8275e35c29..b418a6c3df2 100644 --- a/doc/examples/progressbar/main.cpp +++ b/doc/examples/progressbar/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQuickView view; - view.engine->addImportPath("qrc:/qml/imports"); + view.engine()->addImportPath("qrc:/qml/imports"); view.setSource(QUrl("qrc:/qml/ProgressBar.ui.qml")); if (!view.errors().isEmpty()) return -1; diff --git a/doc/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc b/doc/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc index ff8d929f9eb..73df38d295b 100644 --- a/doc/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc +++ b/doc/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc @@ -100,7 +100,7 @@ \skipto QQuickView view; \printuntil view.show() Where \c {qrc:/qml/imports} is the import path and - \c {qrc:qml/ProgressBar.ui.qml} is the path to and the + \c {qrc:/qml/ProgressBar.ui.qml} is the path to and the name of the main QML file in the Qt Quick UI project. \li Select \uicontrol Build > \uicontrol Run to build and run your project. From d5fd6a83d89ab0d7f4edf25ab8db0b8dae42645c Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 30 Jan 2020 17:07:48 +0300 Subject: [PATCH 10/17] Debugger: Improve parsing of SVD file The previous implementation was done in a hurry and a bit overcomplicated for maintenance. Now it is simplified and a common code moved to a separate functions. Change-Id: I86e9131e08154ec24bb7778c3a7d4c3d6b042751 Reviewed-by: hjk --- .../debugger/peripheralregisterhandler.cpp | 255 +++++++++--------- 1 file changed, 131 insertions(+), 124 deletions(-) diff --git a/src/plugins/debugger/peripheralregisterhandler.cpp b/src/plugins/debugger/peripheralregisterhandler.cpp index 1603faf3dc9..57f69338db3 100644 --- a/src/plugins/debugger/peripheralregisterhandler.cpp +++ b/src/plugins/debugger/peripheralregisterhandler.cpp @@ -52,6 +52,8 @@ constexpr char kBitRange[] = "bitRange"; constexpr char kBitWidth[] = "bitWidth"; constexpr char kDerivedFrom[] = "derivedFrom"; constexpr char kDescription[] = "description"; +constexpr char kDevice[] = "device"; +constexpr char kDisplayName[] = "displayName"; constexpr char kField[] = "field"; constexpr char kFields[] = "fields"; constexpr char kGroupName[] = "groupName"; @@ -559,135 +561,141 @@ PeripheralRegisterHandler::PeripheralRegisterHandler(DebuggerEngine *engine) setHeader({tr("Name"), tr("Value"), tr("Access")}); } -static PeripheralRegisterGroups availablePeripheralRegisterGroups( - const QString &filePath) +static void handleField(QXmlStreamReader &in, PeripheralRegister ®) +{ + PeripheralRegisterField fld; + while (in.readNextStartElement()) { + const auto elementName = in.name(); + if (elementName == kName) { + fld.name = in.readElementText(); + } else if (elementName == kDescription) { + fld.description = in.readElementText(); + } else if (elementName == kAccess) { + fld.access = decodeAccess(in.readElementText()); + } else if (elementName == kBitRange) { + const QString elementText = in.readElementText(); + const int startBracket = elementText.indexOf('['); + const int endBracket = elementText.indexOf(']'); + if (startBracket == -1 || endBracket == -1 || (endBracket - startBracket) <= 0) + continue; + const QString range = elementText.mid(startBracket + 1, endBracket - 1); + const QStringList items = range.split(':'); + enum { MaxBit, MinBit, BitsCount }; + if (items.count() != BitsCount) + continue; + const int from = int(decodeNumeric(items.at(MinBit))); + const int to = int(decodeNumeric(items.at(MaxBit))); + fld.bitOffset = from; + fld.bitWidth = to - from + 1; + } else if (elementName == kBitOffset) { + fld.bitOffset = int(decodeNumeric(in.readElementText())); + } else if (elementName == kBitWidth) { + fld.bitWidth = int(decodeNumeric(in.readElementText())); + } else { + in.skipCurrentElement(); + } + } + reg.fields.push_back(fld); +} + +static void handleRegister(QXmlStreamReader &in, PeripheralRegisterGroup &group) +{ + PeripheralRegister reg; + while (in.readNextStartElement()) { + const auto elementName = in.name(); + if (elementName == kName) { + reg.name = in.readElementText(); + } else if (elementName == kDisplayName) { + reg.displayName = in.readElementText(); + } else if (elementName == kDescription) { + reg.description = in.readElementText(); + } else if (elementName == kAddressOffset) { + reg.addressOffset = decodeNumeric(in.readElementText()); + } else if (elementName == kSize) { + reg.size = int(decodeNumeric(in.readElementText())); + } else if (elementName == kAccess) { + reg.access = decodeAccess(in.readElementText()); + } else if (elementName == kResetvalue) { + reg.resetValue = decodeNumeric(in.readElementText()); + } else if (elementName == kFields) { + while (in.readNextStartElement()) { + const auto elementName = in.name(); + if (elementName == kField) + handleField(in, reg); + else + in.skipCurrentElement(); + } + } else { + in.skipCurrentElement(); + } + } + group.registers.push_back(reg); +} + +static void handleGroup(QXmlStreamReader &in, PeripheralRegisterGroups &groups) +{ + PeripheralRegisterGroup group; + + const auto fromGroupName = in.attributes().value(kDerivedFrom); + if (!fromGroupName.isEmpty()) { + const auto groupEnd = groups.cend(); + const auto groupIt = std::find_if(groups.cbegin(), groupEnd, + [fromGroupName](const PeripheralRegisterGroup &group) { + return fromGroupName == group.name; + }); + if (groupIt != groupEnd) + group = *groupIt; + } + + while (in.readNextStartElement()) { + const auto elementName = in.name(); + if (elementName == kName) { + group.name = in.readElementText(); + } else if (elementName == kDescription) { + group.description = in.readElementText(); + } else if (elementName == kGroupName) { + group.displayName = in.readElementText(); + } else if (elementName == kBaseAddress) { + group.baseAddress = decodeNumeric(in.readElementText()); + } else if (elementName == kSize) { + group.size = int(decodeNumeric(in.readElementText())); + } else if (elementName == kAccess) { + group.access = decodeAccess(in.readElementText()); + } else if (elementName == kRegisters) { + while (in.readNextStartElement()) { + const auto elementName = in.name(); + if (elementName == kRegister) + handleRegister(in, group); + else + in.skipCurrentElement(); + } + } else { + in.skipCurrentElement(); + } + } + groups.push_back(group); +} + +static PeripheralRegisterGroups availablePeripheralRegisterGroups(const QString &filePath) { QFile f(filePath); if (!f.open(QIODevice::ReadOnly)) return {}; QXmlStreamReader in(&f); - - PeripheralRegisterGroups foundGroups; - - while (!in.atEnd()) { - const auto token = in.readNext(); - if (token == QXmlStreamReader::EndElement - && in.name() == QLatin1String(kPeripherals)) { - break; - } else if (token != QXmlStreamReader::StartElement - || in.name() != QLatin1String(kPeripheral)) { - continue; - } - - PeripheralRegisterGroup group; - - const auto fromGroupName = in.attributes().value( - QLatin1String(kDerivedFrom)); - const auto foundGroupEnd = foundGroups.cend(); - const auto foundGroupIt = std::find_if( - foundGroups.cbegin(), foundGroupEnd, - [fromGroupName](const PeripheralRegisterGroup &foundGroup) { - return fromGroupName == foundGroup.name; - }); - if (foundGroupIt != foundGroupEnd) - group = *foundGroupIt; - - while (!in.atEnd()) { - const auto token = in.readNext(); - if (token == QXmlStreamReader::EndElement - && in.name() == QLatin1String(kPeripheral)) { - foundGroups.push_back(group); - break; - } else if (token == QXmlStreamReader::StartElement) { + PeripheralRegisterGroups groups; + while (in.readNextStartElement()) { + const auto elementName = in.name(); + if (elementName == kDevice) { + while (in.readNextStartElement()) { const auto elementName = in.name(); - if (elementName == QLatin1String(kName)) { - group.name = in.readElementText(); - } else if (elementName == QLatin1String(kDescription)) { - group.description = in.readElementText(); - } else if (elementName == QLatin1String(kGroupName)) { - group.displayName = in.readElementText(); - } else if (elementName == QLatin1String(kBaseAddress)) { - group.baseAddress = decodeNumeric(in.readElementText()); - } else if (elementName == QLatin1String(kSize)) { - group.size = int(decodeNumeric(in.readElementText())); - } else if (elementName == QLatin1String(kAccess)) { - group.access = decodeAccess(in.readElementText()); - } else if (elementName == QLatin1String(kRegisters) - || elementName == QLatin1String(kRegister)) { - PeripheralRegister reg; - while (!in.atEnd()) { - const auto token = in.readNext(); - if (token == QXmlStreamReader::EndElement - && in.name() == QLatin1String(kRegister)) { - group.registers.push_back(reg); - break; - } else if (token == QXmlStreamReader::StartElement) { - const auto elementName = in.name(); - if (elementName == QLatin1String(kRegister)) { - continue; - } else if (elementName == QLatin1String(kName)) { - reg.name = in.readElementText(); - } else if (elementName == QLatin1String(kDescription)) { - reg.description = in.readElementText(); - } else if (elementName == QLatin1String(kAddressOffset)) { - reg.addressOffset = decodeNumeric(in.readElementText()); - } else if (elementName == QLatin1String(kSize)) { - reg.size = int(decodeNumeric(in.readElementText())); - } else if (elementName == QLatin1String(kAccess)) { - reg.access = decodeAccess(in.readElementText()); - } else if (elementName == QLatin1String(kResetvalue)) { - reg.resetValue = decodeNumeric(in.readElementText()); - } else if (elementName == QLatin1String(kFields) - || elementName == QLatin1String(kField)) { - PeripheralRegisterField fld; - while (!in.atEnd()) { - const auto token = in.readNext(); - if (token == QXmlStreamReader::EndElement - && in.name() == QLatin1String(kField)) { - reg.fields.push_back(fld); - break; - } else if (token == QXmlStreamReader::StartElement) { - const auto elementName = in.name(); - if (elementName == QLatin1String(kField)) { - continue; - } else if (elementName == QLatin1String(kName)) { - fld.name = in.readElementText(); - } else if (elementName == QLatin1String(kDescription)) { - fld.description = in.readElementText(); - } else if (elementName == QLatin1String(kAccess)) { - fld.access = decodeAccess(in.readElementText()); - } else if (elementName == QLatin1String(kBitRange)) { - const QString elementText = in.readElementText(); - const int startBracket = elementText.indexOf('['); - const int endBracket = elementText.indexOf(']'); - if (startBracket == -1 || endBracket == -1 - || (endBracket - startBracket) <= 0) { - continue; - } - const QString range = elementText.mid( - startBracket + 1, endBracket - 1); - const QStringList items = range.split(':'); - enum { MaxBit, MinBit, BitsCount }; - if (items.count() != BitsCount) - continue; - const int from = int(decodeNumeric(items.at(MinBit))); - const int to = int(decodeNumeric(items.at(MaxBit))); - fld.bitOffset = from; - fld.bitWidth = to - from + 1; - } else if (elementName == QLatin1String(kBitOffset)) { - fld.bitOffset = int(decodeNumeric(in.readElementText())); - } else if (elementName == QLatin1String(kBitWidth)) { - fld.bitWidth = int(decodeNumeric(in.readElementText())); - } else { - in.skipCurrentElement(); - } - } - } - } else { - in.skipCurrentElement(); - } - } + if (elementName == kPeripherals) { + while (in.readNextStartElement()) { + const auto elementName = in.name(); + if (elementName == kPeripheral) + handleGroup(in, groups); + else + in.skipCurrentElement(); } } else { in.skipCurrentElement(); @@ -695,8 +703,7 @@ static PeripheralRegisterGroups availablePeripheralRegisterGroups( } } } - - return foundGroups; + return groups; } void PeripheralRegisterHandler::updateRegisterGroups() From 95e360acc0b2843d0bcecb7b653d5f2cd989eb99 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 27 Jan 2020 11:46:52 +0100 Subject: [PATCH 11/17] RemoteLinux: Consider hidden files in MakeInstallStep Fixes: QTCREATORBUG-23528 Change-Id: I7d9401e2e68fd051168457a3a8fa90c5824a6459 Reviewed-by: hjk --- src/plugins/remotelinux/makeinstallstep.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 7ddb4c9083f..428bae075d1 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -160,7 +160,8 @@ void MakeInstallStep::finish(bool success) if (success) { m_deploymentData = DeploymentData(); m_deploymentData.setLocalInstallRoot(installRoot()); - QDirIterator dit(installRoot().toString(), QDir::Files, QDirIterator::Subdirectories); + QDirIterator dit(installRoot().toString(), QDir::Files | QDir::Hidden, + QDirIterator::Subdirectories); while (dit.hasNext()) { dit.next(); const QFileInfo fi = dit.fileInfo(); From 07e38c54360bfb0cb05d0df3de61340b2eb48369 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 3 Feb 2020 16:37:15 +0100 Subject: [PATCH 12/17] ProjectExplorer: Fix SessionModel ... with regards to removal of a session, which was not reflected in the view anymore. Amends 8c0906e8fb. Fixes: QTCREATORBUG-23547 Change-Id: Ibd9252719b9577e939781d69dd1c89fa819fff81 Reviewed-by: hjk --- src/plugins/projectexplorer/sessionmodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/projectexplorer/sessionmodel.cpp b/src/plugins/projectexplorer/sessionmodel.cpp index 094a7bbc5f9..9e926941166 100644 --- a/src/plugins/projectexplorer/sessionmodel.cpp +++ b/src/plugins/projectexplorer/sessionmodel.cpp @@ -234,6 +234,7 @@ void SessionModel::deleteSessions(const QStringList &sessions) return; beginResetModel(); SessionManager::deleteSessions(sessions); + m_sortedSessions = SessionManager::sessions(); endResetModel(); } From 32d9af894fe5e4b5e572665e1454524a02bac684 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 3 Feb 2020 10:22:57 +0100 Subject: [PATCH 13/17] Debugger: Do not raise watchers window unconditionally In case of mixed debugging it may happen that the trigger for add an expression happens on a different debugger engine than the raise of the watchers window as the companion engine might have been interrupted and the current perspective has changed accordingly. Avoid raising the watchers window for the other engine in that case. Fixes: QTCREATORBUG-23545 Change-Id: Ic3472b17c727f1336afd1945b5bc448e75e25b4f Reviewed-by: hjk --- src/plugins/debugger/debuggerengine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 86d4834b653..01c66fa95bb 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -2288,6 +2288,12 @@ void DebuggerEngine::openDisassemblerView(const Location &location) void DebuggerEngine::raiseWatchersWindow() { if (d->m_watchersView && d->m_watchersWindow) { + auto currentPerspective = DebuggerMainWindow::currentPerspective(); + QTC_ASSERT(currentPerspective, return); + // if a companion engine has taken over - do not raise the watchers + if (currentPerspective->name() != d->m_engine->displayName()) + return; + if (auto dock = qobject_cast(d->m_watchersWindow->parentWidget())) { if (QAction *act = dock->toggleViewAction()) { if (!act->isChecked()) From 65e2e374069d3e9e331105bdc8866efa26b9960d Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 3 Feb 2020 09:26:04 +0100 Subject: [PATCH 14/17] LanguageClient: Fix expected codeActionProvider value Fixes: QTCREATORBUG-23553 Change-Id: I3604905cddcc27c45f842cf54c1e4c39fd1bc5c0 Reviewed-by: Christian Stenger --- src/libs/languageserverprotocol/servercapabilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/languageserverprotocol/servercapabilities.cpp b/src/libs/languageserverprotocol/servercapabilities.cpp index a8e932ad50a..a000ad2c891 100644 --- a/src/libs/languageserverprotocol/servercapabilities.cpp +++ b/src/libs/languageserverprotocol/servercapabilities.cpp @@ -162,7 +162,7 @@ bool ServerCapabilities::isValid(QStringList *error) const && checkOptional(error, documentHighlightProviderKey) && checkOptional(error, documentSymbolProviderKey) && checkOptional(error, workspaceSymbolProviderKey) - && checkOptional(error, codeActionProviderKey) + && checkOptional(error, codeActionProviderKey) && checkOptional(error, codeLensProviderKey) && checkOptional(error, documentFormattingProviderKey) && checkOptional(error, documentRangeFormattingProviderKey) From 93896c9832e78ec2cb829cc1f9c9098d97d78c6a Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 3 Feb 2020 15:11:27 +0100 Subject: [PATCH 15/17] Unit: Fix building without ClangRefactoring Change-Id: Id2a4d9d030c4a36eebc88f93029d846f08870eac Reviewed-by: David Schulz --- tests/unit/unittest/unittest.pro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/unittest/unittest.pro b/tests/unit/unittest/unittest.pro index c72d767ee0c..1e95d30cea8 100644 --- a/tests/unit/unittest/unittest.pro +++ b/tests/unit/unittest/unittest.pro @@ -137,7 +137,6 @@ SOURCES += \ clangdocumentprocessors-test.cpp \ clangdocumentprocessor-test.cpp \ clangdocuments-test.cpp \ - clangdocumentsuspenderresumer-test.cpp \ clangdocument-test.cpp \ clangfixitoperation-test.cpp \ clangfollowsymbol-test.cpp \ @@ -145,7 +144,6 @@ SOURCES += \ clangjobqueue-test.cpp \ clangjobs-test.cpp \ clangparsesupportivetranslationunitjob-test.cpp \ - clangreferencescollector-test.cpp \ clangrequestannotationsjob-test.cpp \ clangrequestreferencesjob-test.cpp \ clangresumedocumentjob-test.cpp \ @@ -176,7 +174,6 @@ SOURCES += \ sqlitetable-test.cpp \ sqlstatementbuilder-test.cpp \ token-test.cpp \ - tokenprocessor-test.cpp \ translationunitupdater-test.cpp \ unsavedfiles-test.cpp \ unsavedfile-test.cpp \ @@ -186,9 +183,11 @@ SOURCES += \ !isEmpty(LIBTOOLING_LIBS) { SOURCES += \ gtest-llvm-printing.cpp \ + clangdocumentsuspenderresumer-test.cpp \ clangquerygatherer-test.cpp \ clangqueryprojectfindfilter-test.cpp \ clangquery-test.cpp \ + clangreferencescollector-test.cpp \ gtest-clang-printing.cpp \ pchcreator-test.cpp \ refactoringclientserverinprocess-test.cpp \ @@ -201,7 +200,8 @@ SOURCES += \ symbolscollector-test.cpp \ testclangtool.cpp \ usedmacrocollector-test.cpp \ - builddependencycollector-test.cpp + builddependencycollector-test.cpp \ + tokenprocessor-test.cpp } !isEmpty(CLANGFORMAT_LIBS) { From 6b10a1ad56b35af288f83d6ede270b1d758b068f Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 30 Jan 2020 17:17:49 +0300 Subject: [PATCH 16/17] Debugger: Inherit register field access rights from register ... if this field has not the access rights information. Fixes: QTCREATORBUG-23542 Change-Id: I3440fa0fd34dc91164eefcafc1ba74e852e103b9 Reviewed-by: hjk --- src/plugins/debugger/peripheralregisterhandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/debugger/peripheralregisterhandler.cpp b/src/plugins/debugger/peripheralregisterhandler.cpp index 57f69338db3..018cbbc1425 100644 --- a/src/plugins/debugger/peripheralregisterhandler.cpp +++ b/src/plugins/debugger/peripheralregisterhandler.cpp @@ -595,6 +595,12 @@ static void handleField(QXmlStreamReader &in, PeripheralRegister ®) in.skipCurrentElement(); } } + + // Inherit the field access from the register access if the filed + // has not the access rights description. + if (fld.access == PeripheralRegisterAccess::Unknown) + fld.access = reg.access; + reg.fields.push_back(fld); } From b2ddeacfb5c54d3b0e15c8e6087d21aefaed4d7a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 31 Jan 2020 15:07:26 +0100 Subject: [PATCH 17/17] Update changes file for 4.11.1 Change-Id: I3417e020cba77e1ad18085b5dadec6c5e9761997 Reviewed-by: Leena Miettinen --- dist/changes-4.11.1.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dist/changes-4.11.1.md b/dist/changes-4.11.1.md index 8f2635897b3..65fc03b0a9f 100644 --- a/dist/changes-4.11.1.md +++ b/dist/changes-4.11.1.md @@ -16,6 +16,10 @@ Editing * Fixed `Visualize Whitespace` for editors without specialized highlighter definition (QTCREATORBUG-23040) +### Language Client + +* Fixed failure when restarting server (QTCREATORBUG-23497) + ### C++ * Fixed wrong warnings about C++98 incompatibility with MSVC (QTCREATORBUG-23118) @@ -37,6 +41,14 @@ Projects * Fixed subdirectory structure in project tree (QTCREATORBUG-23372) +### Qbs + +* Fixed building Android projects (QTCREATORBUG-23489) + +### Generic + +* Fixed crash when updating deployment data (QTCREATORBUG-23501) + Debugging --------- @@ -61,6 +73,10 @@ Platforms * Worked around issue with HiDPI in Qt (QTBUG-80934) +### Remote Linux + +* Fixed that terminal setting was ignored (QTCREATORBUG-23470) + ### WebAssembly * Fixed missing device in kit (QTCREATORBUG-23360)