From 57d6adff740b430713dd9dadce662a3f0b944094 Mon Sep 17 00:00:00 2001 From: Igor Jarek Date: Tue, 22 Feb 2022 16:44:02 +0100 Subject: [PATCH 1/4] the plugin has been updated from QT Creator 4.15.2 to 5.0.3 --- Asn1Acn.json.in | 4 +-- src/asn1acnbuildstep.cpp | 2 +- src/kitaspect.cpp | 19 ++++++++----- src/kitaspect.h | 3 ++- src/kitaspectwidget.cpp | 15 +++++------ src/kitaspectwidget.h | 8 +++--- src/libraries/componentimporter.cpp | 27 ++++++++++--------- src/libraries/componentimporter.h | 21 ++++++++------- src/libraries/wizard/componentselector.h | 4 +-- .../wizard/filecomponentselector.cpp | 16 +++++------ src/libraries/wizard/filecomponentselector.h | 8 +++--- .../wizard/metadatacomponentselector.cpp | 25 +++++++++-------- .../wizard/metadatacomponentselector.h | 6 ++--- src/libraries/wizard/summarypage.cpp | 2 +- src/libraries/wizard/vcshandler.cpp | 11 +++++--- src/libraries/wizard/vcshandler.h | 3 ++- src/linkcreator.cpp | 4 +-- src/settings/fuzzer.cpp | 2 +- src/settings/libraries.cpp | 4 +-- src/settings/service.cpp | 2 +- src/tests/linkcreator_tests.cpp | 12 ++++----- .../wizards/projects/asn1acn/CMakeLists.txt | 17 ++++++------ .../projects/asn1acn/createFilesList.cmake | 10 ++++++- .../projects/asn1acn/handleAsn1AcnBuild.pri | 2 +- .../projects/asn1acn/updateSourcesList.pri | 11 +++++--- 25 files changed, 132 insertions(+), 106 deletions(-) diff --git a/Asn1Acn.json.in b/Asn1Acn.json.in index ba0db6ad..1785b950 100644 --- a/Asn1Acn.json.in +++ b/Asn1Acn.json.in @@ -1,7 +1,7 @@ { \"Name\" : \"ASN.1/ACN\", - \"Version\" : \"4.15.2\", - \"CompatVersion\" : \"4.15.0\", + \"Version\" : \"5.0.3\", + \"CompatVersion\" : \"5.0.0\", \"Vendor\" : \"N7 Space sp. z o.o.\", \"Copyright\" : \"(C) 2017-2022 N7 Space sp. z o.o.\", \"License\" : \"GPL v3.0\", diff --git a/src/asn1acnbuildstep.cpp b/src/asn1acnbuildstep.cpp index 5f07fa0c..9c7218df 100644 --- a/src/asn1acnbuildstep.cpp +++ b/src/asn1acnbuildstep.cpp @@ -72,6 +72,6 @@ void Asn1AcnBuildStep::updateProcess(const QString &command, const QString &arg) { auto *pp = processParameters(); Utils::CommandLine commandLine(command); - commandLine.addArg(arg); + commandLine.addArgs(arg, Utils::CommandLine::Raw); pp->setCommandLine(commandLine); } diff --git a/src/kitaspect.cpp b/src/kitaspect.cpp index 52d5264b..22af9ce5 100644 --- a/src/kitaspect.cpp +++ b/src/kitaspect.cpp @@ -40,7 +40,7 @@ KitAspect::KitAspect() { setObjectName(QLatin1String("Asn1SccKitAspect")); setId(KitAspect::id()); - setDisplayName(tr("ASN1SCC:")); + setDisplayName(tr("ASN1SCC")); setPriority(12000); } @@ -72,10 +72,19 @@ void KitAspect::setAsn1Exe(Kit *k, const Utils::FilePath &v) QVariant KitAspect::defaultValue(const Kit *k) const { Q_UNUSED(k); - const QString path = Core::ICore::libexecPath() + QLatin1String("/asn1scc/asn1.exe"); + const QString path = Core::ICore::libexecPath().toString() + QLatin1String("/asn1scc/asn1scc"); return path; } +void KitAspect::setup(Kit *k) +{ + if (!k) + return; + + if (!k->hasValue(id())) + k->setValue(id(), defaultValue(k)); +} + ProjectExplorer::Tasks KitAspect::validate(const Kit *k) const { ProjectExplorer::Tasks result; @@ -113,14 +122,12 @@ ProjectExplorer::KitAspectWidget *KitAspect::createConfigWidget(Kit *kit) const return new KitAspectWidget(kit, this); } -void KitAspect::addToEnvironment(const Kit *k, Utils::Environment &env) const +void KitAspect::addToBuildEnvironment(const Kit *k, Utils::Environment &env) const { env.set(QLatin1String("ASN1SCC"), asn1Exe(k).toUserOutput()); } void KitAspect::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const { - expander->registerFileVariables("Asn1Scc", tr("ASN1SCC Path"), [kit]() -> QString { - return asn1Exe(kit).toString(); - }); + expander->registerFileVariables("Asn1Scc", tr("ASN1SCC Path"), [kit] { return asn1Exe(kit); }); } diff --git a/src/kitaspect.h b/src/kitaspect.h index 84829037..98c632ce 100644 --- a/src/kitaspect.h +++ b/src/kitaspect.h @@ -43,12 +43,13 @@ class KitAspect : public ProjectExplorer::KitAspect static Utils::FilePath asn1Exe(const Kit *k); static void setAsn1Exe(Kit *k, const Utils::FilePath &v); + void setup(Kit *k) override; ProjectExplorer::Tasks validate(const Kit *k) const override; ItemList toUserOutput(const Kit *kit) const override; ProjectExplorer::KitAspectWidget *createConfigWidget(Kit *kit) const override; - void addToEnvironment(const Kit *k, Utils::Environment &env) const override; + void addToBuildEnvironment(const Kit *k, Utils::Environment &env) const override; void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override; private: diff --git a/src/kitaspectwidget.cpp b/src/kitaspectwidget.cpp index 2d29521c..8bb6c558 100644 --- a/src/kitaspectwidget.cpp +++ b/src/kitaspectwidget.cpp @@ -22,15 +22,16 @@ ** along with this program. If not, see . ** ****************************************************************************/ -#include "kitaspectwidget.h" +#include #include "kitaspect.h" +#include "kitaspectwidget.h" using namespace Asn1Acn::Internal; KitAspectWidget::KitAspectWidget(ProjectExplorer::Kit *kit, const ProjectExplorer::KitAspect *ka) : ProjectExplorer::KitAspectWidget(kit, ka) - , m_chooser(new Utils::PathChooser) + , m_chooser(createSubWidget()) { m_chooser->setToolTip(tr("Path to ASN1SCC executable.")); m_chooser->setExpectedKind(Utils::PathChooser::ExistingCommand); @@ -62,12 +63,8 @@ void KitAspectWidget::makeReadOnly() m_chooser->setReadOnly(true); } -QWidget *KitAspectWidget::mainWidget() const -{ - return m_chooser->lineEdit(); -} - -QWidget *KitAspectWidget::buttonWidget() const +void KitAspectWidget::addToLayout(Utils::LayoutBuilder &builder) { - return m_chooser->buttonAtIndex(0); + addMutableAction(m_chooser); + builder.addItem(Utils::Layouting::Span(2, m_chooser)); } diff --git a/src/kitaspectwidget.h b/src/kitaspectwidget.h index b4055ee2..4e6e89c9 100644 --- a/src/kitaspectwidget.h +++ b/src/kitaspectwidget.h @@ -27,6 +27,10 @@ #include #include +namespace Utils { +class LayoutBuilder; +} + namespace Asn1Acn { namespace Internal { @@ -40,11 +44,9 @@ class KitAspectWidget : public ProjectExplorer::KitAspectWidget void makeReadOnly() override; void refresh() override; - QWidget *mainWidget() const override; - QWidget *buttonWidget() const override; - private: void pathWasChanged(); + void addToLayout(Utils::LayoutBuilder &builder) override; Utils::PathChooser *m_chooser; bool m_ignoreChange = false; diff --git a/src/libraries/componentimporter.cpp b/src/libraries/componentimporter.cpp index 650823fd..9b5b8551 100644 --- a/src/libraries/componentimporter.cpp +++ b/src/libraries/componentimporter.cpp @@ -39,7 +39,7 @@ ComponentImporter::ComponentImporter(ProjectExplorer::Project *project) : m_project(project) {} -void ComponentImporter::setFiles(const QStringList &files) +void ComponentImporter::setFiles(const Utils::FilePaths &files) { m_sourceFiles = files; } @@ -49,12 +49,12 @@ void ComponentImporter::setProject(ProjectExplorer::Project *project) m_project = project; } -const QStringList &ComponentImporter::sourceFiles() const +const Utils::FilePaths &ComponentImporter::sourceFiles() const { return m_sourceFiles; } -const QStringList &ComponentImporter::importedFiles() const +const Utils::FilePaths &ComponentImporter::importedFiles() const { return m_importedFiles; } @@ -73,16 +73,17 @@ void ComponentImporter::import() addFilesToProject(copied); } -QStringList ComponentImporter::copyFilesToProject() +Utils::FilePaths ComponentImporter::copyFilesToProject() { - QStringList copiedFiles; + Utils::FilePaths copiedFiles; for (const auto &file : m_sourceFiles) { - QString target = targetFileName(file); + const QString filePath = file.path(); + QString target = targetFileName(filePath); createTargetDir(m_targetDir, QFileInfo(target).absolutePath()); - copyFile(file, target); - copiedFiles.append(target); + copyFile(filePath, target); + copiedFiles.append(Utils::FilePath::fromString(target)); } return copiedFiles; @@ -111,20 +112,20 @@ QString ComponentImporter::targetFileName(const QString &file) return m_targetDir.filePath(relativeSrcPath); } -void ComponentImporter::addFilesToProject(const QStringList &files) +void ComponentImporter::addFilesToProject(const Utils::FilePaths &files) { m_importedFiles = createUniqueFilesList(m_project, files); m_project->rootProjectNode()->addFiles(m_importedFiles); } -QStringList ComponentImporter::createUniqueFilesList(const ProjectExplorer::Project *project, - const QStringList &newFiles) +Utils::FilePaths ComponentImporter::createUniqueFilesList(const ProjectExplorer::Project *project, + const Utils::FilePaths &newFiles) { - QStringList uniqueFiles; + Utils::FilePaths uniqueFiles; const auto projectFiles = project->files(ProjectExplorer::Project::SourceFiles); for (const auto &file : newFiles) - if (!projectFiles.contains(Utils::FilePath::fromString(file))) + if (!projectFiles.contains(file)) uniqueFiles.append(file); return uniqueFiles; diff --git a/src/libraries/componentimporter.h b/src/libraries/componentimporter.h index bb016a94..b772c78a 100644 --- a/src/libraries/componentimporter.h +++ b/src/libraries/componentimporter.h @@ -27,7 +27,8 @@ #include #include -#include + +#include namespace ProjectExplorer { class Project; @@ -43,25 +44,25 @@ class ComponentImporter ComponentImporter(ProjectExplorer::Project *project); void setDirectory(const QString &path); - void setFiles(const QStringList &files); + void setFiles(const Utils::FilePaths &files); void setProject(ProjectExplorer::Project *project); - const QStringList &sourceFiles() const; - const QStringList &importedFiles() const; + const Utils::FilePaths &sourceFiles() const; + const Utils::FilePaths &importedFiles() const; void import(); private: - QStringList copyFilesToProject(); + Utils::FilePaths copyFilesToProject(); void createTargetDir(QDir &parent, const QString &path); QString targetFileName(const QString &file); - void addFilesToProject(const QStringList &files); + void addFilesToProject(const Utils::FilePaths &files); void copyFile(const QString &source, const QString &target); - QStringList createUniqueFilesList(const ProjectExplorer::Project *project, - const QStringList &newFiles); + Utils::FilePaths createUniqueFilesList(const ProjectExplorer::Project *project, + const Utils::FilePaths &newFiles); - QStringList m_sourceFiles; - QStringList m_importedFiles; + Utils::FilePaths m_sourceFiles; + Utils::FilePaths m_importedFiles; QDir m_sourceDir; QDir m_targetDir; diff --git a/src/libraries/wizard/componentselector.h b/src/libraries/wizard/componentselector.h index b0395128..8de6b568 100644 --- a/src/libraries/wizard/componentselector.h +++ b/src/libraries/wizard/componentselector.h @@ -26,8 +26,8 @@ #pragma once #include -#include #include +#include namespace Asn1Acn { namespace Internal { @@ -44,7 +44,7 @@ class ComponentSelector : public QObject {} public: - virtual QStringList pathsToImport() = 0; + virtual Utils::FilePaths pathsToImport() = 0; }; } // namespace Wizard diff --git a/src/libraries/wizard/filecomponentselector.cpp b/src/libraries/wizard/filecomponentselector.cpp index c14aa5d1..f36b55c4 100644 --- a/src/libraries/wizard/filecomponentselector.cpp +++ b/src/libraries/wizard/filecomponentselector.cpp @@ -40,19 +40,19 @@ FileComponentSelector::FileComponentSelector(FileModel *model, , m_nameFilter(nameFilter) {} -QStringList FileComponentSelector::pathsToImport() +Utils::FilePaths FileComponentSelector::pathsToImport() { return selectedPathsFromModelItem(m_model->rootPath()); } -QStringList FileComponentSelector::selectedPathsFromModelItem(const QString &parentPath) const +Utils::FilePaths FileComponentSelector::selectedPathsFromModelItem(const QString &parentPath) const { const auto parent = m_model->index(parentPath); if (!parent.isValid()) return {}; - QStringList paths; + Utils::FilePaths paths; for (int i = 0; i < m_model->rowCount(parent); ++i) for (int j = 0; j < m_model->columnCount(parent); ++j) paths.append(pathsFromChildIndex(m_model->index(i, j, parent))); @@ -60,7 +60,7 @@ QStringList FileComponentSelector::selectedPathsFromModelItem(const QString &par return paths; } -QStringList FileComponentSelector::pathsFromChildIndex(const QModelIndex &child) const +Utils::FilePaths FileComponentSelector::pathsFromChildIndex(const QModelIndex &child) const { const auto state = child.data(Qt::CheckStateRole); if (state == Qt::Unchecked) @@ -73,16 +73,16 @@ QStringList FileComponentSelector::pathsFromChildIndex(const QModelIndex &child) QTC_ASSERT(state == Qt::Checked, return {}); - return {m_model->filePath(child)}; + return {Utils::FilePath::fromString(m_model->filePath(child))}; } -QStringList FileComponentSelector::selectedPathsFromFilesystemItem(const QString &path) const +Utils::FilePaths FileComponentSelector::selectedPathsFromFilesystemItem(const QString &path) const { QDirIterator it(path, m_nameFilter, QDir::Files, QDirIterator::Subdirectories); - QStringList paths; + Utils::FilePaths paths; while (it.hasNext()) - paths.append(it.next()); + paths.append(Utils::FilePath::fromString(it.next())); return paths; } diff --git a/src/libraries/wizard/filecomponentselector.h b/src/libraries/wizard/filecomponentselector.h index 28b99d02..19395b88 100644 --- a/src/libraries/wizard/filecomponentselector.h +++ b/src/libraries/wizard/filecomponentselector.h @@ -41,13 +41,13 @@ class FileComponentSelector : public ComponentSelector public: FileComponentSelector(FileModel *model, const QStringList nameFilter, QObject *parent = nullptr); - QStringList pathsToImport() override; + Utils::FilePaths pathsToImport() override; private: - QStringList selectedPathsFromModelItem(const QString &parentPath) const; - QStringList pathsFromChildIndex(const QModelIndex &child) const; + Utils::FilePaths selectedPathsFromModelItem(const QString &parentPath) const; + Utils::FilePaths pathsFromChildIndex(const QModelIndex &child) const; - QStringList selectedPathsFromFilesystemItem(const QString &path) const; + Utils::FilePaths selectedPathsFromFilesystemItem(const QString &path) const; FileModel *m_model; const QStringList m_nameFilter; diff --git a/src/libraries/wizard/metadatacomponentselector.cpp b/src/libraries/wizard/metadatacomponentselector.cpp index b10c430c..314fbe6e 100644 --- a/src/libraries/wizard/metadatacomponentselector.cpp +++ b/src/libraries/wizard/metadatacomponentselector.cpp @@ -55,15 +55,13 @@ void MetadaComponentSelector::onConflictOccured(const QString &first, const QStr msgBox.exec(); } -QStringList MetadaComponentSelector::pathsToImport() +Utils::FilePaths MetadaComponentSelector::pathsToImport() { auto files = fileNamesFromSelectedItems(); files.removeDuplicates(); - files = pathsFromNames(files); - - return insertAcnFiles(files); + return insertAcnFiles(pathsFromNames(files)); } QStringList MetadaComponentSelector::fileNamesFromSelectedItems() const @@ -82,36 +80,37 @@ QStringList MetadaComponentSelector::fileNamesFromSelectedItems() const return fileNames; } -QStringList MetadaComponentSelector::insertAcnFiles(const QStringList &asnFiles) const +Utils::FilePaths MetadaComponentSelector::insertAcnFiles(const Utils::FilePaths &asnFiles) const { - QStringList allFiles = asnFiles; + Utils::FilePaths allFiles = asnFiles; static const QRegularExpression re("\\.asn1?$"); for (auto file : asnFiles) { - const auto match = re.match(file); + QString filePath = file.path(); + const auto match = re.match(filePath); if (!match.hasMatch()) continue; - file.replace(match.capturedStart(), match.capturedLength(), ".acn"); + filePath.replace(match.capturedStart(), match.capturedLength(), ".acn"); - if (QFileInfo::exists(file)) - allFiles << file; + if (QFileInfo::exists(filePath)) + allFiles << Utils::FilePath::fromString(filePath); } return allFiles; } -QStringList MetadaComponentSelector::pathsFromNames(const QStringList &names) const +Utils::FilePaths MetadaComponentSelector::pathsFromNames(const QStringList &names) const { if (names.empty()) return {}; QDirIterator it(m_path, names, QDir::NoFilter, QDirIterator::Subdirectories); - QStringList paths; + Utils::FilePaths paths; while (it.hasNext()) - paths.append(it.next()); + paths.append(Utils::FilePath::fromString(it.next())); return paths; } diff --git a/src/libraries/wizard/metadatacomponentselector.h b/src/libraries/wizard/metadatacomponentselector.h index edfc70d7..88cb357b 100644 --- a/src/libraries/wizard/metadatacomponentselector.h +++ b/src/libraries/wizard/metadatacomponentselector.h @@ -41,15 +41,15 @@ class MetadaComponentSelector : public ComponentSelector public: MetadaComponentSelector(MetadataModel *model, const QString &path, QObject *parent = nullptr); - QStringList pathsToImport() override; + Utils::FilePaths pathsToImport() override; private slots: void onConflictOccured(const QString &first, const QString &second) const; private: QStringList fileNamesFromSelectedItems() const; - QStringList pathsFromNames(const QStringList &names) const; - QStringList insertAcnFiles(const QStringList &asnFiles) const; + Utils::FilePaths pathsFromNames(const QStringList &names) const; + Utils::FilePaths insertAcnFiles(const Utils::FilePaths &asnFiles) const; MetadataModel *m_model; QString m_path; diff --git a/src/libraries/wizard/summarypage.cpp b/src/libraries/wizard/summarypage.cpp index 9682e292..eb25fcc4 100644 --- a/src/libraries/wizard/summarypage.cpp +++ b/src/libraries/wizard/summarypage.cpp @@ -68,7 +68,7 @@ void SummaryPage::fillFilesList() { QString filesText; for (auto it = m_importer.sourceFiles().begin(); it != m_importer.sourceFiles().end(); it++) { - filesText += *it; + filesText += it->path(); if (it + 1 != m_importer.sourceFiles().end()) filesText += QLatin1String(",\n"); } diff --git a/src/libraries/wizard/vcshandler.cpp b/src/libraries/wizard/vcshandler.cpp index 52c20d8e..ba33a613 100644 --- a/src/libraries/wizard/vcshandler.cpp +++ b/src/libraries/wizard/vcshandler.cpp @@ -61,7 +61,7 @@ void VcsHandler::setCurrentIndex(int index) m_index = index; } -void VcsHandler::addToVcs(const QStringList &files) +void VcsHandler::addToVcs(const Utils::FilePaths &files) { if (m_index < 0) return; @@ -80,10 +80,13 @@ void VcsHandler::addToVcs(const QStringList &files) } QTC_ASSERT(vcs->supportsOperation(Core::IVersionControl::AddOperation), return ); - for (const auto &file : files) - if (!vcs->vcsAdd(file)) - throw std::runtime_error("Failed to add \'" + file.toStdString() + for (const auto &file : files) { + const auto filePath = file.path(); + if (!vcs->vcsAdd(filePath)) + throw std::runtime_error("Failed to add \'" + filePath.toStdString() + "\' to version control system"); + } + } void VcsHandler::onConfigChanged() diff --git a/src/libraries/wizard/vcshandler.h b/src/libraries/wizard/vcshandler.h index 7fa64aca..06aa4dac 100644 --- a/src/libraries/wizard/vcshandler.h +++ b/src/libraries/wizard/vcshandler.h @@ -26,6 +26,7 @@ #include #include +#include namespace Core { class IVersionControl; @@ -47,7 +48,7 @@ class VcsHandler : public QObject void setCurrentIndex(int index); - void addToVcs(const QStringList &files); + void addToVcs(const Utils::FilePaths &files); private slots: void onConfigChanged(); diff --git a/src/linkcreator.cpp b/src/linkcreator.cpp index 0fa14b79..a22bfae5 100644 --- a/src/linkcreator.cpp +++ b/src/linkcreator.cpp @@ -57,7 +57,7 @@ Utils::Link LinkCreator::createTargetLink(const QTextCursor &cursor) const Utils::Link LinkCreator::getSymbolLink(const Data::TypeReference &symbolSource, const QTextCursor &cursor) const { - Utils::Link symbol(m_textDocument.filePath().toString()); + Utils::Link symbol(m_textDocument.filePath()); QTextCursor selection = Utils::Text::selectAt(cursor, symbolSource.location().line(), @@ -81,7 +81,7 @@ Utils::Link LinkCreator::getTargetSymbolLink(const Data::TypeReference &symbolSo if (!targetLocation.isValid()) { targetLocation = getTargetLocation(symbolSource.name(), symbolSource.module()); - target.targetFileName = targetLocation.path(); + target.targetFilePath = Utils::FilePath::fromString(targetLocation.path()); } target.targetLine = targetLocation.line(); diff --git a/src/settings/fuzzer.cpp b/src/settings/fuzzer.cpp index faafcb87..f3691c40 100644 --- a/src/settings/fuzzer.cpp +++ b/src/settings/fuzzer.cpp @@ -47,7 +47,7 @@ void Fuzzer::saveOptionsTo(QSettings *s) const static QString defaultFuzzerPath() { - const QString path = Core::ICore::libexecPath() + const QString path = Core::ICore::libexecPath().toString() + QLatin1String("/asn1scc-Fuzzer/asn1scc-fuzzer"); if (Utils::HostOsInfo::isWindowsHost()) return path + QLatin1String(".exe"); diff --git a/src/settings/libraries.cpp b/src/settings/libraries.cpp index 6d0d96f0..56e03af9 100644 --- a/src/settings/libraries.cpp +++ b/src/settings/libraries.cpp @@ -37,12 +37,12 @@ namespace { QString globalLibRootDir() { - return Core::ICore::resourcePath() + RELATIVE_ASN1LIB_PATH; + return Core::ICore::resourcePath().toString() + RELATIVE_ASN1LIB_PATH; } QString userLibRootDir() { - return Core::ICore::userResourcePath() + RELATIVE_ASN1LIB_PATH; + return Core::ICore::userResourcePath().toString() + RELATIVE_ASN1LIB_PATH; } QStringList listLibs(const QString &path) diff --git a/src/settings/service.cpp b/src/settings/service.cpp index a54172cf..0532a766 100644 --- a/src/settings/service.cpp +++ b/src/settings/service.cpp @@ -52,7 +52,7 @@ void Service::saveOptionsTo(QSettings *s) const static QString defaultDaemonPath() { - return Core::ICore::libexecPath() + QLatin1String("/asn1scc/daemon/asn1.daemon.exe"); + return Core::ICore::libexecPath().toString() + QLatin1String("/asn1scc/daemon/asn1.daemon.exe"); } void Service::loadOptionsFrom(QSettings *s) diff --git a/src/tests/linkcreator_tests.cpp b/src/tests/linkcreator_tests.cpp index ff78f94f..fb097866 100644 --- a/src/tests/linkcreator_tests.cpp +++ b/src/tests/linkcreator_tests.cpp @@ -75,12 +75,12 @@ void LinkCreatorTests::test_createLinksInEmptyDocument() const auto highlightLink = linkCreator.createHighlightLink(cursor); QVERIFY(!highlightLink.hasValidLinkText()); QVERIFY(highlightLink.hasValidTarget()); - QCOMPARE(highlightLink.targetFileName, m_path); + QCOMPARE(highlightLink.targetFilePath, Utils::FilePath::fromString(m_path)); const auto targetLink = linkCreator.createTargetLink(cursor); QVERIFY(!targetLink.hasValidLinkText()); QVERIFY(!targetLink.hasValidTarget()); - QCOMPARE(targetLink.targetFileName, QString()); + QCOMPARE(targetLink.targetFilePath, Utils::FilePath()); } void LinkCreatorTests::test_createLinksFromEmptyStorage() @@ -95,12 +95,12 @@ void LinkCreatorTests::test_createLinksFromEmptyStorage() const auto highlightLink = linkCreator.createHighlightLink(cursor); QVERIFY(!highlightLink.hasValidLinkText()); QVERIFY(highlightLink.hasValidTarget()); - QCOMPARE(highlightLink.targetFileName, m_path); + QCOMPARE(highlightLink.targetFilePath, Utils::FilePath::fromString(m_path)); const auto targetLink = linkCreator.createTargetLink(cursor); QVERIFY(!targetLink.hasValidLinkText()); QVERIFY(!targetLink.hasValidTarget()); - QCOMPARE(targetLink.targetFileName, QString()); + QCOMPARE(targetLink.targetFilePath, Utils::FilePath()); } void LinkCreatorTests::test_createHighlight() @@ -124,7 +124,7 @@ void LinkCreatorTests::test_createHighlight() QVERIFY(link.hasValidLinkText()); QCOMPARE(link.linkTextStart, 5); QCOMPARE(link.linkTextEnd, 13); - QCOMPARE(link.targetFileName, m_path); + QCOMPARE(link.targetFilePath, Utils::FilePath::fromString(m_path)); m_storage->removeFileFromProject(m_project, Utils::FilePath::fromString(m_path)); } @@ -159,7 +159,7 @@ void LinkCreatorTests::test_createTarget() QVERIFY(link.hasValidTarget()); QCOMPARE(link.targetColumn, 15); QCOMPARE(link.targetLine, 1); - QCOMPARE(link.targetFileName, m_path); + QCOMPARE(link.targetFilePath, Utils::FilePath::fromString(m_path)); m_storage->removeFileFromProject(m_project, Utils::FilePath::fromString(m_path)); } diff --git a/templates/wizards/projects/asn1acn/CMakeLists.txt b/templates/wizards/projects/asn1acn/CMakeLists.txt index 6b9235d3..033b7982 100644 --- a/templates/wizards/projects/asn1acn/CMakeLists.txt +++ b/templates/wizards/projects/asn1acn/CMakeLists.txt @@ -2,14 +2,15 @@ cmake_minimum_required(VERSION 2.8) project(%{JS: '%{ProjectName}'}) -set(ASN1ACNSOURCES %{JS: if (%{AddAsnFile} && %{AddAcnFile}) - '%{AsnRelativePath}/%{AsnFile} %{AcnRelativePath}/%{AcnFile}' - else if (%{AddAsnFile}) - '%{AsnRelativePath}/%{AsnFile}' - else if (%{AddAcnFile}) - '%{AcnRelativePath}/%{AcnFile}' - else - ' ' }) +set(ASN1ACNSOURCES DISTFILES += \\ + @if %{AddAsnFile} && %{AddAcnFile} + %{AsnRelativePath}/%{AsnFile} \\ + %{AcnRelativePath}/%{AcnFile} + @elsif %{AddAsnFile} + %{AsnRelativePath}/%{AsnFile} + @elsif %{AddAcnFile} + %{AcnRelativePath}/%{AcnFile} + @endif) include(asn1sccSettings.cmake) include(createFilesList.cmake) diff --git a/templates/wizards/projects/asn1acn/createFilesList.cmake b/templates/wizards/projects/asn1acn/createFilesList.cmake index b194ee13..858808f3 100644 --- a/templates/wizards/projects/asn1acn/createFilesList.cmake +++ b/templates/wizards/projects/asn1acn/createFilesList.cmake @@ -53,7 +53,15 @@ function(appendPersistentListC) endfunction() function(appendPersistentListAda) - set(persistentFiles ${ASN1SCC_ADA_DIR}/adaasn1rtl.adb) + set(persistentFiles ${ASN1SCC_ADA_DIR}/adaasn1rtl.adb ${ASN1SCC_ADA_DIR}/adaasn1rtl-encoding.adb) + + list(FIND ASN1SCC_ADA_OPTIONS --acn-enc ACN_ENCODING_IDX) + list(FIND ASN1SCC_ADA_OPTIONS --uper-enc UPER_ENCODING_IDX) + if (NOT ${ACN_ENCODING_IDX} EQUAL -1) + set(persistentFiles ${persistentFiles} ${ASN1SCC_ADA_DIR}/adaasn1rtl-encoding-acn.adb) + elseif (NOT ${UPER_ENCODING_IDX} EQUAL -1) + set(persistentFiles ${persistentFiles} ${ASN1SCC_ADA_DIR}/adaasn1rtl-encoding-uper.adb) + endif() tryCreateFiles("${persistentFiles}") set(ASN1SCC_PRODUCTS ${ASN1SCC_PRODUCTS} ${persistentFiles} PARENT_SCOPE) diff --git a/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri b/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri index 1b7eb2a7..f2480cf6 100644 --- a/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri +++ b/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri @@ -22,7 +22,7 @@ ####################################################################### isEmpty(ASN1SCC): ASN1SCC = $$(ASN1SCC) -isEmpty(ASN1SCC): ASN1SCC = asn1.exe +isEmpty(ASN1SCC): ASN1SCC = asn1scc isEmpty(ASN1SCC_PRODUCTS_DIR): ASN1SCC_PRODUCTS_DIR = $$shell_path($${OUT_PWD}/asn1sccGenerated) isEmpty(ASN1SCC_COMMON_OPTIONS): ASN1SCC_COMMON_OPTIONS = --acn-enc --field-prefix AUTO --type-prefix T isEmpty(ASN1SCC_C_OPTIONS): ASN1SCC_C_OPTIONS = --c-lang $${ASN1SCC_COMMON_OPTIONS} diff --git a/templates/wizards/projects/asn1acn/updateSourcesList.pri b/templates/wizards/projects/asn1acn/updateSourcesList.pri index 952431f2..f6e3830f 100644 --- a/templates/wizards/projects/asn1acn/updateSourcesList.pri +++ b/templates/wizards/projects/asn1acn/updateSourcesList.pri @@ -109,8 +109,7 @@ generateC { contains(ASN1SCC_C_OPTIONS, --acn-enc) { cNames += asn1crt_encoding_acn - } - contains(ASN1SCC_C_OPTIONS, --uper-enc) { + } else:contains(ASN1SCC_C_OPTIONS, --uper-enc) { cNames += asn1crt_encoding_uper } } @@ -127,7 +126,13 @@ generateC { generateAda { adaNames = $$lower($$names) !isEmpty(names) { - adaNames += adaasn1rtl + adaNames += adaasn1rtl adaasn1rtl-encoding + + contains(ASN1SCC_ADA_OPTIONS, --acn-enc) { + adaNames += adaasn1rtl-encoding-acn + } else:contains(ASN1SCC_ADA_OPTIONS, --uper-enc) { + cNames += adaasn1rtl-encoding-uper + } } SOURCES += $$createGeneratedFilesListAda($$adaNames, "adb") From 9a64e567ceeaca1c557acd8199c35e3df59ccefa Mon Sep 17 00:00:00 2001 From: Igor Jarek Date: Tue, 1 Mar 2022 13:31:54 +0100 Subject: [PATCH 2/4] plugin-update-5.0.3-6.0.2 --- Asn1Acn.json.in | 4 +- src/3rdparty/tests/modeltest.cpp | 4 +- src/asn1acnbuildstep.cpp | 5 +- src/asn1sccparseddocumentbuilder.cpp | 8 ++-- src/astxmlparser.cpp | 4 +- src/astxmlparser.h | 4 +- src/completion/acncompletionassist.cpp | 3 +- src/completion/acncompletionassist.h | 2 +- src/completion/asncompletionassist.cpp | 3 +- src/completion/asncompletionassist.h | 2 +- src/completion/keywordproposalsbuilder.cpp | 2 +- src/data/types/builtintypes.h | 48 +++++++++---------- src/data/types/labeltype.cpp | 4 +- src/data/types/labeltype.h | 2 +- src/data/types/type.h | 3 +- src/data/types/userdefinedtype.cpp | 4 +- src/data/types/userdefinedtype.h | 2 +- src/libraries/componentlibraryprocessor.cpp | 2 +- .../tests/generalmetadataparser_tests.cpp | 22 ++++----- .../tests/modulemetadataparser_tests.cpp | 12 ++--- .../wizard/importcomponentwizard.cpp | 2 +- .../wizard/relationslabelscontroller.cpp | 4 +- src/libraries/wizard/vcshandler.cpp | 11 ++--- src/projectcontenthandler.cpp | 5 +- src/tree-views/decorationrolevisitor.cpp | 2 +- src/tree-views/treeviewwidget.cpp | 2 +- .../wizards/projects/asn1acn/CMakeLists.txt | 20 ++++---- .../projects/asn1acn/createFilesList.cmake | 2 +- 28 files changed, 97 insertions(+), 91 deletions(-) diff --git a/Asn1Acn.json.in b/Asn1Acn.json.in index 1785b950..a365a9e7 100644 --- a/Asn1Acn.json.in +++ b/Asn1Acn.json.in @@ -1,7 +1,7 @@ { \"Name\" : \"ASN.1/ACN\", - \"Version\" : \"5.0.3\", - \"CompatVersion\" : \"5.0.0\", + \"Version\" : \"6.0.2\", + \"CompatVersion\" : \"6.0.0\", \"Vendor\" : \"N7 Space sp. z o.o.\", \"Copyright\" : \"(C) 2017-2022 N7 Space sp. z o.o.\", \"License\" : \"GPL v3.0\", diff --git a/src/3rdparty/tests/modeltest.cpp b/src/3rdparty/tests/modeltest.cpp index 36a72709..11fc62d6 100644 --- a/src/3rdparty/tests/modeltest.cpp +++ b/src/3rdparty/tests/modeltest.cpp @@ -443,12 +443,12 @@ void ModelTest::data() } // General Purpose roles that should return a QColor - QVariant colorVariant = model->data ( model->index ( 0, 0 ), Qt::BackgroundColorRole ); + QVariant colorVariant = model->data ( model->index ( 0, 0 ), Qt::BackgroundRole ); if ( colorVariant.isValid() ) { QVERIFY( colorVariant.canConvert() ); } - colorVariant = model->data ( model->index ( 0, 0 ), Qt::TextColorRole ); + colorVariant = model->data ( model->index ( 0, 0 ), Qt::ForegroundRole ); if ( colorVariant.isValid() ) { QVERIFY( colorVariant.canConvert() ); } diff --git a/src/asn1acnbuildstep.cpp b/src/asn1acnbuildstep.cpp index 9c7218df..34e36de4 100644 --- a/src/asn1acnbuildstep.cpp +++ b/src/asn1acnbuildstep.cpp @@ -71,7 +71,8 @@ void Asn1AcnBuildStep::updateEnvironment(const ProjectExplorer::BuildConfigurati void Asn1AcnBuildStep::updateProcess(const QString &command, const QString &arg) { auto *pp = processParameters(); - Utils::CommandLine commandLine(command); - commandLine.addArgs(arg, Utils::CommandLine::Raw); + Utils::CommandLine commandLine(Utils::FilePath::fromUserInput(command), + arg, + Utils::CommandLine::Raw); pp->setCommandLine(commandLine); } diff --git a/src/asn1sccparseddocumentbuilder.cpp b/src/asn1sccparseddocumentbuilder.cpp index 8d3ea0ae..a5ad7cdc 100644 --- a/src/asn1sccparseddocumentbuilder.cpp +++ b/src/asn1sccparseddocumentbuilder.cpp @@ -112,13 +112,13 @@ std::vector> Asn1SccParsedDocumentBuilder::takeDocum bool Asn1SccParsedDocumentBuilder::responseContainsAst(const QJsonObject &json) { - return json[QLatin1Literal("ErrorCode")].toInt(-1) == 0; + return json[QLatin1String("ErrorCode")].toInt(-1) == 0; } void Asn1SccParsedDocumentBuilder::storeErrorMessages(const QJsonObject &json) { const auto parser = ErrorMessageParser(); - for (const auto message : json[QLatin1Literal("Messages")].toArray()) { + for (const auto message : json[QLatin1String("Messages")].toArray()) { const auto msg = parser.parse(message.toString()); if (msg.isValid()) m_errorMessages.push_back(msg); @@ -127,8 +127,8 @@ void Asn1SccParsedDocumentBuilder::storeErrorMessages(const QJsonObject &json) QString Asn1SccParsedDocumentBuilder::getAstXml(const QJsonObject &json) { - const auto files = json[QLatin1Literal("Files")].toArray(); + const auto files = json[QLatin1String("Files")].toArray(); if (files.size() != 1) return QString(); - return files[0].toObject()[QLatin1Literal("Contents")].toString(); + return files[0].toObject()[QLatin1String("Contents")].toString(); } diff --git a/src/astxmlparser.cpp b/src/astxmlparser.cpp index de95c18e..00d5a3ca 100644 --- a/src/astxmlparser.cpp +++ b/src/astxmlparser.cpp @@ -274,7 +274,7 @@ std::unique_ptr AstXmlParser::readTypeDetails(const Data::Sou return type; } -void AstXmlParser::readTypeContents(const QStringRef &name) +void AstXmlParser::readTypeContents(const QStringView &name) { if (name == QStringLiteral("SEQUENCE")) readSequence(); @@ -287,7 +287,7 @@ void AstXmlParser::readTypeContents(const QStringRef &name) } std::unique_ptr AstXmlParser::buildTypeFromName( - const Data::SourceLocation &location, const QStringRef &name) + const Data::SourceLocation &location, const QStringView &name) { if (name == QStringLiteral("REFERENCE_TYPE")) return readReferenceType(location); diff --git a/src/astxmlparser.h b/src/astxmlparser.h index a76eae3b..df212ebb 100644 --- a/src/astxmlparser.h +++ b/src/astxmlparser.h @@ -78,9 +78,9 @@ class AstXmlParser std::unique_ptr readTypeDetails(const Data::SourceLocation &location); std::unique_ptr readReferenceType(const Data::SourceLocation &location); std::unique_ptr buildTypeFromName(const Data::SourceLocation &location, - const QStringRef &name); + const QStringView &name); - void readTypeContents(const QStringRef &name); + void readTypeContents(const QStringView &name); void readSequence(); void readSequenceOf(); void readChoice(); diff --git a/src/completion/acncompletionassist.cpp b/src/completion/acncompletionassist.cpp index 3824eaab..b441663d 100644 --- a/src/completion/acncompletionassist.cpp +++ b/src/completion/acncompletionassist.cpp @@ -41,7 +41,8 @@ std::unique_ptr AcnCompletionAssistProcessor::createKeywordsPr return provider; } -TextEditor::IAssistProcessor *AcnCompletionAssistProvider::createProcessor() const +TextEditor::IAssistProcessor *AcnCompletionAssistProvider::createProcessor(const TextEditor::AssistInterface *assistInterface) const { + Q_UNUSED(assistInterface); return new AcnCompletionAssistProcessor; } diff --git a/src/completion/acncompletionassist.h b/src/completion/acncompletionassist.h index 150e3034..ffe123dd 100644 --- a/src/completion/acncompletionassist.h +++ b/src/completion/acncompletionassist.h @@ -46,7 +46,7 @@ class AcnCompletionAssistProvider : public CompletionAssistProvider Q_OBJECT public: - TextEditor::IAssistProcessor *createProcessor() const override; + TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *assistInterface) const override; }; } /* nameapsce Completion */ diff --git a/src/completion/asncompletionassist.cpp b/src/completion/asncompletionassist.cpp index d8eb7cba..a3d052b2 100644 --- a/src/completion/asncompletionassist.cpp +++ b/src/completion/asncompletionassist.cpp @@ -40,7 +40,8 @@ std::unique_ptr AsnCompletionAssistProcessor::createKeywordsPr return provider; } -TextEditor::IAssistProcessor *AsnCompletionAssistProvider::createProcessor() const +TextEditor::IAssistProcessor *AsnCompletionAssistProvider::createProcessor(const TextEditor::AssistInterface *assistInterface) const { + Q_UNUSED(assistInterface); return new AsnCompletionAssistProcessor; } diff --git a/src/completion/asncompletionassist.h b/src/completion/asncompletionassist.h index 7120ccc6..d9941144 100644 --- a/src/completion/asncompletionassist.h +++ b/src/completion/asncompletionassist.h @@ -44,7 +44,7 @@ class AsnCompletionAssistProvider : public CompletionAssistProvider Q_OBJECT public: - TextEditor::IAssistProcessor *createProcessor() const override; + TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *assistInterface) const override; }; } /* nameapsce Completion */ diff --git a/src/completion/keywordproposalsbuilder.cpp b/src/completion/keywordproposalsbuilder.cpp index 83c4c4e2..0d08611c 100644 --- a/src/completion/keywordproposalsbuilder.cpp +++ b/src/completion/keywordproposalsbuilder.cpp @@ -43,7 +43,7 @@ KeywordProposalsBuilder::KeywordProposalsBuilder(const QStringList &keywords, static QIcon buildIcon(Utils::Theme::Color theme) { - return Utils::Icon({{QLatin1String(":/codemodel/images/keyword.png"), theme}}, Utils::Icon::Tint) + return Utils::Icon({{":/codemodel/images/keyword.png", theme}}, Utils::Icon::Tint) .icon(); } diff --git a/src/data/types/builtintypes.h b/src/data/types/builtintypes.h index 98485067..511df3a4 100644 --- a/src/data/types/builtintypes.h +++ b/src/data/types/builtintypes.h @@ -49,9 +49,9 @@ class Boolean : public BuiltinType QString name() const override { return QLatin1String("BOOLEAN"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/boolean.png"); + return ":/asn1acn/images/outline/boolean.png"; } }; @@ -61,9 +61,9 @@ class Null : public BuiltinType QString name() const override { return QLatin1String("NULL"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/null.png"); + return ":/asn1acn/images/outline/null.png"; } }; @@ -73,9 +73,9 @@ class Integer : public BuiltinType QString name() const override { return QLatin1String("INTEGER"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/integer.png"); + return ":/asn1acn/images/outline/integer.png"; } }; @@ -85,9 +85,9 @@ class Real : public BuiltinType QString name() const override { return QLatin1String("REAL"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/real.png"); + return ":/asn1acn/images/outline/real.png"; } }; @@ -97,9 +97,9 @@ class BitString : public BuiltinType QString name() const override { return QLatin1String("BIT STRING"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/bitstring.png"); + return ":/asn1acn/images/outline/bitstring.png"; } }; @@ -109,9 +109,9 @@ class OctetString : public BuiltinType QString name() const override { return QLatin1String("OCTET STRING"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/octetstring.png"); + return ":/asn1acn/images/outline/octetstring.png"; } }; @@ -121,9 +121,9 @@ class IA5String : public BuiltinType QString name() const override { return QLatin1String("IA5String"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/ia5string.png"); + return ":/asn1acn/images/outline/ia5string.png"; } }; @@ -133,9 +133,9 @@ class NumericString : public BuiltinType QString name() const override { return QLatin1String("NumericString"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/numericstring.png"); + return ":/asn1acn/images/outline/numericstring.png"; } }; @@ -145,9 +145,9 @@ class Enumerated : public BuiltinType QString name() const override { return QLatin1String("ENUMERATED"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/enumerated.png"); + return ":/asn1acn/images/outline/enumerated.png"; } }; @@ -157,9 +157,9 @@ class Choice : public BuiltinType QString name() const override { return QLatin1String("CHOICE"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/choice.png"); + return ":/asn1acn/images/outline/choice.png"; } }; @@ -169,9 +169,9 @@ class Sequence : public BuiltinType QString name() const override { return QLatin1String("SEQUENCE"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/sequence.png"); + return ":/asn1acn/images/outline/sequence.png"; } }; @@ -181,9 +181,9 @@ class SequenceOf : public BuiltinType QString name() const override { return QLatin1String("SEQUENCE OF"); } private: - QString baseIconFile() const override + Utils::FilePath baseIconFile() const override { - return QStringLiteral(":/asn1acn/images/outline/sequenceof.png"); + return ":/asn1acn/images/outline/sequenceof.png"; } }; diff --git a/src/data/types/labeltype.cpp b/src/data/types/labeltype.cpp index 5c0bc38b..ff456995 100644 --- a/src/data/types/labeltype.cpp +++ b/src/data/types/labeltype.cpp @@ -41,9 +41,9 @@ QString LabelType::label() const return QString(); } -QString LabelType::baseIconFile() const +Utils::FilePath LabelType::baseIconFile() const { - return QString(); + return Utils::FilePath(); } QIcon LabelType::createIcon(Utils::Theme::Color color) const diff --git a/src/data/types/labeltype.h b/src/data/types/labeltype.h index 3b77a517..6ed39e32 100644 --- a/src/data/types/labeltype.h +++ b/src/data/types/labeltype.h @@ -43,7 +43,7 @@ class LabelType : public Type QString label() const override; private: - QString baseIconFile() const override; + Utils::FilePath baseIconFile() const override; QIcon createIcon(Utils::Theme::Color color) const override; QString m_name; diff --git a/src/data/types/type.h b/src/data/types/type.h index e5c0077d..285b5b24 100644 --- a/src/data/types/type.h +++ b/src/data/types/type.h @@ -26,6 +26,7 @@ #include #include +#include #include @@ -47,7 +48,7 @@ class Type private: virtual QIcon createIcon(Utils::Theme::Color color) const; - virtual QString baseIconFile() const = 0; + virtual Utils::FilePath baseIconFile() const = 0; }; } // namespace Types diff --git a/src/data/types/userdefinedtype.cpp b/src/data/types/userdefinedtype.cpp index 53cc0ea4..353b7d6c 100644 --- a/src/data/types/userdefinedtype.cpp +++ b/src/data/types/userdefinedtype.cpp @@ -42,7 +42,7 @@ QString UserdefinedType::label() const return ": " + m_module + "." + name(); } -QString UserdefinedType::baseIconFile() const +Utils::FilePath UserdefinedType::baseIconFile() const { - return QStringLiteral(":/asn1acn/images/outline/userdefined.png"); + return ":/asn1acn/images/outline/userdefined.png"; } diff --git a/src/data/types/userdefinedtype.h b/src/data/types/userdefinedtype.h index 8469a523..56ced090 100644 --- a/src/data/types/userdefinedtype.h +++ b/src/data/types/userdefinedtype.h @@ -43,7 +43,7 @@ class UserdefinedType : public Type QString label() const override; private: - QString baseIconFile() const override; + Utils::FilePath baseIconFile() const override; QString m_name; QString m_module; diff --git a/src/libraries/componentlibraryprocessor.cpp b/src/libraries/componentlibraryprocessor.cpp index 8f356ca0..60de2d82 100644 --- a/src/libraries/componentlibraryprocessor.cpp +++ b/src/libraries/componentlibraryprocessor.cpp @@ -62,7 +62,7 @@ void ComponentLibraryProcessor::process() library->addModule(std::move(module)); } catch (const ModuleMetadataParser::Error &err) { using Messages::MessageManager; - MessageManager::write(QLatin1Literal("Parsing failed - ") + err.what(), + MessageManager::write(QLatin1String("Parsing failed - ") + err.what(), MessageManager::Type::Metadata); continue; } diff --git a/src/libraries/tests/generalmetadataparser_tests.cpp b/src/libraries/tests/generalmetadataparser_tests.cpp index 70a7b226..23edbc0d 100644 --- a/src/libraries/tests/generalmetadataparser_tests.cpp +++ b/src/libraries/tests/generalmetadataparser_tests.cpp @@ -37,8 +37,8 @@ void GeneralMetadataParserTests::test_empty() { parse("", "/some/path/with/LibName"); - QCOMPARE(m_parsedData.name(), QLatin1Literal("LibName")); - QCOMPARE(m_parsedData.path(), QLatin1Literal("/some/path/with/LibName")); + QCOMPARE(m_parsedData.name(), QLatin1String("LibName")); + QCOMPARE(m_parsedData.path(), QLatin1String("/some/path/with/LibName")); QVERIFY(m_parsedData.license().isEmpty()); QVERIFY(m_parsedData.version().isEmpty()); QVERIFY(m_parsedData.description().isEmpty()); @@ -48,9 +48,9 @@ void GeneralMetadataParserTests::test_partiallyFilled() { parse(R"({"name": "InnerName", "license": "GPL"})", "/some/path/with/LibName"); - QCOMPARE(m_parsedData.name(), QLatin1Literal("InnerName")); - QCOMPARE(m_parsedData.path(), QLatin1Literal("/some/path/with/LibName")); - QCOMPARE(m_parsedData.license(), QLatin1Literal("GPL")); + QCOMPARE(m_parsedData.name(), QLatin1String("InnerName")); + QCOMPARE(m_parsedData.path(), QLatin1String("/some/path/with/LibName")); + QCOMPARE(m_parsedData.license(), QLatin1String("GPL")); QVERIFY(m_parsedData.version().isEmpty()); QVERIFY(m_parsedData.description().isEmpty()); } @@ -65,12 +65,12 @@ void GeneralMetadataParserTests::test_complete() R"("license": "GPL"})", "/some/path/with/LibName"); - QCOMPARE(m_parsedData.name(), QLatin1Literal("InnerName")); - QCOMPARE(m_parsedData.path(), QLatin1Literal("/some/path/with/LibName")); - QCOMPARE(m_parsedData.license(), QLatin1Literal("GPL")); - QCOMPARE(m_parsedData.version(), QLatin1Literal("SomeVersion")); - QCOMPARE(m_parsedData.description(), QLatin1Literal("SomeDescription")); - QCOMPARE(m_parsedData.vendor(), QLatin1Literal("MyVendor")); + QCOMPARE(m_parsedData.name(), QLatin1String("InnerName")); + QCOMPARE(m_parsedData.path(), QLatin1String("/some/path/with/LibName")); + QCOMPARE(m_parsedData.license(), QLatin1String("GPL")); + QCOMPARE(m_parsedData.version(), QLatin1String("SomeVersion")); + QCOMPARE(m_parsedData.description(), QLatin1String("SomeDescription")); + QCOMPARE(m_parsedData.vendor(), QLatin1String("MyVendor")); } void GeneralMetadataParserTests::parse(const QString &jsonData, const QString &path) diff --git a/src/libraries/tests/modulemetadataparser_tests.cpp b/src/libraries/tests/modulemetadataparser_tests.cpp index a69cebb9..91f02bd6 100644 --- a/src/libraries/tests/modulemetadataparser_tests.cpp +++ b/src/libraries/tests/modulemetadataparser_tests.cpp @@ -57,8 +57,8 @@ void ModuleMetadataParserTests::test_emptyModule() { parse(R"({"name": "SomeName", "description": "SomeDesc"})"); - QCOMPARE(m_parsedData->name(), QLatin1Literal("SomeName")); - QCOMPARE(m_parsedData->description(), QLatin1Literal("SomeDesc")); + QCOMPARE(m_parsedData->name(), QLatin1String("SomeName")); + QCOMPARE(m_parsedData->description(), QLatin1String("SomeDesc")); QCOMPARE(static_cast(m_parsedData->submodules().size()), 0); } @@ -76,8 +76,8 @@ void ModuleMetadataParserTests::test_emptySubmodule() QCOMPARE(static_cast(m_parsedData->submodules().size()), 1); const auto submodule = m_parsedData->submodules().at(0).get(); - QCOMPARE(submodule->name(), QLatin1Literal("SubmoduleName")); - QCOMPARE(submodule->description(), QLatin1Literal("SubmoduleDesc")); + QCOMPARE(submodule->name(), QLatin1String("SubmoduleName")); + QCOMPARE(submodule->description(), QLatin1String("SubmoduleDesc")); QCOMPARE(static_cast(submodule->elements().size()), 0); } @@ -102,8 +102,8 @@ void ModuleMetadataParserTests::test_emptyElement() const auto submodule = m_parsedData->submodules().at(0).get(); QCOMPARE(static_cast(submodule->elements().size()), 1); const auto element = submodule->elements().at(0).get(); - QCOMPARE(element->name(), QLatin1Literal("ElementName")); - QCOMPARE(element->description(), QLatin1Literal("ElementDesc")); + QCOMPARE(element->name(), QLatin1String("ElementName")); + QCOMPARE(element->description(), QLatin1String("ElementDesc")); QCOMPARE(element->asn1Files().size(), 0); QCOMPARE(element->additionalFiles().size(), 0); QCOMPARE(element->conflicts().size(), 0); diff --git a/src/libraries/wizard/importcomponentwizard.cpp b/src/libraries/wizard/importcomponentwizard.cpp index cc90b605..1df95ac8 100644 --- a/src/libraries/wizard/importcomponentwizard.cpp +++ b/src/libraries/wizard/importcomponentwizard.cpp @@ -72,7 +72,7 @@ void ImportComponentWizard::accept() void ImportComponentWizard::raiseErrorWindow(const QString &message) { QMessageBox msgBox; - msgBox.setWindowTitle(QLatin1Literal("Operation failed")); + msgBox.setWindowTitle(QLatin1String("Operation failed")); msgBox.setText(message); msgBox.exec(); } diff --git a/src/libraries/wizard/relationslabelscontroller.cpp b/src/libraries/wizard/relationslabelscontroller.cpp index ac03688e..1912d43f 100644 --- a/src/libraries/wizard/relationslabelscontroller.cpp +++ b/src/libraries/wizard/relationslabelscontroller.cpp @@ -50,7 +50,7 @@ RelationsLabelsController::~RelationsLabelsController() namespace { void appendElementItems(const QList &references, - QHash &parents) + QMultiHash &parents) { QHash elements; for (const auto &ref : references) { @@ -77,7 +77,7 @@ void appendElementItems(const QList &references, void appendSubmoduleItems(const QList &references, QHash &parents) { - QHash submoduleItems; + QMultiHash submoduleItems; for (const auto &ref : references) { const auto name = ref.submodule(); diff --git a/src/libraries/wizard/vcshandler.cpp b/src/libraries/wizard/vcshandler.cpp index ba33a613..520194f0 100644 --- a/src/libraries/wizard/vcshandler.cpp +++ b/src/libraries/wizard/vcshandler.cpp @@ -73,17 +73,16 @@ void VcsHandler::addToVcs(const Utils::FilePaths &files) return ); const auto projectPath - = ProjectExplorer::SessionManager::startupProject()->projectDirectory().toString(); + = ProjectExplorer::SessionManager::startupProject()->projectDirectory(); if (!vcs->vcsCreateRepository(projectPath)) - throw std::runtime_error("Could not create repository in \'" + projectPath.toStdString() + throw std::runtime_error("Could not create repository in \'" + projectPath.toString().toStdString() + "\'"); } QTC_ASSERT(vcs->supportsOperation(Core::IVersionControl::AddOperation), return ); for (const auto &file : files) { - const auto filePath = file.path(); - if (!vcs->vcsAdd(filePath)) - throw std::runtime_error("Failed to add \'" + filePath.toStdString() + if (!vcs->vcsAdd(file)) + throw std::runtime_error("Failed to add \'" + file.toString().toStdString() + "\' to version control system"); } @@ -99,7 +98,7 @@ namespace { Core::IVersionControl *vcsForCurrentProject() { const auto projectDir - = ProjectExplorer::SessionManager::startupProject()->projectDirectory().toString(); + = ProjectExplorer::SessionManager::startupProject()->projectDirectory(); return Core::VcsManager::findVersionControlForDirectory(projectDir); } } // namespace diff --git a/src/projectcontenthandler.cpp b/src/projectcontenthandler.cpp index 45f8c39a..4aefa85b 100644 --- a/src/projectcontenthandler.cpp +++ b/src/projectcontenthandler.cpp @@ -117,8 +117,11 @@ void ProjectContentHandler::processFiles(const QString &projectName, Utils::FilePaths ProjectContentHandler::getStaleFilesPaths(const QString &projectName, const Utils::FilePaths &filePaths) const { + const auto filePathsSet = QSet(filePaths.begin(), filePaths.end()); const auto staleFileList = m_storage->getFilesPathsFromProject(projectName); - const auto pathsToRemove = staleFileList.toSet().subtract(filePaths.toSet()); + auto staleFileSet = QSet(staleFileList.begin(), staleFileList.end()); + const auto pathsToRemove = staleFileSet.subtract(filePathsSet); + return pathsToRemove.values(); } diff --git a/src/tree-views/decorationrolevisitor.cpp b/src/tree-views/decorationrolevisitor.cpp index dda8f526..1a4232d5 100644 --- a/src/tree-views/decorationrolevisitor.cpp +++ b/src/tree-views/decorationrolevisitor.cpp @@ -44,7 +44,7 @@ DecorationRoleVisitor::~DecorationRoleVisitor() {} QIcon DecorationRoleVisitor::valueFor(const Definitions &defs) const { Q_UNUSED(defs); - const static QIcon icon(Utils::Icon({{QLatin1String(":/utils/images/namespace.png"), + const static QIcon icon(Utils::Icon({{":/utils/images/namespace.png", Utils::Theme::IconsCodeModelKeywordColor}}, Utils::Icon::Tint) .icon()); diff --git a/src/tree-views/treeviewwidget.cpp b/src/tree-views/treeviewwidget.cpp index b0cdc41e..4ed99c60 100644 --- a/src/tree-views/treeviewwidget.cpp +++ b/src/tree-views/treeviewwidget.cpp @@ -98,7 +98,7 @@ void TreeViewWidget::setCursorSynchronization(bool syncWithCursor) QLayout *TreeViewWidget::createLayout() { QVBoxLayout *layout = new QVBoxLayout; - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addWidget(Core::ItemViewFind::createSearchableWrapper(m_treeView)); diff --git a/templates/wizards/projects/asn1acn/CMakeLists.txt b/templates/wizards/projects/asn1acn/CMakeLists.txt index 033b7982..9fdfdc8b 100644 --- a/templates/wizards/projects/asn1acn/CMakeLists.txt +++ b/templates/wizards/projects/asn1acn/CMakeLists.txt @@ -1,16 +1,16 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.21) project(%{JS: '%{ProjectName}'}) -set(ASN1ACNSOURCES DISTFILES += \\ - @if %{AddAsnFile} && %{AddAcnFile} - %{AsnRelativePath}/%{AsnFile} \\ - %{AcnRelativePath}/%{AcnFile} - @elsif %{AddAsnFile} - %{AsnRelativePath}/%{AsnFile} - @elsif %{AddAcnFile} - %{AcnRelativePath}/%{AcnFile} - @endif) +set( + ASN1ACNSOURCES + %{JS: if (%{AddAsnFile} && %{AddAcnFile}) + '%{AsnRelativePath}/%{AsnFile}\\\n %{AcnRelativePath}/%{AcnFile}' + else if (%{AddAsnFile}) + '%{AsnRelativePath}/%{AsnFile}' + else if (%{AddAcnFile}) + '%{AcnRelativePath}/%{AcnFile}' + }) include(asn1sccSettings.cmake) include(createFilesList.cmake) diff --git a/templates/wizards/projects/asn1acn/createFilesList.cmake b/templates/wizards/projects/asn1acn/createFilesList.cmake index 858808f3..fb52cf1a 100644 --- a/templates/wizards/projects/asn1acn/createFilesList.cmake +++ b/templates/wizards/projects/asn1acn/createFilesList.cmake @@ -70,7 +70,7 @@ endfunction() function(appendVolatileList outDir targetExtension result) foreach(fileName ${ASN1ACNSOURCES}) get_filename_component(extension ${fileName} EXT) - if (${extension} STREQUAL ".asn" OR ${extension} STREQUAL ".asn1") + if ("${extension}" STREQUAL ".asn" OR "${extension}" STREQUAL ".asn1") get_filename_component(fileName ${fileName} NAME_WE) tryCreateFile(${outDir}/${fileName}.${targetExtension}) set(result ${result} "${outDir}/${fileName}.${targetExtension}") From c80b8589e176e18cdaee759ead0bf96f303eb869 Mon Sep 17 00:00:00 2001 From: Igor Jarek Date: Tue, 1 Mar 2022 13:41:40 +0100 Subject: [PATCH 3/4] plugin-update-5.0.3-6.0.2 (2) --- templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri b/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri index f2480cf6..1b7eb2a7 100644 --- a/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri +++ b/templates/wizards/projects/asn1acn/handleAsn1AcnBuild.pri @@ -22,7 +22,7 @@ ####################################################################### isEmpty(ASN1SCC): ASN1SCC = $$(ASN1SCC) -isEmpty(ASN1SCC): ASN1SCC = asn1scc +isEmpty(ASN1SCC): ASN1SCC = asn1.exe isEmpty(ASN1SCC_PRODUCTS_DIR): ASN1SCC_PRODUCTS_DIR = $$shell_path($${OUT_PWD}/asn1sccGenerated) isEmpty(ASN1SCC_COMMON_OPTIONS): ASN1SCC_COMMON_OPTIONS = --acn-enc --field-prefix AUTO --type-prefix T isEmpty(ASN1SCC_C_OPTIONS): ASN1SCC_C_OPTIONS = --c-lang $${ASN1SCC_COMMON_OPTIONS} From 2f59d572bbf311c72bc7aef293badbe8cdb8f71d Mon Sep 17 00:00:00 2001 From: Igor Jarek Date: Tue, 1 Mar 2022 18:18:43 +0100 Subject: [PATCH 4/4] plugin-update-5.0.3-6.0.2 (3) --- src/data/types/labeltype.cpp | 6 +++--- templates/wizards/projects/asn1acn/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/types/labeltype.cpp b/src/data/types/labeltype.cpp index ff456995..6b331239 100644 --- a/src/data/types/labeltype.cpp +++ b/src/data/types/labeltype.cpp @@ -38,16 +38,16 @@ QString LabelType::name() const QString LabelType::label() const { - return QString(); + return {}; } Utils::FilePath LabelType::baseIconFile() const { - return Utils::FilePath(); + return {}; } QIcon LabelType::createIcon(Utils::Theme::Color color) const { Q_UNUSED(color); - return QIcon(); + return {}; } diff --git a/templates/wizards/projects/asn1acn/CMakeLists.txt b/templates/wizards/projects/asn1acn/CMakeLists.txt index 9fdfdc8b..ea9af31c 100644 --- a/templates/wizards/projects/asn1acn/CMakeLists.txt +++ b/templates/wizards/projects/asn1acn/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.13) project(%{JS: '%{ProjectName}'})