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>
Most of the code is unit tests for toolchain creation.
Change-Id: I955ba49db38acf6f9e35d366280b710ea0466655
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Fix crash while automatically restoring kits during startup.
Change packages container to set to avoid duplicates.
Use RAII for McuSdkRepository.
Change-Id: I4b3f4156f0bc770c8a5ea8a171b1f22f6ffb8f96
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Starting with Qt For MCUs 2.0, environment variables are not
used to track dependencies any more, but cmake variables are.
Due to time constraints, we implemented a env-to-cmake mapper
to cover that gap at the moment. This patch removes that hack
and implements tracking dependencies through cmake variables.
Task-number: QTCREATORBUG-26904
Change-Id: Id8553a764d212d9b12e4adc54fc56233bfeb9a5b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
FilePath::resolvePath accepts a FilePath param, but treats
leading hashes as indication of an absolute path.
FilePath::pathAppended only accepts QString,
but understands that the param is always a relative path.
In our case we always want to treat the paths as relative.
Change-Id: Ib23c27e76500de8a89d9dd22cd7efb95a9bd4d6d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
rename 'type' to 'toolChainType' in McuToolChainPackage
'addToPath' and 'relativePath' set in McuPackage constructor
put McuToolChainPackage methods together in same source file
'detectionPath' type changed from QString to FilePath
renamed boolean getters
Task-number: QTCREATORBUG-26897
Change-Id: If59c299901a169d08efa8f39614ef7c6d48d44ed
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
It was part of McuPackage, and only used by the SDK instance.
Task-number: QTCREATORBUG-27093
Change-Id: I9d9eaac621e9997129c227fae3ac88b502ba4340
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Several independent classes were mashed together in mcusupportoptions.cpp
This patch moves McuToolChainPackage together with McuPackage,
McuTarget to its own header+source pair, and
McuKitManager to its own header+source pair.
Task-number: QTCREATORBUG-26890
Change-Id: I0b51da4e1cae5a976201dffd290a665eaa318b33
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
And make more use of switch statements without a default case, so each
type is handled explicitly. (Ok, there is a default, but that is
Q_UNREACHABLE).
Change-Id: I30ccc447e55a5aeebebe1a9879ea3136545f5e68
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <piotr.mucko@qt.io>
This implies that those properties are now passed into the constructor,
and their setters are removed.
Change-Id: I34b4d9d7450897e6a7a72b8edaffdc05961546d1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <piotr.mucko@qt.io>
Also move `packagePathFromSettings` so it can be used from multiple
places. This function will probably move into a separate utility file
in future changes.
Change-Id: I208a5a7bc8aa689829178809a1f4053a961d93be
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <piotr.mucko@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>