diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index 94dee184de5..860c7df2b6a 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -391,10 +391,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 {}; } @@ -1075,7 +1078,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, diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp index b901136fb33..7bea625aad4 100644 --- a/src/plugins/android/androidplugin.cpp +++ b/src/plugins/android/androidplugin.cpp @@ -127,10 +127,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(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 24aa055905c..6c33082be0a 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -214,7 +214,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; diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index e561cf4385d..9854991f3d8 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -795,10 +795,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); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 59d6d50a5b7..375afaa00b5 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4408,6 +4408,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(); @@ -4430,13 +4437,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}); 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: 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() diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 6a7faeffb2d..0b2f1dea624 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -210,7 +210,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")