forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/9.0'
Change-Id: Ie24672b00aae6c0afa5931d87e6e1c24fb841161
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -28,9 +28,12 @@ MimeType mimeTypeForFile(const QString &fileName, MimeMatchMode mode)
|
||||
MimeType mimeTypeForFile(const FilePath &filePath, MimeMatchMode mode)
|
||||
{
|
||||
MimeDatabase mdb;
|
||||
if (filePath.needsDevice())
|
||||
if (filePath.needsDevice() && mode != MimeMatchMode::MatchDefaultAndRemote)
|
||||
return mdb.mimeTypeForUrl(filePath.toUrl());
|
||||
return mdb.mimeTypeForFile(filePath.toString(), MimeDatabase::MatchMode(mode));
|
||||
if (mode == MimeMatchMode::MatchDefaultAndRemote) {
|
||||
mode = MimeMatchMode::MatchDefault;
|
||||
}
|
||||
return mdb.mimeTypeForFile(filePath.toFSPathString(), MimeDatabase::MatchMode(mode));
|
||||
}
|
||||
|
||||
QList<MimeType> mimeTypesForFileName(const QString &fileName)
|
||||
|
||||
@@ -15,7 +15,12 @@ class FilePath;
|
||||
// Wrapped QMimeDataBase functions
|
||||
QTCREATOR_UTILS_EXPORT MimeType mimeTypeForName(const QString &nameOrAlias);
|
||||
|
||||
enum class MimeMatchMode { MatchDefault = 0x0, MatchExtension = 0x1, MatchContent = 0x2 };
|
||||
enum class MimeMatchMode {
|
||||
MatchDefault = 0x0,
|
||||
MatchExtension = 0x1,
|
||||
MatchContent = 0x2,
|
||||
MatchDefaultAndRemote = 0x3
|
||||
};
|
||||
|
||||
QTCREATOR_UTILS_EXPORT MimeType mimeTypeForFile(const QString &fileName,
|
||||
MimeMatchMode mode = MimeMatchMode::MatchDefault);
|
||||
|
||||
@@ -39,7 +39,11 @@ void adjustFormatStyleForLineBreak(clang::format::FormatStyle &style,
|
||||
|
||||
// This is a separate pass, don't do it unless it's the full formatting.
|
||||
style.FixNamespaceComments = false;
|
||||
#if LLVM_VERSION_MAJOR >= 16
|
||||
style.AlignTrailingComments = {clang::format::FormatStyle::TCAS_Never, 0};
|
||||
#else
|
||||
style.AlignTrailingComments = false;
|
||||
#endif
|
||||
|
||||
if (replacementsToKeep == ReplacementsToKeep::IndentAndBefore)
|
||||
return;
|
||||
|
||||
@@ -49,7 +49,11 @@ clang::format::FormatStyle qtcStyle()
|
||||
#else
|
||||
style.AlignOperands = true;
|
||||
#endif
|
||||
#if LLVM_VERSION_MAJOR >= 16
|
||||
style.AlignTrailingComments = {FormatStyle::TCAS_Always, 0};
|
||||
#else
|
||||
style.AlignTrailingComments = true;
|
||||
#endif
|
||||
style.AllowAllParametersOfDeclarationOnNextLine = true;
|
||||
#if LLVM_VERSION_MAJOR >= 10
|
||||
style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
|
||||
|
||||
@@ -739,7 +739,8 @@ bool EditorManagerPrivate::skipOpeningBigTextFile(const FilePath &filePath)
|
||||
if (!filePath.exists())
|
||||
return false;
|
||||
|
||||
const MimeType mimeType = Utils::mimeTypeForFile(filePath);
|
||||
const MimeType mimeType = Utils::mimeTypeForFile(filePath,
|
||||
MimeMatchMode::MatchDefaultAndRemote);
|
||||
if (!mimeType.inherits("text/plain"))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -166,7 +166,8 @@ const EditorTypeList EditorType::defaultEditorTypes(const MimeType &mimeType)
|
||||
const EditorTypeList EditorType::preferredEditorTypes(const FilePath &filePath)
|
||||
{
|
||||
// default factories by mime type
|
||||
const Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath);
|
||||
const Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath,
|
||||
MimeMatchMode::MatchDefaultAndRemote);
|
||||
EditorTypeList factories = defaultEditorTypes(mimeType);
|
||||
// user preferred factory to front
|
||||
EditorType *userPreferred = Internal::userPreferredEditorTypes().value(mimeType);
|
||||
|
||||
@@ -175,7 +175,9 @@ QList<IWizardFactory*> IWizardFactory::allWizardFactories()
|
||||
QHash<Id, IWizardFactory *> sanityCheck;
|
||||
for (const FactoryCreator &fc : std::as_const(s_factoryCreators)) {
|
||||
IWizardFactory *newFactory = fc();
|
||||
QTC_ASSERT(newFactory, continue);
|
||||
// skip factories referencing wizard page generators provided by plugins not loaded
|
||||
if (!newFactory)
|
||||
continue;
|
||||
IWizardFactory *existingFactory = sanityCheck.value(newFactory->id());
|
||||
|
||||
QTC_ASSERT(existingFactory != newFactory, continue);
|
||||
|
||||
@@ -949,7 +949,8 @@ void MainWindow::openFile()
|
||||
static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fileFactories,
|
||||
const FilePath &filePath)
|
||||
{
|
||||
const QString typeName = Utils::mimeTypeForFile(filePath).name();
|
||||
const QString typeName = Utils::mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote)
|
||||
.name();
|
||||
return Utils::findOrDefault(fileFactories, [typeName](IDocumentFactory *f) {
|
||||
return f->mimeTypes().contains(typeName);
|
||||
});
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QScrollBar>
|
||||
#include <QTimer>
|
||||
#include <QToolTip>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWheelEvent>
|
||||
|
||||
@@ -100,6 +101,11 @@ LiteHtmlHelpViewer::LiteHtmlHelpViewer(QWidget *parent)
|
||||
&QLiteHtmlWidget::contextMenuRequested,
|
||||
this,
|
||||
&LiteHtmlHelpViewer::showContextMenu);
|
||||
connect(m_viewer, &QLiteHtmlWidget::linkHighlighted, this, [this](const QUrl &url) {
|
||||
m_highlightedLink = url;
|
||||
if (!url.isValid())
|
||||
QToolTip::hideText();
|
||||
});
|
||||
auto layout = new QVBoxLayout;
|
||||
setLayout(layout);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
@@ -284,6 +290,12 @@ bool LiteHtmlHelpViewer::eventFilter(QObject *src, QEvent *e)
|
||||
goForward(1);
|
||||
return true;
|
||||
}
|
||||
} else if (e->type() == QEvent::ToolTip) {
|
||||
auto he = static_cast<QHelpEvent *>(e);
|
||||
if (m_highlightedLink.isValid())
|
||||
QToolTip::showText(he->globalPos(),
|
||||
m_highlightedLink.toDisplayString(),
|
||||
m_viewer->viewport());
|
||||
}
|
||||
return HelpViewer::eventFilter(src, e);
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "helpviewer.h"
|
||||
#include "openpagesmanager.h"
|
||||
|
||||
#include <qlitehtmlwidget.h>
|
||||
|
||||
#include <QTextBrowser>
|
||||
#include <QUrl>
|
||||
|
||||
#include <optional>
|
||||
|
||||
@@ -68,6 +68,7 @@ private:
|
||||
QLiteHtmlWidget *m_viewer;
|
||||
std::vector<HistoryItem> m_backItems;
|
||||
std::vector<HistoryItem> m_forwardItems;
|
||||
QUrl m_highlightedLink;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -593,6 +593,11 @@ void updatePathsInExistingKits(const SettingsHandler::Ptr &settingsHandler)
|
||||
for (const auto &target : std::as_const(repo.mcuTargets)) {
|
||||
if (target->isValid()) {
|
||||
for (auto *kit : kitsWithMismatchedDependencies(target.get())) {
|
||||
if (kitQulVersion(kit) != target->qulVersion()) {
|
||||
//Do not update kits made for other Qt for MCUs SDK versions
|
||||
continue;
|
||||
}
|
||||
|
||||
auto changes = cMakeConfigToMap(CMakeConfigurationKitAspect::configuration(kit));
|
||||
|
||||
const auto updateForPackage = [&changes](const McuPackagePtr &package) {
|
||||
|
||||
@@ -30,23 +30,45 @@ using namespace Utils;
|
||||
|
||||
namespace McuSupport::Internal {
|
||||
|
||||
static const Utils::FilePath expandWildcards(const Utils::FilePath& path)
|
||||
// Utils::FileFilter do not support globbing with "*" placed in the middle of the path,
|
||||
// since it is required for paths such as "Microsoft Visual Studio/2019/*/VC/Tools/MSVC/*/bin/Hostx64/x64"
|
||||
// The filter is applied for each time a wildcard character is found in a path component.
|
||||
// Returns a pair of the longest path if multiple ones exists and the number of components that were not found.
|
||||
static const std::pair<Utils::FilePath, int> expandWildcards(
|
||||
const FilePath path, const QList<QStringView> patternComponents)
|
||||
{
|
||||
if (!path.fileName().contains("*") && !path.fileName().contains("?"))
|
||||
return path;
|
||||
// Only absolute paths are currently supported
|
||||
// Call FilePath::cleanPath on the path before calling this function
|
||||
if (!path.exists() || path.isRelativePath())
|
||||
return {path, patternComponents.size()};
|
||||
|
||||
const FilePath p = path.parentDir();
|
||||
// All components are found
|
||||
if (patternComponents.empty())
|
||||
return {path, patternComponents.size()};
|
||||
|
||||
auto entries = p.dirEntries(
|
||||
Utils::FileFilter({path.fileName()}, QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot));
|
||||
const QString currentComponent = patternComponents.front().toString();
|
||||
FilePath currentPath = path / currentComponent;
|
||||
|
||||
if (entries.isEmpty())
|
||||
return path;
|
||||
if (!currentComponent.contains("*") && !currentComponent.contains("?") && currentPath.exists())
|
||||
return expandWildcards(path / currentComponent,
|
||||
{patternComponents.constBegin() + 1, patternComponents.constEnd()});
|
||||
|
||||
auto entries = path.dirEntries(
|
||||
Utils::FileFilter({currentComponent}, QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot));
|
||||
|
||||
std::pair<FilePath, int> retPair = {path, patternComponents.size()};
|
||||
|
||||
// Return the last match (can correspond to the latest version)
|
||||
sort(entries, [](const FilePath &a, const FilePath &b) { return a.fileName() < b.fileName(); });
|
||||
for (const auto &entry : entries) {
|
||||
auto [entry_path, remaining_components] = expandWildcards(entry,
|
||||
{patternComponents.constBegin()
|
||||
+ 1,
|
||||
patternComponents.constEnd()});
|
||||
if (remaining_components <= retPair.second)
|
||||
retPair = {entry_path, remaining_components};
|
||||
}
|
||||
|
||||
return entries.last();
|
||||
return retPair;
|
||||
}
|
||||
|
||||
Macros *McuSdkRepository::globalMacros()
|
||||
@@ -60,7 +82,32 @@ void McuSdkRepository::expandVariablesAndWildcards()
|
||||
for (const auto &target : std::as_const(mcuTargets)) {
|
||||
auto macroExpander = getMacroExpander(*target);
|
||||
for (const auto &package : target->packages()) {
|
||||
package->setPath(expandWildcards(macroExpander->expand(package->path())));
|
||||
// Expand variables
|
||||
const auto path = macroExpander->expand(package->path());
|
||||
|
||||
//expand wildcards
|
||||
// Ignore expanding if no wildcards are found
|
||||
if (!path.path().contains("*") && !path.path().contains("?")) {
|
||||
package->setPath(path);
|
||||
continue;
|
||||
}
|
||||
|
||||
QStringList pathComponents = path.cleanPath().path().split("/");
|
||||
|
||||
// Path components example on linux: {"", "home", "username"}
|
||||
// Path components example on windows: {"C:", "Users", "username"}
|
||||
// 2 for empty_split_entry(linux)|root(windows) + at least one component
|
||||
if (pathComponents.size() < 2) {
|
||||
package->setPath(path);
|
||||
continue;
|
||||
}
|
||||
// drop empty_split_entry(linux)|root(windows)
|
||||
pathComponents.pop_front();
|
||||
|
||||
package->setPath(
|
||||
expandWildcards(FilePath::fromString(QDir::rootPath()),
|
||||
{pathComponents.constBegin(), pathComponents.constEnd()})
|
||||
.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,15 +362,15 @@ McuPackagePtr createStm32CubeProgrammerPackage(const SettingsHandler::Ptr &setti
|
||||
FilePath defaultPath;
|
||||
const QString cubePath = "STMicroelectronics/STM32Cube/STM32CubeProgrammer";
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
defaultPath = findInProgramFiles(cubePath) / "bin";
|
||||
defaultPath = findInProgramFiles(cubePath);
|
||||
else
|
||||
defaultPath = FileUtils::homePath() / cubePath / "bin";
|
||||
defaultPath = FileUtils::homePath() / cubePath;
|
||||
if (!defaultPath.exists())
|
||||
FilePath defaultPath = {};
|
||||
|
||||
const FilePath detectionPath = FilePath::fromUserInput(
|
||||
QLatin1String(Utils::HostOsInfo::isWindowsHost() ? "STM32_Programmer_CLI.exe"
|
||||
: "STM32_Programmer.sh"));
|
||||
QLatin1String(Utils::HostOsInfo::isWindowsHost() ? "bin/STM32_Programmer_CLI.exe"
|
||||
: "bin/STM32_Programmer.sh"));
|
||||
|
||||
return McuPackagePtr{
|
||||
new McuPackage(settingsHandler,
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto armgcc_stm32f469i_discovery_baremetal_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto armgcc_stm32f769i_discovery_baremetal_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto armgcc_stm32f769i_discovery_freertos_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto armgcc_stm32h750b_discovery_baremetal_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto iar_stm32f469i_discovery_baremetal_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto iar_stm32f769i_discovery_baremetal_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto iar_stm32f769i_discovery_freertos_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -20,12 +20,12 @@ constexpr auto iar_stm32h750b_discovery_baremetal_json = R"(
|
||||
"type": "path",
|
||||
"setting": "Stm32CubeProgrammer",
|
||||
"defaultValue": {
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin"
|
||||
"windows": "%{Env:PROGRAMFILES}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/",
|
||||
"linux": "%{Env:HOME}/STMicroelectronics/STM32Cube/STM32CubeProgrammer/"
|
||||
},
|
||||
"detectionPath": {
|
||||
"windows": "STM32_Programmer_CLI.exe",
|
||||
"linux": "STM32_Programmer.sh"
|
||||
"windows": "bin/STM32_Programmer_CLI.exe",
|
||||
"linux": "bin/STM32_Programmer.sh"
|
||||
},
|
||||
"optional": false,
|
||||
"addToSystemPath": true
|
||||
|
||||
@@ -141,10 +141,10 @@ const QString xpressoIdeDetectionPath{
|
||||
|
||||
const char stmCubeProgrammerSetting[]{"Stm32CubeProgrammer"};
|
||||
const char stmCubeProgrammerLabel[]{"STM32CubeProgrammer"};
|
||||
const QString stmCubeProgrammerPath{QString{defaultToolPath} + "/bin"};
|
||||
const QString stmCubeProgrammerPath{defaultToolPath};
|
||||
const QString stmCubeProgrammerDetectionPath{HostOsInfo::isWindowsHost()
|
||||
? QString("STM32_Programmer_CLI.exe")
|
||||
: QString("STM32_Programmer.sh")};
|
||||
? QString("bin/STM32_Programmer_CLI.exe")
|
||||
: QString("bin/STM32_Programmer.sh")};
|
||||
|
||||
const char renesasProgrammerSetting[]{"RenesasFlashProgrammer"};
|
||||
const char renesasProgrammerCmakeVar[]{"RENESAS_FLASH_PROGRAMMER_PATH"};
|
||||
@@ -1703,31 +1703,43 @@ void McuSupportTest::test_addToSystemPathFlag()
|
||||
void McuSupportTest::test_processWildcards_data()
|
||||
{
|
||||
QTest::addColumn<QString>("package_label");
|
||||
QTest::addColumn<QString>("path");
|
||||
QTest::addColumn<bool>("isFile");
|
||||
QTest::addColumn<QString>("expected_path");
|
||||
QTest::addColumn<QStringList>("paths");
|
||||
|
||||
QTest::newRow("\"*\" at the end") << "FAKE_WILDCARD_TEST_1"
|
||||
<< "folder-123" << false;
|
||||
QTest::newRow("\"*\" in the middle") << "FAKE_WILDCARD_TEST_2"
|
||||
<< "file-123.exe" << true;
|
||||
QTest::newRow("\"*\" at the start") << "FAKE_WILDCARD_TEST_3"
|
||||
<< "123-file.exe" << true;
|
||||
QTest::newRow("wildcard_at_the_end") << "FAKE_WILDCARD_TEST_1" << "folder-123" << QStringList {"folder-123/" };
|
||||
QTest::newRow("wildcard_in_th_middle") << "FAKE_WILDCARD_TEST_2" << "file-123.exe" << QStringList {"file-123.exe"};
|
||||
QTest::newRow("wildcard_at_the_end") << "FAKE_WILDCARD_TEST_3" << "123-file.exe" << QStringList( "123-file.exe");
|
||||
QTest::newRow("multi_wildcards")
|
||||
<< "FAKE_WILDCARD_TEST_MULTI"
|
||||
<< "2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64"
|
||||
<< QStringList{
|
||||
"2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/",
|
||||
"2019/Alpha/Beta/Gamma/",
|
||||
"2019/Community/VC/Tools/MSVC/",
|
||||
"2019/Community/VC/Tools/MSVC/14.29.30133/bin/",
|
||||
"2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/",
|
||||
"2019/Enterprise/VC/Tools/MSVC/",
|
||||
};
|
||||
}
|
||||
|
||||
void McuSupportTest::test_processWildcards()
|
||||
{
|
||||
QFETCH(QString, package_label);
|
||||
QFETCH(QString, path);
|
||||
QFETCH(bool, isFile);
|
||||
QFETCH(QString, expected_path);
|
||||
QFETCH(QStringList, paths);
|
||||
|
||||
QVERIFY(createFakePath(testing_output_dir / "wildcards" / path, isFile));
|
||||
for (const auto &path : paths)
|
||||
QVERIFY(createFakePath(testing_output_dir / "wildcards" / path, !path.endsWith("/")));
|
||||
|
||||
auto [targets, packages] = createTestingKitTargetsAndPackages(wildcards_test_kit);
|
||||
auto testWildcardsPackage = findOrDefault(packages, [&](const McuPackagePtr &pkg) {
|
||||
return (pkg->label() == package_label);
|
||||
});
|
||||
QVERIFY(testWildcardsPackage != nullptr);
|
||||
QCOMPARE(testWildcardsPackage->path().toString(), FilePath(testing_output_dir / "wildcards" / path).toString());
|
||||
QVERIFY(paths.size() > 0);
|
||||
// FilePaths with "/" at the end and without it evaluate to different paths.
|
||||
QCOMPARE(testWildcardsPackage->path(),
|
||||
FilePath(testing_output_dir / "wildcards" / expected_path));
|
||||
}
|
||||
|
||||
void McuSupportTest::test_nonemptyVersionDetector()
|
||||
|
||||
@@ -34,6 +34,13 @@ constexpr auto wildcards_test_kit = R"(
|
||||
"defaultValue": "%{MCU_TESTING_FOLDER}/wildcards/*-file.exe",
|
||||
"envVar": "",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"label": "FAKE_WILDCARD_TEST_MULTI",
|
||||
"description": "Assert '*' is replaced by possible values",
|
||||
"defaultValue": "%{MCU_TESTING_FOLDER}/wildcards/2019/*/VC/Tools/MSVC/*/bin/Hostx64/x64",
|
||||
"envVar": "",
|
||||
"type": "path"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -732,7 +732,7 @@ Core::IDocument::OpenResult TextDocument::open(QString *errorString,
|
||||
emit aboutToOpen(filePath, realFilePath);
|
||||
OpenResult success = openImpl(errorString, filePath, realFilePath, /*reload =*/ false);
|
||||
if (success == OpenResult::Success) {
|
||||
setMimeType(Utils::mimeTypeForFile(filePath).name());
|
||||
setMimeType(Utils::mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote).name());
|
||||
emit openFinishedSuccessfully();
|
||||
}
|
||||
return success;
|
||||
|
||||
@@ -3343,7 +3343,9 @@ void TextEditorWidgetPrivate::updateFileLineEndingVisible()
|
||||
|
||||
void TextEditorWidgetPrivate::reconfigure()
|
||||
{
|
||||
m_document->setMimeType(Utils::mimeTypeForFile(m_document->filePath()).name());
|
||||
m_document->setMimeType(
|
||||
Utils::mimeTypeForFile(m_document->filePath(),
|
||||
MimeMatchMode::MatchDefaultAndRemote).name());
|
||||
q->configureGenericHighlighter();
|
||||
}
|
||||
|
||||
|
||||
Submodule src/shared/qbs updated: 8cfaf76b17...3cc4f248c0
@@ -14,6 +14,7 @@
|
||||
:*Qt Creator_Utils::FilterLineEdit {type='Utils::FancyLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:*Qt Creator_Utils::IconButton {occurrence='4' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
|
||||
:About Qt Creator_Core::Internal::VersionDialog {type='Core::Internal::VersionDialog' unnamed='1' visible='1' windowTitle='About Qt Creator'}
|
||||
:Activate completion:_QComboBox {buddy=':Behavior.Activate completion:_QLabel' type='QComboBox' unnamed='1' visible='1'}
|
||||
:Add Bookmark.ExpandBookmarksList_QToolButton {text='+' type='QToolButton' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'}
|
||||
:Add Bookmark.New Folder_QPushButton {text='New Folder' type='QPushButton' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'}
|
||||
:Add Bookmark.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'}
|
||||
@@ -26,8 +27,8 @@
|
||||
:Analyzer Toolbar.Clear_QToolButton {container=':DebugModeWidget.Toolbar_QDockWidget' toolTip='Discard data' type='QToolButton' unnamed='1' visible='1'}
|
||||
:Analyzer Toolbar.Elapsed:_QLabel {container=':DebugModeWidget.Toolbar_QDockWidget' text~='Elapsed: \\\\d+.\\\\d s' type='QLabel' unnamed='1' visible='1'}
|
||||
:Analyzer Toolbar.Start_QToolButton {container=':DebugModeWidget.Toolbar_QDockWidget' text='Start' type='QToolButton' unnamed='1' visible='1'}
|
||||
:Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'}
|
||||
:Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'}
|
||||
:Behavior.Activate completion:_QLabel {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' text='Activate completion:' type='QLabel' unnamed='1' visible='1'}
|
||||
:Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' text='Autocomplete common prefix' type='QCheckBox' unnamed='1' visible='1'}
|
||||
:Breakpoints_Debugger::Internal::BreakTreeView {container=':Debugger.Docks.BreakDockWidget.Debugger.Docks.Break_QFrame' type='Utils::BaseTreeView' unnamed='1' visible='1'}
|
||||
:Build and Run.Save all files before build_QCheckBox {container=':Build and Run_QGroupBox' text='Save all files before build' type='QCheckBox' unnamed='1' visible='1'}
|
||||
:Build and Run_QGroupBox {container=':qt_tabwidget_stackedwidget_QScrollArea' name='Build and Run' type='QGroupBox' visible='1'}
|
||||
@@ -43,7 +44,7 @@
|
||||
:Core__Internal__GeneralSettings.User Interface_QGroupBox {container=':qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget' name='interfaceBox' title='User Interface' type='QGroupBox' visible='1'}
|
||||
:CppCompiler:_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':CppCompiler:_QLabel' type='QComboBox' unnamed='1' visible='1'}
|
||||
:CppCompiler:_QLabel {container=':qt_tabwidget_stackedwidget_QWidget' text='C++:' type='QLabel' unnamed='1' visible='1'}
|
||||
:CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget_QScrollArea' name='groupBox' title='Behavior' type='QGroupBox' visible='1'}
|
||||
:CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget_QScrollArea' name='Behavior' type='QGroupBox' visible='1'}
|
||||
:DebugModeWidget.Debugger Log_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='GlobalLogDockWidget' type='QDockWidget' visible='1'}
|
||||
:DebugModeWidget.Debugger.Docks.BreakDockWidget_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='Debugger.Docks.BreakpointManagerDockWidget' type='QDockWidget' visible='1'}
|
||||
:DebugModeWidget.Debugger.Docks.LocalsAndInspectorDockWidget_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name~='Debugger\\\\.Dock\\\\.LocalsAndInspector\\\\.\\\\d+DockWidget' type='QDockWidget' visible='1'}
|
||||
|
||||
@@ -44,7 +44,7 @@ def changeAutocompleteToManual(toManual=True):
|
||||
activateCompletion = "Always"
|
||||
if toManual:
|
||||
activateCompletion = "Manually"
|
||||
selectFromCombo(":Behavior.completionTrigger_QComboBox", activateCompletion)
|
||||
selectFromCombo(":Activate completion:_QComboBox", activateCompletion)
|
||||
verifyEnabled(":Options.OK_QPushButton")
|
||||
clickButton(waitForObject(":Options.OK_QPushButton"))
|
||||
|
||||
|
||||
@@ -53,6 +53,6 @@ def main():
|
||||
type(editorWidget, "<Ctrl+Shift+u>")
|
||||
# wait until search finished and verify search results
|
||||
waitForSearchResults()
|
||||
validateSearchResult(5 if JIRA.isBugStillOpen(2863) else 3)
|
||||
validateSearchResult(3 if useClang else 5)
|
||||
invokeMenuItem("File", "Exit")
|
||||
waitForCleanShutdown()
|
||||
|
||||
Reference in New Issue
Block a user