Commit Graph

9354 Commits

Author SHA1 Message Date
Christian Kandeler
7c28f17481 QtSupport: Re-use ToolchainManager::isBetterToolchain()
... and upstream the additional check.

Change-Id: I6443987174f39e0953238cf2e8e07b4b1d8129bd
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 15:03:21 +00:00
Christian Kandeler
b6299edf1f ProjectExplorer: Factor out function to compare toolchain suitability
... and use in ToolchainKitAspect in addition to KitManager.

Change-Id: I4c9221735a660697baab667877cc335ee0ee3e78
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 14:47:30 +00:00
Christian Kandeler
077de5aab6 ProjectExplorer: Handle registering of auto-created bundle toolchains
... in the bundle itself, whenever possible.
It's very annoying to have to add this stanza in all places where
bundling takes place, and it's also easily forgotten, introducing memory
leaks.
This also nicely self-documents the expectations of the calling code as
to whether new toolchains can or cannot be created in the given context
as a side effect of bundling.

Change-Id: I78d2d4cdfc1010568f61f201b0d930b01f79a88b
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 14:34:47 +00:00
hjk
a5de0bd651 ProjectExplorer: Change language and language cateegory display storage
Effectively from container of pairs to pairs of containers.

Saves a few transformations and temporary lists at the price of
effectively storing the keys twice. This is all small stuff, so
it should not matter performance or memory-wise at all, but helps
me to reason about potential complexity on higher levels.

Change-Id: Idf9e235b64d97b1168278ea3dcda34a476c20c08
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-08 13:29:33 +00:00
Christian Kandeler
9cf9e0aa34 ProjectExplorer: Improve ToolchainKitAspect::setup()
- Use toolchain bundles.
- De-obfuscate the code.
- Add explanatory comments.

Change-Id: I19f4b5fde317ffabf06c762e1987b0314c52e646
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 12:33:15 +00:00
Christian Kandeler
5d0aebcbc7 QtSupport: Use toolchain bundles in QtKitAspect
Change-Id: I260d511c13255b156e35e70d7ebb08d78e23e23b
Reviewed-by: hjk <hjk@qt.io>
2024-08-08 09:00:58 +00:00
Christian Kandeler
5a300a7fb7 ProjectExplorer: Tighten ABI check
... when auto-detecting kits.
Take the entire ABI into account, including binary format and word
width.

Fixes: QTCREATORBUG-31119
Change-Id: I495faf3c54738750bddac65f5a1919144b9fecd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-08-07 10:56:02 +00:00
Christian Kandeler
6e2db380d0 ProjectExplorer: Use toolchain bundles when auto-detecting kits
Fixes: QTCREATORBUG-30630
Change-Id: I0929a809204ccd6f8e547987bc7bec42249efa32
Reviewed-by: hjk <hjk@qt.io>
2024-08-06 15:16:46 +00:00
Christian Kandeler
35493fddf1 ProjectExplorer: Fix possible crash in toolchain options page
Amends 020883c47f.

Change-Id: Ibc1cdd4a7cf67b39022cd5b4578a47f70512d3f6
Reviewed-by: hjk <hjk@qt.io>
2024-08-06 13:39:40 +00:00
Christian Kandeler
676a462d5d Docker: Improve Kit setup
- Use toolchain bundles, ensuring compatible C/C++ toolchains
- Try harder to match Qt and toolchains

Change-Id: I8739a5e1e75d08df4346d51cb0ee7704ca072489
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-08-06 11:54:20 +00:00
hjk
e88f65866c ProjectExplorer: Paddle back on IDevice aspect exposure
Make the aspects private, but provide accessors to value and
defaultValue as needed. This allows setters to be kept protected
when wanted.

Change-Id: I26f93f62d4ac2e7346f95543c38d8ac9156348c2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-06 11:13:40 +00:00
Christian Kandeler
020883c47f ProjectExplorer: Stop pretending that C and C++ compilers are unrelated
Motivation:
  a) It was ridiculous that when users wanted to manually
     add a new toolchain, they had to do the entire setup twice.
  b) It was equally weird that users had to take care to choose
     matching toolchains when setting up a kit, or indeed that it was
     even possible to mix random toolchains in the first place.

User-visible changes:
  - The "C" and "C++" categories in the toolchain settings page have
    been merged into a single "C/C++" category.
  - When adding a new toolchain, the "C" and "C++" sub-menus are gone.
    Instead, the toolchain config widget offers two path choosers if
    the respective toolchain type supports C and C++ compilers.
  - By default, the C++ compiler file path is derived from the C
    compiler file path automatically, so the user usually has
    to enter only the former.
  - In the kit settings page, the "C" and "C++" toolchain combo boxes
    have been replaced by a single "C/C++" combo box, relieving the user
    of the responsibility to choose two matching toolchains.

Implementation:
The notion that a Toolchain object corresponds to a single compiler is so
deeply engrained in the code that it cannot realistically be changed in
the short term. We therefore introduce the concept of a "toolchain
bundle" as an additional layer that groups matching C and C++ toolchains
together. This way, most code dealing with toolchains stays unchanged,
and only the presentation layer (i.e. the toolchain and kit settings
pages) needed to be rewritten. Once set up in a bundle, toolchains stay
implicitly linked together so the matching only needs to be done once.

In follow-up patches, we will make use of toolchain bundles in all the
places where kits are auto-created, eliminating the risk of mixing
incompatible toolchains in a kit.

Change-Id: Ie6c5add9963e7c1096268dd77acd624671b2674f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-08-05 15:35:48 +00:00
hjk
08d6b86162 ProjectExplorer: Use FilePathAspect for IDevice::debugServerPath
... and IDevice::qmlRunCommand, currently for storage only.

Leave the GUI side as-is for now, as this synchronizes the widget
content with the local copy of the device data to allow the
device tester to be run with the visible data.

Change-Id: Ie8fb967c9a7f8246eec71d52c9b714ca3b3f5acd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-05 15:08:13 +00:00
hjk
6473e636d3 ProjectExplorer: Remove IDevicePrivate::debugDumperPath
Forgotten to remove in de546ff3ec.

Change-Id: I56233545ba5ed8f302091fc2d874f327ab7a4896
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-05 11:46:24 +00:00
hjk
00daa669ad ProjectExplorer: Fix assert
The build key is legitimately empty for CustomExecutableRunConfig.

Amends 07df45cdeb.

Change-Id: Iadc992b772913599e5af0d5ea5104188707fad45
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-02 14:29:36 +00:00
hjk
2a7bf0fdaf Project: Base IDevice on AspectContainer
This is effectively the same approach as taken with ProjectConfiguration.

Having the settings separate leads to quite some boilerplate and in the
end to parallel IDevice and DeviceSettings hierarchies.

The unusual registration of the docker aspects are due to the multiple
inheritance, we need to "dynamic" downcast.

Change-Id: I50864e2009f4e525d635decf1c9beaad5e6a5f1f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-02 13:30:01 +00:00
hjk
b6eff1b9cf ProjectExplorer: Change IDevice::toMap signature
From  Store toMap()  to  toMap(Store).

More symmetric code on the user side and better in line with
ProjectConfiguration/AspectContainer at the price of a few
more lines in the base.

Change-Id: I6069c96c250c1846e870879bcb52c58fdd806478
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-01 14:54:43 +00:00
Christian Kandeler
ab09e2dc3c ProjectExplorer: Sort initial list of toolchain executables
This makes things more deterministic and ensures we consistently prefer
the version-less variant from a set of file paths pointing to the same
compiler executable.
Example on my machine:
  /usr/bin/aarch64-linux-gnu-gcc
  /usr/bin/aarch64-linux-gnu-gcc-14.1.0
  /usr/bin/aarch64-linux-gnu-++ (no versioned variant present!)
Before this patch, QtC preferred /usr/bin/aarch64-linux-gnu-gcc-14.1.0
to /usr/bin/aarch64-linux-gnu-gcc, because it was found first when
iterating the directory, and then discarded /usr/bin/aarch64-linux-gnu-
gcc as a duplicate, which resulted in an ugly asymmetry between the C
and C++ toolchains.

Fixes: QTCREATORBUG-31132
Change-Id: I2da252beda1b565e66906f10fa1e8a9d36ad852c
Reviewed-by: hjk <hjk@qt.io>
2024-08-01 12:03:25 +00:00
hjk
3c78954d5a ProjectExplorer: Simplify AppOutput context menu creation code path
Change-Id: I7ce938e87b7b714bcfad60ef8e0932544d3cb15e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-08-01 08:35:44 +00:00
hjk
255e63bebb ProjectExplorer: Remove indirections when accessing AppOutputPane
This intentionally keeps the lifetime (almost) identical.

Change-Id: Ic420d8c5f89eaad33e38160bb8ee26965830047f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-31 16:17:03 +00:00
hjk
10b17940c8 ProjectExplorer: Make RunControl final
This makes later reasoning on what can (not) happen in the destructor
easier.

Change-Id: Icec12738e37c95d8d318d0d8fc2bc9b0b60e436d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-31 14:12:26 +00:00
Christian Stenger
ad42cf0dae PE: Fix compile with older Qt
Otherwise meta object system complains.

Change-Id: Ibb929e7341aac92b8272d9647d25e88bb9668319
Reviewed-by: hjk <hjk@qt.io>
2024-07-31 14:04:59 +00:00
hjk
f752989f83 ProjectExplorer: Move AppOutputPaneSettings closer to AppOutputPane
And make CloseTabMode private.

Change-Id: Ia53fb6d06da59e8fe66020194b6b670868ef83e4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-31 13:29:24 +00:00
Eike Ziller
c0fd0ab7b3 Welcome: Show open files in summary if there are no projects
In expanded items in the session list in Welcome mode.

Adapt the project display too: We showed the base name of the project
file as the project "title", which is "CMakeLists.txt" for all CMake
projects, and also for other projects doesn't really add interesting
information over the file name that we show.

If there are projects in the session, show a title "Projects" and the
list of open project paths.
If there are no projects, but open files, show a title "Files" and the
list of open file paths.
Limit the list of paths to 5 in both cases (adding "..." if there are
more).

Fixes: QTCREATORBUG-7660
Change-Id: I2e250c54f88932aaa95b926f60e0005da9c7a89e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-31 12:34:53 +00:00
Eike Ziller
55615f63f7 EditorManager: Split reading the settings from actually doing anything
So we can add reading the settings just to retrieve a file list in a
second step.

Task-number: QTCREATORBUG-7660
Change-Id: I65856ab97bfe2ee69194d484926f83621fa85327
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-31 12:34:25 +00:00
Alessandro Portale
61c19d78ff Debugger: Move "beetle" overlay on the mode bar action down by 1 pixel
Change-Id: I5b41e4a58069f4aef67a6c46c18a7a3f725b2e7c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-31 10:43:22 +00:00
hjk
7145dde235 ProjectExplorer: More private and final for AppOutputPane
Q_OBJECT is also not needed.

Change-Id: Ic79232b5097b6619ecc356b02f31671120596103
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-31 10:35:24 +00:00
hjk
84c42a7fea ProjectExplorer: Move some AppOutputPane related stuff
... closer to AppOutputPane.

Change-Id: I6b6d6d8d7522e380b7c69efd6ec5d816ae0fb324
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-31 08:49:26 +00:00
Christian Kandeler
e75b9f32a9 ProjectExplorer: Make custom toolchains C/C++ only
That's what they were intended for. There appears to be no use case for
them to represent e.g. a nim compiler.

Change-Id: I8070fb837fe411c3e2b6e5a335e642497437896d
Reviewed-by: hjk <hjk@qt.io>
2024-07-30 11:42:12 +00:00
Marcus Tillmanns
e37796d1c6 ProjectExplorer: Fix uses of "FilePath::toString"
Change-Id: I7199dec620b7e09765c44b571b93575eda5c5a74
Reviewed-by: hjk <hjk@qt.io>
2024-07-30 08:26:09 +00:00
Marcus Tillmanns
efa20f528f ProjectExplorer: Escape summaries
When the arguments contained html-tag like parts (e.g. "<br>") they would disappear from the summmary.

Change-Id: I7e286ef439af2883152a147aad55f2b9bea6e2d3
Reviewed-by: hjk <hjk@qt.io>
2024-07-30 08:03:01 +00:00
Alessandro Portale
a0e37a76fa Plugins: Add URLs to manual page to plugin metadata
Fixes: QTCREATORBUG-31199
Change-Id: Ideadc75499f32a8f1d1c95cd38dc4669a3d422c3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-29 07:27:29 +00:00
hjk
f49523029a Remove #include <utils/fileutils.h> from most header files
It has some platform specific warts, filepath.h is somewhat
cheaper and less ugly overall.

Partially clean up surroundings

Change-Id: Ida1fd470ec020f69c446109427f92a08e879789f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-07-26 10:41:16 +00:00
hjk
87280f25ce Utils: Use more views in Id setup
Since this means that StringBuilder expressions are not usable
as arguments anymore, use .withSuffix() more extensively.

This makes this "unusual" construction also a bit better findable.

No measurable performance gain or loss in either direction.

Change-Id: I04508e77764455bd9d3a21eda63bc6de01508e4b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-26 08:00:00 +00:00
Eike Ziller
3bbfd66bad Merge remote-tracking branch 'origin/14.0'
Conflicts:
	src/plugins/android/androidmanager.cpp
	src/plugins/android/androidrunner.cpp
	src/plugins/android/androidrunner.h
	src/plugins/qmldesigner/components/texteditor/texteditorview.cpp
	src/plugins/qmldesigner/components/texteditor/texteditorview.h
	src/plugins/qmldesigner/designmodecontext.cpp
	src/plugins/qmldesigner/designmodecontext.h
	src/plugins/qmljseditor/qmljseditingsettingspage.cpp

Change-Id: Idada49bb7441e8c5b748bd75b2e6bb2351bd323e
2024-07-25 12:56:53 +02:00
hjk
a43d687a10 ProjectExplorer: Add a trival BuildConfiguration
So people can at least add a custom build step

Change-Id: I78f3601233c776501bdc73fb7d67cbfeb886ced2
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-23 10:04:46 +00:00
hjk
89aa5c984f ProjectExplorer: Make custom build step id accessible
Change-Id: Ia1877c4b14fbdc91e6cc1e24b0ee0182f548c5fd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-23 10:04:40 +00:00
Christian Stenger
370c2d7787 Debugger: Fix snapshot handling
Avoid sharing the workers with the engine creating the
snapshot to avoid closing both when stopping the debugger
engine for the snapshot.
Correctly detach at finish to avoid having a runcontrol
appearing still running.

Fixes: QTCREATORBUG-31220
Change-Id: Iccb54b0fc2d7f5bf54b42a116e56c1a840b1f46e
Reviewed-by: hjk <hjk@qt.io>
2024-07-23 09:03:40 +00:00
hjk
95cf4a46ff ProjectExplorer: Remove left over assert
Amends 07df45cdeb.

Change-Id: Ic4520020cd57eac72631efee05ca9b55e62e34e6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-22 09:42:22 +00:00
Jarek Kobus
2a5c2765c4 ProjectExplorer: Introduce JsonWizardGeneratorTypedFactory
Limit code repetition by introducing convenient class template.

Change-Id: I90b45a305c5a6f28bf75a602c14ff055928cda48
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-22 05:37:40 +00:00
Christian Kandeler
9d0c144892 ProjectExplorer: Let toolchains be (de)registered in bulk
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>
2024-07-19 14:44:47 +00:00
Christian Kandeler
eb6c95b50d ProjectExplorer: Fix restoring toolchains
Amends ec5e055a90.

Fixes: QTCREATORBUG-31263
Change-Id: Ic86149d9916cdef6991fed4b9972f4d44dfe8b7c
Reviewed-by: hjk <hjk@qt.io>
2024-07-19 14:43:48 +00:00
hjk
e9e793fb6a Autotools: Hide AutotoolsBuildSystem definition in .cpp
Change-Id: I7ef251452c522593da955a64024068682f7fdfb1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-07-19 14:41:57 +00:00
Eike Ziller
8a060b285a Fix in-wizard translation support
We in principle support a map of locale->string for keys starting with
"tr" like "trDisplayName". This didn't work everywhere.

We may not cast the value for these keys to QString before passing it to
`localizedString`, since that would result in an empty string if the
value is such a map.

Also fix the documentation since we remove all parts from '_' (to also
get rid of encoding parts).

Fixes: QTCREATORBUG-23575
Change-Id: I2be795053e645c8bf81417d0db69cd7e63eff022
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-19 09:36:52 +00:00
Jarek Kobus
0051d273d3 Various plugins: Remove unused variables
Found by Axivion plugin.

Change-Id: I628b00e4525b004c702dd8753af31cb3fedf1739
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-18 15:08:48 +00:00
Jarek Kobus
4249bb56a3 ProjectExplorer: Remove redundant signals
The enabledChanged() signal is already a member of BaseAspect,
so no need to repeat this signal in subclasses.

Found by Axivion plugin.

Change-Id: Ifc12dc97e134ff1f873df2e5fa5830be55777b81
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-18 14:53:39 +00:00
hjk
07df45cdeb ProjectExplorer: Remove id/buildkey mangling support for runconfig
This was used for qmake and cmake up to Creator 4.11 (Dec 2019).
Projects created or touched afterwards are unharmed.

Projects created before that and not touched since then will lose
runconfigurations.

Change-Id: I745aa3641749462a0420df6f658055a78fd52c8e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-07-18 11:50:01 +00:00
hjk
9ca10fadb8 Utils: Add a simple way to make a Utils::TreeView searchable
Call setSearchRole(...) to create a suitable find aggregate.

Use it in a few places.

Change-Id: Iaa663d13bbc7776019e7b18ea720cc2411e0b691
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-18 09:37:53 +00:00
Alessandro Portale
3fe4928626 Use QObjectList alias
Change-Id: I11d4071088e2b44c37d4a8ac59945fe49fe68351
Reviewed-by: hjk <hjk@qt.io>
2024-07-17 15:14:33 +00:00
hjk
1aef2e2591 ProjectExplorer: Fix after async path verification in JSON wizards
After 83111bb3, the path validity result was coming in later and
was not considered for the page completeness check any more.

Fix that by running the check again when the path result is ready.

Change-Id: I2aab6b2130896d63f7e0359ced39e758393a2644
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-17 10:03:26 +00:00