Commit Graph

76686 Commits

Author SHA1 Message Date
Christian Kandeler
a6d1f7594c ClangCodeModel: Fix documents getting opened in wrong clangd
This amends 96be267a6e, which contained a
wrong assumption: Just because a ClangdClient has an associated project
does not mean that all documents currently open in this client belong to
its project. The opposite often happens at session loading. For example:
    - We load a session with two projects.
    - Qt Creator restores the documents and starts loading the projects.
    - The latter happens asynchronously and takes longer, so initially
      the fallback client claims the documents.
    - The smaller project finishes first and now grabs all the open
      documents whose files belong to it, as well as those that don't
      correspond to any project (as per
8ad7ab2d2a).
      This includes all documents belonging to the second project,
      because that one has not finished loading yet, so its files are
      not associated with a project at the moment.
    - Finally the second project finishes loading. Now we must
      "steal back" all its documents that are currently open in the
      first ClangdClient. This is what this patch does.
We also now explicitly close the document in the previous client as part
of the hand-over, which is conceptually the right thing to do and should
eliminate any potential "ghost diagnostics".

Change-Id: I3d9f5ce503cc7ee47ece757d81851b85a16b639d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-02 09:10:37 +00:00
Jarek Kobus
0a7f76ca8d VcsCommand: Get rid of setCookie()
Remove cookie arg from finished() signal, as it's not used
currently. Thus, remove setCookie() method.

Change-Id: Iedd328aece776eebd2d161a36ec28370b8bc4bfc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 09:00:01 +00:00
Jarek Kobus
2c51907b4b VcsCommand: Limit the usage of setCookie()
It looks like the cookie set inside GitClient::vcsExecAbortable()
is never read back again. The only place where we connect to
finished() signal of the command returned by vcsExecAbortable()
is GitClient::pull(), however, we ignore the cookie there.

Change-Id: Iaec08b255309ea406e45695231fe9849d5dc7285
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 08:59:56 +00:00
Jarek Kobus
6e160b2088 VcsCommand: Limit the usage of setCookie()
Use lambda capture instead.

Change-Id: I43ff080c4909ecf12fd330c8db9a1f0bfb497011
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 08:59:52 +00:00
Jarek Kobus
09fb9f3973 VcsCommand: Limit the usage of setCookie()
Don't use setCookie() for setting the push failure status.
Introduce a PushHandler helper that keeps the data collected
when stdErrText() signal is emitted and reuse it when
finished() is being called. Move m_pushFallbackCommand
field into the helper, as its value is meaningful only
in context of the invoked command.

Hide PushFailure enum inside PushHandler.

Change-Id: Id21457734f32e06bb130c3c07c24cb2b7af6e466
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 08:59:46 +00:00
hjk
7b8c053c25 Docker: Set logging level to QtWarningMsg
Consistent with the rest.

Change-Id: Ia6ac7476e8b22ca1bf65005dcb4c5a7a2bcc50ac
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-08-02 08:28:50 +00:00
Jarek Kobus
c55fcac6c5 CdbEngine: Remove unused field
This field in only set, but never read.

Change-Id: Ie42ccad32ca90e1b4a0dd9f4c2e213ea4c3ca180
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-02 08:05:27 +00:00
hjk
87e156fc41 Utils: FilePath::setFromString microoptimizations
Mostly relevant for debug builds.

Change-Id: I3d3789d5ef535afbb87339a75bed076cd548dda3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-08-02 06:20:30 +00:00
Jarek Kobus
1d0f553ac5 VcsCommand: Limit the usage of setCookie()
Don't use setCookie() for setting the line number
to be shown on annotation. Add setDefaultLineNumber()
setter to VcsBaseEditorWidget instead.

Change-Id: I6c52874d48532132a27b2a7a9d161705170f7ade
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 06:11:25 +00:00
David Schulz
9664010b44 Autotest: move global static into function
Change-Id: I31dcbbba430ce7856e3dd8d7b907d01cd09112e8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-02 06:08:35 +00:00
Christian Stenger
3c41f7fe3c AutoTest: Do not use reference for file content
Change-Id: Iadad6c84e148604fa04d491f59be2d3a0987517b
Reviewed-by: hjk <hjk@qt.io>
2022-08-02 06:05:42 +00:00
Christian Stenger
28a99221ee AutoTest: Prevent possible crash
Change-Id: Ic27a9623ea910b21ccb99c7cd603cfa3d1369d12
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-02 06:04:57 +00:00
Christian Stenger
1838f63958 VcsBase: Fix compile
Change-Id: I2fc2e1e97f6ec929a65eaa0ef407126ece850003
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-02 05:45:57 +00:00
Jarek Kobus
3fcde6c5eb VcsCommandPage: Get rid of unneeded arg in finished() handler
Change-Id: I7087b8568f674a135ded11d923b3a36c7a16d987
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 17:26:32 +00:00
Jarek Kobus
0de4e9092f VcsCommand: Remove cookie() method
Change-Id: I2f83e141b05100c84c140d15a131e06ee62c6f68
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 17:25:59 +00:00
Jarek Kobus
83739bde38 VcsCommand: Merge with VcsCommandDecorator
Change-Id: I84df1779377648624984c9e57806f1307ae62b5b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 17:24:53 +00:00
Jarek Kobus
7c2ab8cf8f ShellCommandPage: Merge with VcsCommandPage
Change-Id: Ib8975ddaf9790d80b9784d63ddcfc32ab3c7c9c8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 15:20:10 +00:00
Jarek Kobus
d1284e9101 Move createInitialCheckoutCommand() out from core plugin
Change-Id: I99f4795822838ac084d0d6823db96e5864e0dcdf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 15:19:58 +00:00
Jarek Kobus
bc8ebd3bc7 CodeAssistant: Avoid using sender()
Change-Id: I8483b368ebf5dca684d817390e1138362bf11d6f
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-01 14:47:42 +00:00
Jarek Kobus
1697f604ed Drop Qt5: TextEditor: Remove code below Qt 6.0.0
Change-Id: I483445a862699c89784ee8612fd2eaa14e65e21f
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-01 14:47:02 +00:00
Jarek Kobus
60302debd7 Move ShellCommand into VcsBase plugin
Rename it to VcsCommand. Move also ShellCommandPage into
VcsBase plugin.

Change-Id: I335ac47e3090f2be497643ebcda0eaad2987ac81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-01 14:33:06 +00:00
Christian Kandeler
61adea0cfd CppEditor: Re-word misleading help text about clangd config files
Task-number: QTCREATORBUG-27965
Change-Id: Ic41cea9b7383ab4b7c8fa76a6d67f6221cd49fdd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-01 14:20:08 +00:00
Piotr Mućko
2e70915ab0 McuSupport: Use FilePath::fromUserInput instead of fromString
to normalize path separators for all OS-es

Change-Id: Iad6ea4abf21ba57705e07007bb238ebd7748ecfe
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
2022-08-01 14:01:47 +00:00
hjk
2361353289 CPlusPlus: Remove Rreprocessor::run overload for QStrings
The preprocessor operates on QByteArray, making it less
convenient to use strings helps preventing accidental
conversion roundtrips.

Change-Id: Ifb2068a8fed137c52b05f2979b99cbce3462151e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-01 12:18:06 +00:00
hjk
960e99ecb1 Autotest: Convert to Tr::tr
Change-Id: Ifd4b6ace78d02804ec3b3c1d60c5418081cad6c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-01 12:16:41 +00:00
Miikka Heikkinen
bd6735621c QmlDesigner: Clear material browser model on model detach
If browser model is not cleared, subsequent project open may crash.

Fixes: QDS-7194
Change-Id: Ic897086c8da1f774ff035af9e2bcaa378bff3af5
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-08-01 11:41:18 +00:00
David Schulz
80aa0fe1fd LanguageClient: prevent updating closed document
Remove the closed document from the container that tracks document
modifications to prevent accessing a deleted document.

Change-Id: Iafba8ad3ce054761017a8feca28fdc4c8b379ef6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-01 11:35:20 +00:00
Alessandro Portale
ce7a761075 Utils: Improve FileUtils::commonPath
Make it a worthy FilePath-based counterpart of Utils::commonPath.
With tests.

Change-Id: I68bae129c5d9d9dd3e46dfa6093e229f8ca0aee1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2022-07-29 20:20:22 +00:00
Jarek Kobus
04669dfadf VcsBase: Remove unneeded declarations
Make some cleanup.

Change-Id: Ib553fe5ea27fbcf710a29cfff6e02e755f0d40e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-29 15:28:49 +00:00
Jarek Kobus
93e0cab2df ShellCommand: Call c'tor of CommandResult explicitly
Change-Id: I3b9d0cda10a480577b7175e8bd6039299e4b3ff0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-29 15:28:23 +00:00
Jarek Kobus
0a1ac481ed ShellCommand: Introduce CommandResult structure
Don't require QtcProcess instance when calling
ShellCommand::runCommand().

Change-Id: Ie0287d91c1807465eab12be7eaa2eac561179af7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-29 14:52:02 +00:00
Eike Ziller
278f33d521 Merge remote-tracking branch 'origin/8.0'
Change-Id: I71c50e425202d4cec945a8464605630b5af9a0df
2022-07-29 15:07:18 +02:00
Ulf Hermann
529542bd54 PerfProfiler: Fail more gracefully on unrecognized features
The perf events are external data. We should not (soft) assert on them.

Change-Id: Id2a72c4f95988095c7f52e8db49cc3398712e94a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-07-29 13:01:17 +00:00
Jarek Kobus
e6e4bc8dad ShellCommand: Remove success() signal
Use finished() signal instead.

Change-Id: I4e28a2c6d90f40790cb9d19411186bd98402f4bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-29 11:39:10 +00:00
Artem Sokolovskii
79aaf155b7 ClangFormat: Update generateClangFormatChecksUI script
Now relay on clang/Format.h file not on ClangFormatStyleOptions.rst.
The information from Format.h is more complete, reliable and easy
parsable.

Change-Id: I96899257f5fd075bfd6e51c5a4fa70a614c32398
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-07-29 11:14:22 +00:00
Jarek Kobus
82553f16a1 ShellCommand: Remove exitCode arg from finished() signal
The only 2 handlers were taking it into account and
they interpreted the non-zero exit code as a failure,
so basically they repeated the work of default
exitCodeInterpreter.

Change-Id: I9848ef0cf5ca9017f02a02ae59dc09ec426f7626
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-29 10:49:25 +00:00
Marcus Tillmanns
c27c36a64b examples: Dont try to load pixmaps from URLs
Change-Id: Idd4e01509077c27d2bd1569566788710e99d9539
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-29 09:33:43 +00:00
Vikas Pachdha
2356e9314c Docs: Update Qt-Bridge Sketch docs for version 3.6
Fixes: QDS-7342
Change-Id: I8bae5b367e0d1b7c26e369f2169469f564eea3c2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-07-29 09:25:58 +00:00
hjk
a02d3c7b52 Utils: Speed up FSEngineHandler::create() a bit
This function showed up with >8% in a debug build when playing around.
Save a few cycles on repetive creation and destruction.

Change-Id: I56ecb7719d60cfe92ef3279a871051009c666b56
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-07-29 06:44:48 +00:00
hjk
41cadaadad QMake: inline librarydetailswidget.ui
Change-Id: I9c2ff650c297eb6c707304efc6a650f287b734e7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-29 06:01:16 +00:00
Alessandro Portale
6f42aa5216 Core: Include more utils/filepaths.h instead of utils/fileutils.h
Change-Id: If9d229abf2266a6550ff63534d8cde47e2d68d5c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-28 16:33:10 +00:00
Marco Bubke
00ef718664 QmlDesigner: Simplify InternalNode
Before we add new members the simple getter and setter without value are
removed because the model provides capsulation.

To  remove the weak pointer workaround std::enable_shared_from_this is
used which makes the class aware of its shared pointer. For that we
change to std::shared_ptr

Task-number: QDS-7343
Change-Id: Ic5f14ba8c1fd7af7633b8decb413538ee01c90d6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-28 14:16:00 +00:00
Marco Bubke
eb8192ce98 Sqlite: Update to 3.39.2
Change-Id: I0abe49af5b8161a834b191f34906e416e44720b1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-28 14:15:47 +00:00
Eike Ziller
0dd8dc5cb7 Merge remote-tracking branch 'origin/8.0'
Change-Id: I94f2ec5961a89febd30e45b5e71f3dc92e000592
2022-07-28 15:28:49 +02:00
Eike Ziller
50e6a96696 DocumentModel: Improve performance of (document|entry)ForFilePath
Don't iterate the list, but look up in the hash.
Implicitly improves performance of text mark creation.

Change-Id: Ic1f7e118b96f81bb5922a94039d3d85027a118a5
Reviewed-by: hjk <hjk@qt.io>
2022-07-28 13:24:53 +00:00
Artem Sokolovskii
80b4e6a910 ClangFormat: Update clangformatchecks.ui file
File updated by scripts/generateClangFormatChecksUI.py

Fixes: QTCREATORBUG-27952
Change-Id: Ib7ffbf1f416a4edffc130a00ae8348d2ac9ed010
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-07-28 13:09:38 +00:00
Eike Ziller
7d3560a209 Add change log for 8.0.1
Change-Id: Ifb06ba677bae3eae181c2b9f566e9c42b6290802
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-07-28 12:58:33 +00:00
Marcus Tillmanns
8d9fa06577 WelcomePage: Only retrieve recent projects once
The recentProject list was retrieved for every ::data and ::rowCount
call. This triggered QFileInfo.exists call for each project
which was expensive. This fixes that so that the recent projects
are only filtered once for each model reset.

Change-Id: I6ce33a13c2446bece5b7dac1563ffa7bdc85bbaa
(cherry picked from commit 859f146760)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-28 12:26:42 +00:00
hjk
ab74dfba98 BareMetal: Fix startup
Task-number: QTCREATORBUG-27972
Change-Id: I16c6b07c33736f087ea805994fe51a9c109c5d95
(cherry picked from commit 59fde5be05)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-28 12:07:26 +00:00
The Qt Project
5509f7f1d3 Merge "Merge remote-tracking branch 'origin/8.0'" 2022-07-28 11:28:16 +00:00