From c4e938b407674b99b9570cc6986059ac2541e122 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 8 Jan 2024 20:57:01 +0100 Subject: [PATCH 1/9] Android: Resuscitate the "Configure Android options" InfoBar entry The restoring of Kits was moved to a later stage of the startup sequence. That is too late to connect to ICore::coreOpened. This change calls askUserAboutAndroidSetup directly instead of via connection. Fixes: QTCREATORBUG-30131 Change-Id: I9b33df42177de05f2f9132ff3126fe03ffb8df20 Reviewed-by: hjk --- src/plugins/android/androidplugin.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index 9eeee4dad29..0430973b5df 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -126,10 +126,8 @@ void AndroidPlugin::kitsRestored() return v->targetDeviceTypes().contains(Android::Constants::ANDROID_DEVICE_TYPE); }).isEmpty(); - if (!AndroidConfigurations::currentConfig().sdkFullyConfigured() && qtForAndroidInstalled) { - connect(Core::ICore::instance(), &Core::ICore::coreOpened, this, - &AndroidPlugin::askUserAboutAndroidSetup, Qt::QueuedConnection); - } + if (!AndroidConfigurations::currentConfig().sdkFullyConfigured() && qtForAndroidInstalled) + askUserAboutAndroidSetup(); AndroidConfigurations::registerNewToolChains(); AndroidConfigurations::updateAutomaticKitList(); From 7942c36ace1e808366f545b2e0da22842c9b1bc5 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 8 Jan 2024 16:57:09 +0100 Subject: [PATCH 2/9] Debugger: Fix passing of solib search path Amends 92f7da917ea7e. Also, set it in all branches, not just remote execution, even if this is the primary and currently actively used way. Change-Id: I35149bd29b49dab419f83ec0cb424ae9b23827ed Reviewed-by: Christian Stenger --- src/plugins/debugger/gdb/gdbengine.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 09755f68e6d..70fccf669e1 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4407,6 +4407,13 @@ void GdbEngine::setupInferior() if (rp.breakOnMain) runCommand({"tbreak " + mainFunction()}); + if (!rp.solibSearchPath.isEmpty()) { + DebuggerCommand cmd("appendSolibSearchPath"); + cmd.arg("path", transform(rp.solibSearchPath, &FilePath::path)); + cmd.arg("separator", HostOsInfo::pathListSeparator()); + runCommand(cmd); + } + if (rp.startMode == AttachToRemoteProcess) { handleInferiorPrepared(); @@ -4429,13 +4436,6 @@ void GdbEngine::setupInferior() // if (!remoteArch.isEmpty()) // postCommand("set architecture " + remoteArch); - if (!rp.solibSearchPath.isEmpty()) { - DebuggerCommand cmd("appendSolibSearchPath"); - for (const FilePath &filePath : rp.solibSearchPath) - cmd.arg("path", filePath.path()); - cmd.arg("separator", HostOsInfo::pathListSeparator()); - runCommand(cmd); - } if (!args.isEmpty()) runCommand({"-exec-arguments " + args}); From 99078778cc0783f0d093e46ddb36549c3fc395c4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 9 Jan 2024 08:14:19 +0100 Subject: [PATCH 3/9] Terminal: Fix selection warning When quickly selection text via double-clicking and moving the mouse to the left it is possible that a selection is created where the start == end. This was incorrectly reported as a warning. Task-number: QTCREATORBUG-30144 Change-Id: I37b22f4ee725e5085ce0090c123ccfd9980b8a59 Reviewed-by: Reviewed-by: Christian Stenger --- src/libs/solutions/terminal/terminalview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index 2244ea62d73..210ede1b794 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -386,10 +386,13 @@ QString TerminalView::textFromSelection() const if (!d->m_selection) return {}; + if (d->m_selection->start == d->m_selection->end) + return {}; + CellIterator it = d->m_surface->iteratorAt(d->m_selection->start); CellIterator end = d->m_surface->iteratorAt(d->m_selection->end); - if (it.position() >= end.position()) { + if (it.position() > end.position()) { qCWarning(selectionLog) << "Invalid selection: start >= end"; return {}; } From 060d4faed7c991ab3be9663d1b332bd7e84b535f Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 9 Jan 2024 08:19:40 +0100 Subject: [PATCH 4/9] Terminal: Fix nullopt access Fixes: QTCREATORBUG-30144 Change-Id: I9479d4cbfd8f930f405409c1c3f5252d23cca2da Reviewed-by: David Schulz --- src/libs/solutions/terminal/terminalview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index 210ede1b794..1d3779955af 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -1073,7 +1073,7 @@ void TerminalView::mousePressEvent(QMouseEvent *event) } if (event->button() == Qt::LeftButton) { - if (std::chrono::system_clock::now() - d->m_lastDoubleClick < 500ms) { + if (d->m_selection && std::chrono::system_clock::now() - d->m_lastDoubleClick < 500ms) { d->m_selectLineMode = true; const Selection newSelection{d->m_surface->gridToPos( {0, From 7fdfc2ac1df3c7d1ff5d19ad76ac0fe65bcb661c Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 9 Jan 2024 12:59:44 +0100 Subject: [PATCH 5/9] Auto-Setup: Forward CMAKE_MSVC_RUNTIME_LIBRARY to package manager Fixes: QTCREATORBUG-30169 Change-Id: Icfbb497e067c5a5a4b57e91c9fa50bc0a2816bc3 Reviewed-by: Alessandro Portale --- src/share/3rdparty/package-manager/auto-setup.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/share/3rdparty/package-manager/auto-setup.cmake b/src/share/3rdparty/package-manager/auto-setup.cmake index 2b14e4ae2b9..a2e30686f9f 100644 --- a/src/share/3rdparty/package-manager/auto-setup.cmake +++ b/src/share/3rdparty/package-manager/auto-setup.cmake @@ -32,10 +32,11 @@ macro(qtc_auto_setup_compiler_standard toolchainFile) endforeach() endforeach() - foreach(osx_var CMAKE_SYSROOT CMAKE_OSX_SYSROOT CMAKE_OSX_ARCHITECTURES) - if (${osx_var}) + # Forward important CMake variables to the package manager in the toolchain file + foreach(fwd_var CMAKE_MSVC_RUNTIME_LIBRARY CMAKE_SYSROOT CMAKE_OSX_SYSROOT CMAKE_OSX_ARCHITECTURES) + if (${fwd_var}) file(APPEND "${toolchainFile}" - "set(${osx_var} ${${osx_var}})\n") + "set(${fwd_var} ${${fwd_var}})\n") endif() endforeach() endmacro() From 72c0ff37fcb4b4cdcb07f3ca4b3ae8890c8ca2b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Thu, 4 Jan 2024 13:25:49 +0100 Subject: [PATCH 6/9] SquishTests: Expect symlinked compilers e.g. /usr/bin/clang links to ../lib/llvm-14/bin/clang on Ubuntu 22.04. Change-Id: I6facd3126045036124e6c79ee83bc7575cbb02d7 Reviewed-by: Christian Stenger --- tests/system/suite_general/tst_default_settings/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 95391864c24..a91ddb5245d 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -207,7 +207,8 @@ def __getExpectedCompilers__(): for c in ('clang++', 'clang', 'afl-clang', 'clang-[0-9]', 'clang-[0-9].[0-9]', 'clang-1[0-9]', 'clang-1[0-9].[0-9]', '*g++*', '*gcc*'): - compilers.extend(findAllFilesInPATH(c)) + filesInPath = set(findAllFilesInPATH(c)) + compilers.extend(filesInPath | set(map(os.path.realpath, filesInPath))) if platform.system() == 'Darwin': for compilerExe in ('clang++', 'clang'): xcodeClang = getOutputFromCmdline(["xcrun", "--find", compilerExe]).strip("\n") From 7a46bbe66739015528696e0ff74359fc95a779f7 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 9 Jan 2024 18:59:33 +0100 Subject: [PATCH 7/9] CMakePM: Do not add files to utility targets On multi-config systems CMake is reporting "ALL_BUILD" or "ZERO_CHECK" as targets to add files to. When issued from menu File > Add New ... the selected target is the first target namely "ALL_BUILD", which is a utility target and cannot have source files. Fixes: QTCREATORBUG-30170 Change-Id: I7617978c01f0a2554a3ec7d52ef9baaa16ed7a84 Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index ee2bbcf4a80..9ed58160eaf 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -216,7 +216,8 @@ void CMakeBuildSystem::requestDebugging() bool CMakeBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const { - if (dynamic_cast(context)) + const auto cmakeTarget = dynamic_cast(context); + if (cmakeTarget && cmakeTarget->productType() != ProductType::Other) return action == ProjectAction::AddNewFile || action == ProjectAction::AddExistingFile || action == ProjectAction::AddExistingDirectory || action == ProjectAction::Rename || action == ProjectAction::RemoveFile; From c07b45348625454d9d0eb9e90d765290e0b7de09 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 5 Jan 2024 15:27:45 +0100 Subject: [PATCH 8/9] Examples: Fix reading the category ordering from manifest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtcreator_tutorials.xml contains ordering information for the tutorials, and if we read that (first) we ignore any subsequent ordering that the set of Qt examples defines (in qtdoc/examples-manifest.xml). Only read the tutorials.xml if we are actually interested in tutorials. Amends 08bbe885b49d6782178f0bc7b19c1bb162633666 Change-Id: I9148cc9f1060500f46be2bbc9c9ef6c2512c2f6c Reviewed-by: Reviewed-by: Christian Stenger Reviewed-by: Kai Köhne --- src/plugins/qtsupport/exampleslistmodel.cpp | 12 ++++++++---- src/plugins/qtsupport/exampleslistmodel.h | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 3d67706b77f..d8593cb1fd8 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -363,7 +363,8 @@ void ExamplesViewController::updateExamples() const QStringList sources = m_exampleSetModel->exampleSources(&examplesInstallPath, &demosInstallPath, - &qtVersion); + &qtVersion, + m_isExamples); QStringList categoryOrder; QList items; for (const QString &exampleSource : sources) { @@ -493,12 +494,15 @@ QtVersion *ExampleSetModel::findHighestQtVersion(const QtVersions &versions) con QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath, QString *demosInstallPath, - QVersionNumber *qtVersion) + QVersionNumber *qtVersion, + bool isExamples) { QStringList sources; - // Qt Creator shipped tutorials - sources << ":/qtsupport/qtcreator_tutorials.xml"; + if (!isExamples) { + // Qt Creator shipped tutorials + sources << ":/qtsupport/qtcreator_tutorials.xml"; + } QString examplesPath; QString demosPath; diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index 142f1c72f6c..a54ac8bc7b7 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -41,7 +41,8 @@ public: bool selectExampleSet(int index); QStringList exampleSources(QString *examplesInstallPath, QString *demosInstallPath, - QVersionNumber *qtVersion); + QVersionNumber *qtVersion, + bool isExamples); bool selectedQtSupports(const Utils::Id &target) const; signals: From 542ae405fcf8775d68218fd03f153b867f63ba18 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 20 Dec 2023 09:34:59 +0100 Subject: [PATCH 9/9] Welcome: Avoid duplicate examples when searching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding examples for a category/section we also add them to the list of all examples. To avoid ownership issues we duplicate examples when they appear in multiple categories, but that means that the existing mechanism of filtering duplicates based on item pointer does no longer work. Filter duplicates based on name+description. It would possibly be nicer to give the examples IDs (serial numbers) when reading them and just using that for filtering duplicates, but that isn't possible in a binary compatible manner atm. Fixes: QTCREATORBUG-30069 Change-Id: I0ee9ef7b86955af5ee8ccdb9c5683ced81097671 Reviewed-by: Kai Köhne Reviewed-by: Christian Stenger Reviewed-by: --- src/plugins/coreplugin/welcomepagehelper.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index d80942f13d4..d12e427b2fc 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -811,10 +811,24 @@ ListModel *SectionedGridView::addSection(const Section §ion, const QListinsertWidget(position, sectionLabel); vbox->insertWidget(position + 1, gridView); + struct ItemHash + { + std::size_t operator()(ListItem *item) const { return std::hash{}(item->name); } + }; + struct ItemEqual + { + bool operator()(ListItem *lhs, ListItem *rhs) const + { + return lhs->name == rhs->name && lhs->description == rhs->description; + } + }; + // add the items also to the all products model to be able to search correctly - const QSet allItems = toSet(m_allItemsModel->items()); - const QList newItems = filtered(items, [&allItems](ListItem *item) { - return !allItems.contains(item); + const QList allItems = m_allItemsModel->items(); + const std::unordered_set uniqueItems{allItems.constBegin(), + allItems.constEnd()}; + const QList newItems = filtered(items, [&uniqueItems](ListItem *item) { + return uniqueItems.find(item) == uniqueItems.end(); }); m_allItemsModel->appendItems(newItems);