From c8822865299742050cb15cdf1cb1cb405def0702 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 17 Oct 2018 08:07:03 +0200 Subject: [PATCH 1/7] ProjectExplorer: cancel MSVC tool chain detection on shutdown Task-number: QTCREATORBUG-21329 Change-Id: I681757f1a2e77ecd7f766f25ab554d57473f1c6d Reviewed-by: Orgad Shaneh Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/msvctoolchain.cpp | 5 +++++ src/plugins/projectexplorer/msvctoolchain.h | 2 ++ src/plugins/projectexplorer/projectexplorer.cpp | 1 + src/plugins/projectexplorer/toolchainmanager.cpp | 6 ++++++ src/plugins/projectexplorer/toolchainmanager.h | 2 ++ 5 files changed, 16 insertions(+) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 8ed356a324d..2bc98d19ac4 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -1184,6 +1184,11 @@ bool MsvcToolChain::operator ==(const ToolChain &other) const return m_varsBatArg == msvcTc->m_varsBatArg; } +void MsvcToolChain::cancelMsvcToolChainDetection() +{ + envModThreadPool()->clear(); +} + bool MsvcToolChainFactory::canRestore(const QVariantMap &data) { const Core::Id id = typeIdFromMap(data); diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 8cd39af2dc5..eca4d425ac0 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -79,6 +79,8 @@ public: bool operator == (const ToolChain &) const override; + static void cancelMsvcToolChainDetection(); + protected: explicit MsvcToolChain(Core::Id typeId, const QString &name, const Abi &abi, const QString &varsBat, const QString &varsBatArg, diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 56b30b3a996..50a5b2540c9 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1657,6 +1657,7 @@ ExtensionSystem::IPlugin::ShutdownFlag ProjectExplorerPlugin::aboutToShutdown() disconnect(ModeManager::instance(), &ModeManager::currentModeChanged, dd, &ProjectExplorerPluginPrivate::currentModeChanged); ProjectTree::aboutToShutDown(); + ToolChainManager::aboutToShutdown(); SessionManager::closeAllProjects(); dd->m_shuttingDown = true; diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index acaeb8b7d78..8694e2bdb07 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -27,6 +27,7 @@ #include "abi.h" #include "kitinformation.h" +#include "msvctoolchain.h" #include "toolchain.h" #include "toolchainsettingsaccessor.h" @@ -248,4 +249,9 @@ bool ToolChainManager::isLanguageSupported(const Core::Id &id) return Utils::contains(d->m_languages, Utils::equal(&LanguageDisplayPair::id, id)); } +void ToolChainManager::aboutToShutdown() +{ + MsvcToolChain::cancelMsvcToolChainDetection(); +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/toolchainmanager.h b/src/plugins/projectexplorer/toolchainmanager.h index 3fdcd981266..2e26431b84f 100644 --- a/src/plugins/projectexplorer/toolchainmanager.h +++ b/src/plugins/projectexplorer/toolchainmanager.h @@ -74,6 +74,8 @@ public: static QString displayNameOfLanguageId(const Core::Id &id); static bool isLanguageSupported(const Core::Id &id); + static void aboutToShutdown(); + void saveToolChains(); signals: From e06c8672ac85f8bba01e437ff9fbb06cdfd2653e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 16 Oct 2018 15:51:21 +0200 Subject: [PATCH 2/7] Add changes file for 4.7.2 Change-Id: I042c29592b46a4f094251d241dba442bc4d728c6 Reviewed-by: Leena Miettinen --- dist/changes-4.7.2.md | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 dist/changes-4.7.2.md diff --git a/dist/changes-4.7.2.md b/dist/changes-4.7.2.md new file mode 100644 index 00000000000..262463113f3 --- /dev/null +++ b/dist/changes-4.7.2.md @@ -0,0 +1,48 @@ +Qt Creator version 4.7.2 contains bug fixes. + +The most important changes are listed in this document. For a complete +list of changes, see the Git log for the Qt Creator sources that +you can check out from the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline origin/v4.7.1..v4.7.2 + +Editing + +* Fixed that collapsed text no longer showed up in tooltip (QTCREATORBUG-21040) +* Fixed crash with generic text completion (QTCREATORBUG-21192) + +C++ Support + +* Fixed wrong value of `__cplusplus` define (QTCREATORBUG-20884) +* Clang Code Model + * Fixed possible crash in `Follow Symbol Under Cursor` + * Fixed crash when using `Select Block Up/Down` with lambda + (QTCREATORBUG-20994) + +Debugging + +* CDB + * Fixed pretty printing of `std::vector` without Python (QTCREATORBUG-21074) + +Platform Specific + +Windows + +* Fixed saving of files when another application blocks atomic save operation + (QTCREATORBUG-7668) + +Remote Linux + +* Fixed superfluous empty lines in application output (QTCREATORBUG-19367) + +Credits for these changes go to: +David Schulz +Eike Ziller +Friedemann Kleint +Hannes Domani +Ivan Donchevskii +Jonathan Liu +Kai Köhne +Nikolai Kosjar +Sergey Belyashov From 5bc38589d8049d10d5c8401c27e576c5029aeacf Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 18 Oct 2018 11:33:18 +0200 Subject: [PATCH 3/7] Fix crash when adding file to sub folder in generic project The moment the file is added to the project, a reparse is triggered, which invalidates the tree sub-nodes. So we need to check if the context node (on which the wizard was opened) still exists before trying to access it, similar to how we do that in JsonSummaryPage::findWizardContextNode. Change-Id: I9154e000a31ea8d5d4ebc66c25528d422c377b94 Fixes: QTCREATORBUG-21342 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index c708dd5af44..894fadcfa45 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -31,6 +31,7 @@ #include "../project.h" #include "../projectexplorer.h" #include "../projectexplorerconstants.h" +#include "../projecttree.h" #include #include @@ -290,7 +291,7 @@ void JsonWizard::accept() openFiles(m_files); auto node = static_cast(value(ProjectExplorer::Constants::PREFERRED_PROJECT_NODE).value()); - if (node) // PREFERRED_PROJECT_NODE is not set for newly created projects + if (node && ProjectTree::hasNode(node)) // PREFERRED_PROJECT_NODE is not set for newly created projects openProjectForNode(node); } From 4dbc62a47e3e43e489b5a3b89f308bf8292285d9 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 18 Oct 2018 11:34:39 +0200 Subject: [PATCH 4/7] Fix soft assert when adding file to subfolder in generic project We can only select a node directly in the wizard summary page's project tree, if that is actually listed there. Task-number: QTCREATORBUG-21342 Change-Id: I52b3db8c38ae2bb59b3f6856e79354ca60a00140 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/projectwizardpage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 062439db64f..24b84a23d90 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -456,10 +456,11 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const QStringList & } root->prependChild(createNoneNode(&selector)); - // Set combobox to context node: + // Set combobox to context node if that appears in the tree: auto predicate = [context](TreeItem *ti) { return static_cast(ti)->node() == context; }; TreeItem *contextItem = root->findAnyChild(predicate); - m_ui->projectComboBox->setCurrentIndex(m_model.indexForItem(contextItem)); + if (contextItem) + m_ui->projectComboBox->setCurrentIndex(m_model.indexForItem(contextItem)); setAdditionalInfo(selector.deployingProjects()); setBestNode(selector.bestChoice()); From d810c5b77ffc0b09f3ded01cd2758dd13211b33c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 18 Oct 2018 15:14:48 +0200 Subject: [PATCH 5/7] Fix crash when pressing wrong shortcuts in welcome mode Fixes: QTCREATORBUG-21302 Change-Id: Ib7e50f3cbd3e6e8f995b8cda7ad965f0cafde511 Reviewed-by: Orgad Shaneh --- src/plugins/projectexplorer/projectwelcomepage.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index 9cf3167a24a..08842aabeaa 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -127,12 +127,18 @@ ProjectWelcomePage::ProjectWelcomePage() auto act = new QAction(tr("Open Session #%1").arg(i), this); Command *cmd = ActionManager::registerAction(act, sessionBase.withSuffix(i), welcomeContext); cmd->setDefaultKeySequence(QKeySequence((useMacShortcuts ? tr("Ctrl+Meta+%1") : tr("Ctrl+Alt+%1")).arg(i))); - connect(act, &QAction::triggered, this, [this, i] { openSessionAt(i - 1); }); + connect(act, &QAction::triggered, this, [this, i] { + if (i <= m_sessionModel->rowCount()) + openSessionAt(i - 1); + }); act = new QAction(tr("Open Recent Project #%1").arg(i), this); cmd = ActionManager::registerAction(act, projectBase.withSuffix(i), welcomeContext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+%1").arg(i))); - connect(act, &QAction::triggered, this, [this, i] { openProjectAt(i - 1); }); + connect(act, &QAction::triggered, this, [this, i] { + if (i <= m_projectModel->rowCount(QModelIndex())) + openProjectAt(i - 1); + }); } } From 17e6cb5ff714cdfe5c1519e9d7fcbdd1bba77fef Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 19 Oct 2018 10:43:38 +0200 Subject: [PATCH 6/7] ProjectExplorer: do not send non existing debug output Task-number: QTCREATORBUG-20848 Fixes: QTCREATORBUG-21215 Change-Id: I55366b42a94721ea800d0babe72f24d343d55de2 Reviewed-by: Christian Stenger Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/windebuginterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/projectexplorer/windebuginterface.cpp b/src/plugins/projectexplorer/windebuginterface.cpp index 985fec933f4..25aa953e645 100644 --- a/src/plugins/projectexplorer/windebuginterface.cpp +++ b/src/plugins/projectexplorer/windebuginterface.cpp @@ -177,6 +177,8 @@ void WinDebugInterface::dispatchDebugOutput() m_outputMutex.lock(); for (auto &entry : m_debugOutput) { std::vector &src = entry.second; + if (src.empty()) + continue; QString dst; size_t n = std::min(maxMessagesToSend, src.size()); for (size_t i = 0; i < n; ++i) From 496ecfc88a8b539a5a5ddbcbd7d0e88609824099 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 19 Oct 2018 15:51:17 +0200 Subject: [PATCH 7/7] Fix Linux & macOS build in release msvctoolchain.h/.cpp is only available on Windows (except if tests are enabled...) Change-Id: Id2ad5bd0945f1f1c21ca6a3a08e8bc4d5f50c3ed Reviewed-by: Orgad Shaneh Reviewed-by: David Schulz --- src/plugins/projectexplorer/toolchainmanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index 8694e2bdb07..3b95c5b41d7 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -251,7 +251,9 @@ bool ToolChainManager::isLanguageSupported(const Core::Id &id) void ToolChainManager::aboutToShutdown() { +#ifdef Q_OS_WIN MsvcToolChain::cancelMsvcToolChainDetection(); +#endif } } // namespace ProjectExplorer