When some code adds or removes a bunch of toolchains at once, that
should be made explicit and also be reflected by the respective signal
emissions.
Fix some leaks and typos along the way.
Change-Id: I4a1f12a2378316c5faf70e85a88adc467f076caf
Reviewed-by: hjk <hjk@qt.io>
That's what the implementation does, and judging from the using code
wasn't quite clear.
Change-Id: I4ca776ba4da83a36162adad2dd595eb39eb0f43d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We normally use arm-none-eabi-gdb-py, but this doesn't come
with the new arm gcc version which ships with Qt for MCUs 2.8.0
To make sure the kit works, use this as a fallback.
Task-number: QTCREATORBUG-30699
Change-Id: I85c6c3ea1f7aae504e0aa1afb8a344d9bc3067d5
Reviewed-by: Kwangsub Kim <kwangsub.kim@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The settings keys are versioned to avoid the situation where the
installer removes a settings key which may still be in use.
See QTCREATORBUG-29194 for details.
When reading from user settings, it makes more sense to use the
non-versioned keys, especially in the case of the main Qt for MCUs
SDK package path. With this patch, the plain settings key is used
to read and write except for when determining the default value of a
path in the McuPackage constructor, where we want to also look in the
system scope settings for the values written by the installer, which
may be version specific
Task-number: QTCREATORBUG-30810
Change-Id: Ib1e2be170cb7da24b6e4534b59f702b894556d8c
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In an accompanying change, the installer writes versioned
settings keys. The version string will be appended to the
existing key, after a single underscore character.
When reading from the settings, the plugin first looks for
keys matching one of the requested versions from the kit.
Optionally, if no key for a matching version is found, the
key for the newest version available is chosen. This only
applies to the Qul SDK package for the time being.
If no suitable versioned key is found, the plain unversioned
settings key is picked
Task-number: QTCREATORBUG-29194
Change-Id: I2db888390cfb64a4b7c78ebcf795543251cb7a1b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In case the g++ symbolic link does not point to any g++ executable it
should be possible to pick other installed g++ versions
Fixes: QTCREATORBUG-29891
Change-Id: I3070e38617a85489e1e6bfb3b1a6368af684829f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
After this one, is compiles with the opt-in macro. Not changed yet,
though.
Change-Id: I29a66ecb5daa71d0d97566b81fd9f47d92f6368a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
If an environment variable corresponding to a package dependency
was set, this took precedence over the path set in the settings
file, making it impossible to change in the UI. With this change,
the environment variable is only used when no matching settings
entry is found.
Task-number: QTCREATORBUG-28488
Change-Id: Iee2e0bec402a4dce2f9590cd86ca3854e1e5ae90
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Path macros were expanded when applying new paths in the
McuSupport options widget, but not when pushing the reset button.
This resulted in paths like {Env:PROGRAMFILES}/SEGGER/JLink,
which are displayed as an error in the UI. The reset-button is
now connected via a signal in McuPackage to the options widget,
since the macro expander is not accessible to the package object
directly.
Task-number: QTCREATORBUG-28500
Change-Id: I962c6eb83142be87e02debbf34f0602683fe6966
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The path to the Qul SDK entered in the settings path persisted in
the UI when re-opening the settings page, even if it was not
applied. Kits and the settings file are not affected unless
pressing apply so this did not affect functionality. Un-applied
changes are discarded by re-reading the path from the settings
file in the constructor for the settings page.
Task-number: QTCREATORBUG-28568
Change-Id: Id03be22fba429e4764493cd3bedf45faa6908637
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The json kit files have an entry named "type" which is intended to
specify whether a specific path points to a file or a directory (or
something else). Until now, this entry has not been handled and all
lineEdits expect a path, thus appearing red in the UI if supplied with
a file. With this patch, support for the type "file" is added, with the
possibility to support further types in parseLineEditType.
Currently, only File and ExistingDirectory are supported, with the
latter being used by default whenever no "type" entry is specified.
Task-number: UL-6610
Change-Id: I252d4eff76d4a11b92ce55a0c0964446072e48c1
Reviewed-by: Daniele Bortolotti <daniele.bortolotti@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Packages without version detection should not get a version warning,
even if the json contains a version list. With this change, a package
without version detection will not get a status with invalid version.
Additionally, in the case of failed version detection, it would be
helpful for the user to list the acceptable versions. The status text
was updated to list these.
Change-Id: I814a86c741d573732072206ef1e969790f175e6a
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The recently added McuPackage::Status::ValidPackageVersionNotDeteced is
supposed to be a valid status for an McuPackage, similar to
ValidPackageMismatchedVersion. It produces a warning symbol, but is not
supposed to block kit creation.
Task-number: QTCREATORBUG-28246
Change-Id: Ifdc8488d28019ec76d29114501876c6d7d5e700c
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Daniele Bortolotti <daniele.bortolotti@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The current criteria allows to select LLVM so that it can cause
an unexpected behavior. Explicit toolchain type check will prevent
the invalid toolchain setup.
Change-Id: Ib0afa4304650dd451c12d7a8d950b26115661862
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Daniele Bortolotti <daniele.bortolotti@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Instead of calling the update function manually unconditionally it will be
called through a connection.
Change-Id: Ibfd3efd0fbaa66c4857d8a15c202472e1f00f576
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
If a match was empty it was the same case as if no regular expression was
set. Adding a new case that is triggered when there is a version detector
but it returns an empty version string.
Change-Id: I26c2f803b2c6a95b85d6b781085bfa9cd4b51975
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The function updateStatusUi is modifying children of the main widget.
In case the package changes when the MCU dialog is not present anymore it
tries to access invalid widget pointers.
Change-Id: I9127114caf03b4ea047b075e875f20bb3e0c02b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
After the options dialog has been closed, all widgets are deleted but
the m_fileChooser will not be set to nullptr again.
Avoiding to use the widgets for data based accesses.
Change-Id: I5d99fc4a34ecd9d22e26854c6956e9c0116de94b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Writing with an empty settings key will result in multiple packages writing
their value in the same key "Package_", with the suffix missing,
overwriting each other.
Change-Id: Iee3e042a2d9d5d1f4e34b903360129ba25b6f6ea
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: hjk <hjk@qt.io>
QtMCUs will support MinGW toolchain for Windows desktop platform,
so MinGW toolchain needs to be identified.
If the default toolchain or a user configured one is a correct
MinGW toolchain, it would be selected. If not, a proper toolchain
would be picked up from the registered toolchains in Qt Creator.
Task-number: UL-6607
Change-Id: I82580d721d9ed916a6b32d35c124a638d7a3e68e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
After refactoring, the package labels are sourced at run-time from json
kit files. Added a QMap containing all the known labels used to map
labels to their translation, McuPackage::packageLabelTranslations.
Task-number: QTCREATORBUG-27177
Change-Id: Ibd530a0f9c5dbbdf8c7d5eafa53785fb713c9d0a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This synchronizes JSON files used by unit tests with files
in QtMCUs repo. To do that some changes in code were needed.
QtMCUs package is no longer created for each JSON file. Because of
its nature it's created once and passed to each target.
Unit tests now have verifyPackage function to avoid duplication
of checks.
In test creating target QtMCUs package is checked beside toolchain
ones.
Change-Id: I5dea470daf184b45facfaaa793c359310ac22fc1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
... by a new PathChooser::textChanged signal.
They were both emitted in reaction to the underlying line edit's
textChanged() signal.
Use 'textChanged()' as name to mimic/match the Qt side. This also
makes it more clear on the user code side, when this happens.
Some textChanged() consumers should probably use editingFinished()
instead, but that's left for later changes.
Change-Id: Ib07347f616cbf1c5d09bc2f8671ca860d185d1f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).
Change-Id: Ib644dd6178bf9e0a1a75a2c6cf49fd5f3d121cf4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Packages are created as defined in JSON. Some paths
contain variables. This creates dependencies between
packages. After all packages are created and collected
environment variables are evaluated in one pass. McuTarget
packages get updated.
This is needed because we shouldn't show the user paths
with variables in them. Also file picker wouldn't work.
There will be cmake variables support in separate commit.
Change-Id: Id210ea394f3f5bb5a14d87f3cf6a0a9a99e690bf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
To be able to check the validity of a desktop toolchain used in an
mcusupport kit with qt platform.
Task-number: QTCREATORBUG-26750
Change-Id: Ifc518257844c8994150f3d86eb5512701c38c2b7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Create appropriate instance of version detector depending on
parsed data from JSON and pass it to McuPackage's ctor. Also tests.
Change-Id: I4f7e5cd6d998745dfe951284c34904526abc216b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Toolchain package represents information about compiler and toolchain
file (.cmake). This information is parsed from JSON and used for Kit
creation. This includes cmake variables, path to compiler. This patch
extracts information about toolchain file into separate McuPackage.
Change-Id: Id165bdc5afa5d7cf5b5c96620e11cb878254c181
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>