Commit Graph

62421 Commits

Author SHA1 Message Date
Jarek Kobus
191fc196d5 VcsCommand: Remove one addJob overload
Remove defaultTimeoutS field, as it wasn't broadly used.

Change-Id: I0056788b066eb6d682d5ba7acdb01d5dd3568967
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 06:09:44 +00:00
Jarek Kobus
d2a1198a7b ClearCase: Remove unused includes
Add some forward declarations.

Change-Id: If7b55d57484f9ab7b03e3919a7ba52f243fc5de0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-03 06:09:39 +00:00
Jarek Kobus
6129157f57 ClearCase: Simplify isConfigured()
Make executable check inside ClearCaseSync::run()
consistent with isConfigured().

Change-Id: Idc08dcdf87005937b1299a0d033c4cf2503f63a4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 05:20:11 +00:00
David Schulz
a35d56ca2e Core: remove suspended entry from file path cache
... when cleaning up suspended documents on session switch.

Fixes: QTCREATORBUG-28021
Change-Id: I6ef9fda96162d56758f176381b1eabe47eb8770f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-03 04:51:26 +00:00
Jarek Kobus
b84c22b2fd ClearCaseSettings: Use FilePath for ccBinaryPath
Change-Id: I0de348d0b99a1f81d75418a7927c989283c4137a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 17:34:40 +00:00
Jarek Kobus
278d297397 VcsCommand: Simplify public runCommand()
Get rid of unused workingDirectory (default working
directory will be used) and exitCodeInterpreter.
Simplify internals a bit.

Change-Id: I2a7547e5a594dd7a21f390daeb06778656e9e971
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 17:34:31 +00:00
Marcus Tillmanns
b2f0f78bdc filepath: Fix windows driver letter handling in fromString()
Change-Id: Ic66e468ed2161bc10136ab31dc29a7358e6d7397
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-08-02 13:59:29 +00:00
Christian Kandeler
98a39401db CompilationDatabaseProjectManager: Be more careful with filtering
Do not blindly remove all flags that contain the file's base name.

Fixes: QTCREATORBUG-27990
Change-Id: Ib51b65a8694e82ec22af859176b0db0e5d86b5f0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-02 13:50:14 +00:00
Christian Stenger
1c34105dfc Squish: Register result item type
Needed to be used in queued connections.

Change-Id: I2911a5ff73d2be0b406fcfa9f073764b3edfbe9d
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-02 12:40:28 +00:00
Christian Kandeler
2b8ac45071 ClangCodeModel: Move "find references" into its own class
Change-Id: If4dc9f7cb56b7f2e03e3d4622e616fb8486ddc92
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-02 11:48:22 +00:00
Knud Dollereder
b52177119f Fix wrong optimization in the timeline settings dialog
The timeline settings dialog used a static QString to cache the
last inserted expression binding value.
This caching fails when the user modifies the expression in the
text editor since the cached string is not updated in that case.
This patch removes the caching since this optimization is negligible.

Fixes: QDS-7162
Change-Id: I0122b29180afbfe5b867063139c924efa6e17ea3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-08-02 11:32:34 +00:00
Christian Kandeler
2f169bdfcb ClangCodeModel: Make some ClangModelManagerSupport methods static
Change-Id: Ie34a89ae01783631c6482cff8d4866595e757be5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-02 11:21:16 +00:00
hjk
df4155f617 App: Use more local methods to trigger memory trim timer
The global event filter function is executed often, for events
originating deep in the widget hierarchy even multiple times.

Triggering the timer only by mouse and key presses on the main
application and on texteditor is less intrusive and still happens
often enough (TM).

Change-Id: I848d55a347bd62d12e8523965d1750c59da33116
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-02 11:18:12 +00:00
Jarek Kobus
9177649cab QMakeStep: Use Utils::Guard
Change-Id: I1fbc830620cb2db42ac71e3c02e1d3993197a727
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-02 10:10:55 +00:00
Jarek Kobus
5434ea417f ProjectConfigurationModel: Avoid using sender()
Change-Id: I65a2da1f2e8a5d3bb98bda752942d83e4074df9d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-02 10:10:41 +00:00
Christian Kandeler
240105f55f CppEditor: Clean up ModelManagerSupport creation
No need for "providers" etc.

Change-Id: I4ae9e8ecd6b3554711e002f233c13fd7758f01e4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-02 09:15:55 +00:00
Christian Kandeler
dd37abed6b CppEditor: Remove unused code
Change-Id: Ife0f6609a55de903f5f90af0dc6b72209e02f5af
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-02 09:15:32 +00:00
Christian Kandeler
a82406eb27 Utils: Add shortcut for buttons in environment dialog
Task-number: QTCREATORBUG-27887
Change-Id: Ifb52d24354b1042cdb1ccb4ca898a251cbac1039
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-02 09:13:46 +00:00
Christian Kandeler
5f9c30cacf ClangCodeModel: Do not make clangd open all ui headers
This amends 01ceb3a3cb, where we failed to
consider the case of projects with lots of UI headers, which cause
excessive memory use by clangd with our current simplistic approach.
Instead, we now only open ui headers that are used by currently open
documents.
Note that this approach will fail for indirect includes via header files,
but people who do that do not deserve happiness.

Change-Id: I1ef2add701e0f13dc0da79267d3c1367c1b496cc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-02 09:13:25 +00:00
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