Commit Graph

88653 Commits

Author SHA1 Message Date
Sivert Krøvel
3be0b263a8 McuSupport: Read and write user settings with non-versioned key
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>
2024-06-04 12:19:14 +00:00
hjk
6231213aa3 Utils: Make contents margins handling less special
Change-Id: I985419bbb213aba899c83efb49b376e0f3338bd5
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 12:16:03 +00:00
hjk
b10d5581e4 Utils: Make LayoutBuilder setter setup less repetitive
Change-Id: I9113f7a97566c21cf83dcb95ce8e75e9707360b4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 12:15:37 +00:00
Christian Stenger
968e47194c VCS: Fix handling of default executable
We set the executable by default to a single command which
should be used as found in PATH.
Although listed valid in settings some commands refuse to
run when we validate the command before running without
taking their full path into account.
Use the full path of vcs binaries internally to avoid
problems but still display single command if set.

Change-Id: If8677b531c5534d27c19557ed36fa780a248558f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-06-04 11:49:39 +00:00
Jarek Kobus
f1d0aee486 ProjectExplorer: Add projectnodeshelper.h into project
Otherwise this file is exlcuded from project search results.

Change-Id: I65ce5121ac105f5565c46e4b5a5fbd74bee966d6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-04 10:59:48 +00:00
hjk
1c9242bab2 LayoutBuilder: Potentially save a few cycles
... by not actually creating the unused instances of the Id types.

Change-Id: I6955046fa1b457ea70d36090d3bf0051b31dfdaa
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 10:52:59 +00:00
Leena Miettinen
440c579ec0 Doc: Remove references to Qt 4 and < Qt 5.15
Leave only mentions to things visible in the UI and
to compatibility functions.

Fixes: QTCREATORBUG-30883
Change-Id: Id63d791f79363c2f4c2602bb8c0ed656a9ceab29
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-06-04 10:28:19 +00:00
Eike Ziller
3c71998e34 PluginManager: Fix -load all -noload Plugin
Setting a plugin forceDisabled must also remove the forceEnabled flag
and vice versa.

Broke in b39b192518

Change-Id: I9c2b84de0753a1b283c301b9868650e62c088144
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-04 10:17:05 +00:00
Christian Kandeler
408e986f2b ClangCodeModel: Fix potential crash
... when removing from the list of FollowSymbol operations. The done()
callback of ClangdFollowSymbol messes with the list, so call cancel()
after removing the corresponding iterator.

Change-Id: Ibb72ffa436598692e48119d93d430bb79bcb0f5e
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 09:21:25 +00:00
Orgad Shaneh
173aed9b8e C++: Fix compiler warning
warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data

Change-Id: I3a8203c1662cfba36ebe28ad3bd1b5ff46b55dfe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-06-04 09:04:05 +00:00
Cristian Adam
725cf0637f CMakePM: Skip .obj/.o for static qml plugins in PATH
Amends 5d159e6185

This commit reverts to Qt Creator 12 behavior, plus skipping .obj/.o
parts which are needed for linking but not for finding out library paths
that need to be added to PATH environment.

Tested with https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/
qml/tutorials/extending-qml/chapter6-plugins

Without the patch (Qt Creator 12 behavior):

"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_resources_1.dir/.qt/rcc",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_init.dir/chartsplugin_init_autogen",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_init.dir",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts",
"C:/Qt/6.7.1/mingw_64/lib",
"C:/Qt/6.7.1/mingw_64/bin"

With the patch:

"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts",
"C:/Qt/6.7.1/mingw_64/lib",
"C:/Qt/6.7.1/mingw_64/bin"

As you can see above, only skipping the .obj/.o files will bring a lot.

The change also doesn't come with the side effects of the Qt Creator
13.0.0/1 releases.

Task-number: QTCREATORBUG-29662
Change-Id: I264a0ef579177b7129471919b77cd22a46e7d511
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 09:03:31 +00:00
Christian Kandeler
bfd3b88bb8 RemoteLinux: Do not announce connection attempts from non-UI threads
This can lead to a deadlock. Example scenario:
  - Have a kit with an unreachable device as the build device.
  - Open a project with a .user file not matching the current QtC.
  - The target setup page will open, showing a candidate widget
    for each kit. These widgets contains path choosers, which nowadays
    start a dedicated thread to validate their input.
  - The path validation thread for the Linux kit arrives at setupShell()
    and tries to announce the connection attempt. To that end, it
    invokes a method of Core::ICore::infoBar, using
    Qt::BlockingQueuedConnection, as otherwise the call would either
    not be tread-safe or arrive too late.
  - As the InfoBar lives in the main thread, control is now passed back
    to that one, and the target setup page continues its work, which is
    to gather candidates for importing a build from. This involves
    perusing potential build directories for all kits. In case of the
    Linux kit, QDirIterator is backed by a remote call to find(), which
    triggers a call to runInShell(), which tries to acquire the mutex
    that is already held by the path validation thread, which in turn is
    waiting for the UI thread.
  - Qt Creator now hangs indefinitely.
Skipping the announcements for non-UI threads limits the usefulness of
this feature, but I don't see a better way.

Change-Id: I816c83358f543aa9a6e6e97eee7fa8ad95e66ea8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 09:02:40 +00:00
Marcus Tillmanns
a30eb2ccc4 Utils: Fix terminal process environment
The TerminalInterface did not fallback to the system environment
if no environment was set by the user. Instead it had platform
specific code that saved over the path.

Instead we just apply the user changes to the system environment.

Change-Id: I011f1a9d935c958265b2bda8257ad8611f06e578
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 08:43:01 +00:00
Marcus Tillmanns
249312acd0 Lua: Add -loadluaplugin startup argument
Change-Id: Ia0a57bbb94d42534857889a0d08ec41c75708dca
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 08:03:13 +00:00
Marcus Tillmanns
8965e12d4f ProjectExplorer: Add readOnly handling to runconfig aspects
Change-Id: If8ebd2d13c22bf60f50bb55a7b61f15ba81e481b
Reviewed-by: hjk <hjk@qt.io>
2024-06-04 07:30:20 +00:00
hjk
4a4eda1b09 Debugger: Simplify some redundant file property checks
Change-Id: Ie6d638d0ece7b08dc28058f74f4c37910ffb6d83
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-04 07:06:07 +00:00
hjk
a726e5d349 Utils: Let all FilePath::is*{Dir,File} return false when empty
Less guessing on the user side what effectively happens.

Change-Id: I6ace4645d40346ee942ae7390575f28992dd0c26
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-06-04 07:05:56 +00:00
Eike Ziller
1543ead1b6 Add change log for 13.0.2
Change-Id: I6f80bc14b472ec9ec402a40e850ae86d46a29a5a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-06-04 06:50:16 +00:00
Cristian Adam
5d159e6185 CMakePM: Only add external "bin" dirs to PATH
At QTCREATORBUG-29662 we have the issue when a program cannot be started
because the PATH environment variable had content longer than 2048
characters.

Qt Creator 12 had only one place that added paths to librarySeachPaths
namely the "bin" directories.

Qt Creator 13 tried to filter these "bin" directories to the ones that
have .dll files. This fixed QTCREATORBUG-29662 but had issues with dlls
having different names than the link libraries provided by CMake.

By only allowing "bin" directories from paths not from the build
directory we allow Qt, or OpenSSL dependencies, but not just existing
"bin" directories.

Amends 0d8a542b4f
Amends 8713919f31
Amends ac97ab1abf
Amends 2ce6255a7d

Task-number: QTCREATORBUG-29662
Change-Id: If0b162f25ae1e5bfc1e1ff313720c54c5ae936c5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-03 13:33:55 +00:00
Eike Ziller
181d18e925 Fix another plugin json
Amends 6cd7aed8eb

Change-Id: I73667ca94aa746ef9e91984c2257efa842387adb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-03 13:25:45 +00:00
David Schulz
ff12f2f680 ProjectExplorer: avoid scanning file contents to detect the node type
Change-Id: I735464bed8d546475036e0d5ea61dc7cbbe78975
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 13:19:45 +00:00
Eike Ziller
5941c68dbd Find: Save settings in session
Usually the directories and search terms relate to the project(s) worked
on, so save them in the session.

Fixes: QTCREATORBUG-793
Change-Id: Ia00597a91fa3a902d6b8b4f2d8cb93634cdc333c
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 13:12:59 +00:00
Eike Ziller
f7c7cd0ae9 Find: Avoid saving default values for advanced search
Change-Id: I69454675c15a9eb92d0665ea6f88f0969a532eb8
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 12:03:54 +00:00
Eike Ziller
f870e7ffdf FindFilter: Move settings saving to Store
This makes it possible to save it for the session instead/in addition.

Task-number: QTCREATORBUG-793
Change-Id: I95bc20f4912a97863cb88849e32699a689ba6f3f
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 12:03:44 +00:00
Christian Stenger
c3a1b41fb3 Cppcheck: Fix handling of default executable
On Unix we set the default just to cppcheck and mark it even as
valid if it can be found in PATH.
But when running we silently fail as we expect a full path before
launching the executable.
Use the effective binary instead.

Change-Id: I03393b1d227c595da5142fce6b8bea5210a15747
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-06-03 12:03:40 +00:00
Christian Stenger
a6fabc48a3 Utils: Add effective binary getter to FilePathAspect
It is quite common to provide a single command as default value
for commands to be executed.
In several cases we fail to handle this correctly when trying
to validate or using the executable although it is validated
correctly inside the underlying path chooser.
This patch provides a method to explicitly get the effective
binary, means either the configured path or if it just had been
a single command it retrieves the full path information by
looking up the command in PATH.
This functionality is limited to non-device file paths which
are expected to be an (optionally existing) command.

Change-Id: I17db69f546f5fb9fec8809db91232f212d21e9a6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-03 12:03:29 +00:00
Eike Ziller
6db18c34c4 Merge remote-tracking branch 'origin/14.0'
Change-Id: I5cdfedcbdde6bb526ee02007a3dbc136c7d61353
2024-06-03 12:35:34 +02:00
Eike Ziller
bb904d878f Bump version to 15.0.0-beta1
Change-Id: Ie40901ed9205ce93f0307cb912d5c626469bc53d
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 10:25:25 +00:00
Eike Ziller
3d828123be Merge remote-tracking branch 'origin/13.0' into 14.0
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: I71bfee426a3e25ab7c7cd276ffe1e7d8fe550ffe
2024-06-03 12:23:06 +02:00
Jarek Kobus
100e106e70 MessageManager: Transform MessageManager class into namespace
Rename internal static m_messageOutputWindow into s_messageOutputWindow.
Make is a std::unique_ptr.

Change-Id: I27e9abf3dfa514d21f85d811e3647f65c26ddf31
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 09:52:28 +00:00
Jarek Kobus
8b5b914846 LocatorMatcher: Ensure the task list isn't empty
Change-Id: I4a8dac16e7f68df409bc7838ba0101732864a578
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 09:52:17 +00:00
Jarek Kobus
649d1cd6dc LocatorMatcher: Get rid of ResultCollectorTask
Simplify the implementation by creating and running the
ResultsDeduplicator directly on task tree start.

Change-Id: I08a0d2b924f92382c31771d4bbd878cc5506501e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 09:52:09 +00:00
Marcus Tillmanns
3e7f6237b0 LuaLSP: Use cached release url
Change-Id: If099374736912361f898c956e571fb52dbd1fa06
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 09:26:41 +00:00
Marcus Tillmanns
a273990819 Lua: Fix LSP Plugins
Change-Id: I8d79d6c56ef4f0e54866a84f0e4535c7f507e963
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 09:26:30 +00:00
Marcus Tillmanns
7ad1e20a48 Lua: Add support for gzip files
Change-Id: Id342364ffb71b8dd2e60a4332fd1d88a4951e08a
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 09:15:09 +00:00
Marcus Tillmanns
1058f12a93 Install: Use QMessageBox as fallback
Use a QMessageBox if the InfoBar would be hidden.

Change-Id: I29f10a3af6123dcf7811db68b967259f990c5a66
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 09:15:00 +00:00
Christian Stenger
7944ae0600 Mercurial: Fix history key
Change-Id: I3e0606639402808c5ef9fe6e4d6af83118b041bb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-06-03 08:53:24 +00:00
Marcus Tillmanns
57826bcab6 Core: Add IDE:Executable variable
Change-Id: Ic191562bbfea0b3f0998c0e71c11d7316644937c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-03 07:41:45 +00:00
Marcus Tillmanns
cf1aa1d1bb Lua: Ask user before allowing to fetch
Change-Id: I58318598015a24689de19ae00bce65f004091e6b
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 06:33:03 +00:00
Marcus Tillmanns
e078d05f51 Utils: Fix connection error
When add / remove buttons are disabled, the connection fails.

Change-Id: I6c9a3233f156b88e516481a6fc8e072ea5e1c13b
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-03 06:32:54 +00:00
David Schulz
d8a582d813 Lua: Add function that returns the output of a process
Change-Id: I6863926a4da90adc89d96d47da1542c886b44040
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-03 05:06:41 +00:00
Cristian Adam
2ce6255a7d CMakePM: Do not check the existence of dlls for PATH handling
In order to fix QTCREATORBUG-29662 the check of existence of an dll was
a prerequisite to add the path to the PATH environment variable.

As it turns out this is not an easy thing to do, since the ".lib" file
name can be different than the ".dll" file name.

Also for MinGW you can have ".dll.a" or ".a" as library filename
extensions. You can also have a "lib" as prefix for the library
filename.

Amends 0d8a542b4f
Amends 8713919f31
Amends ac97ab1abf

Task-number: QTCREATORBUG-29662
Fixes: QTCREATORBUG-30827
Fixes: QTCREATORBUG-30932
Change-Id: I90afad825d43fd4f801c2aac20ed98f013861152
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-31 16:31:21 +00:00
Christian Kandeler
36f2a21f2d ProjectExplorer: Support column numbers in file path linkification
... for task details.
As a result, clicking on a linkified file path inside a task in the issues
pane will now open the editor at the column specified in the compiler
output, if there is one. We used to consider only the line.

Change-Id: Idccba33b5b33029abfa8f29c7888af6c7f2e1622
Reviewed-by: hjk <hjk@qt.io>
2024-05-31 13:04:27 +00:00
hjk
45702941f8 Fix some deprecation warnings from QCryptographicHash
QT_DEPRECATED_VERSION_X_6_4("Use the QByteArrayView overload instead")
    void addData(const char *data, qsizetype length);

Change-Id: I144765e6993a9942b372943ccbf5c783fcf9da3d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-05-31 12:35:26 +00:00
hjk
58ac9aea68 LayoutBuilder: Add a few Label related functions
... and use them in the CoPilot settings

Change-Id: Id861cf34274d2afe798d4735072d02c2c8f724e3
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-05-31 12:22:32 +00:00
Marcus Tillmanns
04abc375f5 Lua: Improve memory management
Previously the PluginSpec would create a keep around a single lua vm
that was then shared with the actual plugin instance. This made it
unclear when the VM was freed.

Now we instead cleanup the lua vm used to fetch the plugin infos
immediately and instead create a fresh vm for the actual plugin
instance that can then follow the normal Plugin lifecylce.

Change-Id: I81bb9ecf57706c2ba1b0d8db83ab26b3b8e944f2
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-31 12:21:03 +00:00
David Schulz
a1727a9d6d Debugger: fix compiling dumper tests
Change-Id: Ic06483bfeee376e9cc3e7beb516b9bde9cb5b46d
Reviewed-by: hjk <hjk@qt.io>
2024-05-31 12:16:15 +00:00
Alessandro Portale
0ccfccd5c5 ExtensionManager: Some cleanups
Stuff you notice 10 Minutes after pushing the code you worked on for
days.

Change-Id: I24614b8129f80c8986ec11d5146c5631dae5d515
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-05-31 10:26:44 +00:00
Christian Kandeler
0fffe1058d CppEditor: Make more use of CppQuickFixInterface::currentFile()
As in 5cc44b8cab, this time with the non-
trivial cases.

Change-Id: I48c3f27c83903457473afa6175c8522d2ff23f96
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-31 10:17:43 +00:00
Christian Kandeler
0e301004b8 ClangCodeModel: Allow more than one in-flight "follow symbol"
The original code was written with only the interactive case in mind, but
nowadays we also start "follow symbol" operations internally as part of
e.g. quickfixes.

Change-Id: I95928297fab16f9b0469bfd66ad687447b902fd9
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-31 09:48:41 +00:00