Commit Graph

2735 Commits

Author SHA1 Message Date
Jarek Kobus
f051ed3076 QtcProcess: Add a test for various quit methods
The quitBlockingProcess() test examines different types
of process quitting and illustrates differences in
behavior.

Change-Id: I9209f00576e03eef66fbdf5665351138ed437ac9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-08 06:57:49 +00:00
Eike Ziller
4ded73583d DeviceShell: Fix compile issues
- fix warning deviceshell.cpp:222:59: warning: suggest braces around
  initialization of subobject
- add missing dependency to app_version to tests

Change-Id: I6d61f26cbc6f51b28175257ab7d0f4d2b491fecb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-07 13:36:25 +00:00
Marcus Tillmanns
0135c47849 device: Use multiplex script to allow multithread support
Previously the runInShell and outputForRunInShell methods were
exclusively processed single threaded, meaning all calls
were processed sequentially. With the multiplexed
helper script we can now run multiple processes simultaneously.
( see tst_manual_deviceshell )

Additionally the new script allows us to capture both
stdout and stderr from commands which was not possible previously.

Change-Id: I52f4fb46d872dc274edb9c11872d2f6543741b34
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-06-07 09:22:14 +00:00
hjk
abd289190e Valgrind: Inline CallGrindController into CallgrindToolRunner
No functional changes.

Change-Id: I3b73da69e20e4d0324c582544c67a84eac8dbdab
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-31 13:50:13 +00:00
Jarek Kobus
f3957d383f Utils: More forward declarations / drop unused headers [T-Z]
Round 1 - focus on headers.
For classes with initial in range [T-Z].

Replace QT_FORWARD_DECLARE_CLASS with QT_BEGIN_NAMESPACE and
QT_END_NAMESPACE and forward declare inside.

Change-Id: I4ac3a8391e6167aa2db3973a9f94a45ac3c8ebd1
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:40:47 +00:00
Jarek Kobus
2853660a59 Utils: More forward declarations / drop unused headers [D-G]
Round 1 - focus on headers.
For classes with initial in range [D-G].
Try to keep the same separators between different kind of headers.

Change-Id: Id42cd7b3743a816f75cecb6b576c0e37cb057473
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:13:52 +00:00
Jarek Kobus
9db911ae12 Get rid of Ssh lib
Move the rest to ProjectExplorer plugin.

Change-Id: Id2f022359e7e01728779228ea1f7f0b05a81c8e4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-23 18:21:28 +00:00
Jarek Kobus
87f3e7563c Ssh: Rename SshConnectionParameters into SshParameters
Move it to its own header.
Get rid of SshConnection and SshConnectionManager,
as they are not used anymore.

Change-Id: I52fe20d7816ea57e7a7158ab2ae9565d50a76e21
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-23 12:03:39 +00:00
Jarek Kobus
edd9ddcd75 Get rid of SftpTransfer
Remove also sftpdefs.h. They are not used anymore.

Change-Id: I6c45a70cec2e01afdd1a668068e090f5d4abde9b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-23 11:51:35 +00:00
David Schulz
0422233af4 LanguageClient: Move the interface out of the gui thread
Change-Id: Iec34f5a0ca3f7f8e2306d3c8a50c2155b5b96807
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-19 09:49:42 +00:00
hjk
296edb321a Debugger: Add dumper for QAnyStringView
Change-Id: Ic7cd577559ae7e73a74daa93784b6f2e1c8abccd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-19 09:15:58 +00:00
Alessandro Portale
db7ba4ad6f QmlProjectManager: Fix CMake build with absent Qt5::QuickWidgets
Change-Id: Ic6c211a629bc4e5f215abad0bd80c6edb64f5c5d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-18 12:33:29 +00:00
David Schulz
0b6bc0d187 LanguageClient: Move the BaseMessage to JsonRpcMessage conversion
... to the client interface. JsonRpcMessages are the only messages used
so far and no other types of messages are currently used by any of the
supported Language Servers. If a client is going to need special message
parsing it can still implement a specialized client interface and
overwrite parseCurrentMessage. This is the preparation to move receiving
and parsing data passed to and from the language server out of the GUI
thread.

Change-Id: Ibd4cd95daab7efff947273ca9e7d457de0286f47
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-17 04:31:06 +00:00
Christian Kandeler
db1f2c8dd9 LSP: Do not copy a message before sending it out
Change-Id: I58cc1f50b504bf21ea4ee9f99edba2ae8dc1ca1c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-13 07:19:15 +00:00
Jarek Kobus
257abc627c SftpTransfer: Get rid of FileTransferErrorHandling enum
FileTransferErrorHandling::Ignore wasn't used anywhere.

Change-Id: I5826fc9f7871b06cd8f423d7e3b1d01a5b6cbdff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-11 08:16:59 +00:00
Eike Ziller
9bf0efcbb9 Merge commit 'origin/7.0'
Change-Id: I90148816d32c81b9fef982b5010c785161d83097
2022-05-10 11:45:37 +02:00
Christian Stenger
81f33072b9 Tests: Fix compile of test app on macOS
Change-Id: I1a96bc57bae2aa3f1f7a1c0d6d4306cf5c36a78b
Reviewed-by: hjk <hjk@qt.io>
2022-05-10 06:19:33 +00:00
The Qt Project
0114f3acd6 Merge "Merge remote-tracking branch 'origin/7.0'" 2022-05-09 07:49:34 +00:00
Eike Ziller
70b9f13792 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/libs/utils/qtcprocess.cpp
	src/plugins/cppeditor/cppcodemodelsettingspage.cpp

Change-Id: I602f4ff13f9370ec20704efaea34b42445a75fd4
2022-05-09 09:48:28 +02:00
Jarek Kobus
6455d7fcf3 QtcProcess: Make the class final
Currently, as a result of many refactorings, the QtcProcess
is designed so that if you want to customize the behavior
you should implement custom ProcessInterface subclass.
Adding virtual methods directly to QtcProcess caused tons of
unpredicted side effects and nasty bugs, which were hard to
track and hard to fix, as provided fixes were usually fixing
particular case while introducing regressions in not related
code paths.

Consider also aggregating QtcProcess object instead of
deriving from it when some additional methods are required.

This patch removes the last virtual methods from QtcProcess API
and makes the class final in order to prevent from adding
any new virtual methods to this class in the future.

This commit message should make it clear that having subclasses
of QtcProcess is not a desired design. It's a post-mortem
conclusion. So: don't derive from QtcProcess - we mean it!

Change-Id: I1e43ed45be326b366422fd7db6e05ba48ea5fb98
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:29 +00:00
Jarek Kobus
2856091c75 Get rid of SshRemoteProcess
It's being replaced by QtcProcess with path on device.

Change-Id: I29eb038d1b17151683f86855eb547e47f7f7dea5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:13 +00:00
Jarek Kobus
afe32bca30 Get rid of SshRemoteProcessRunner
It's being replaced by QtcProcess with path on device.

Change-Id: I89abacd686e00e3f42f6ab90e9439f015d73ce80
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 06:53:46 +00:00
Fawzi Mohamed
556ec7c20e qmljsreformatter: support nullish coalescing
qmljsscanner did interpret ?? and ?. as a single ? and thus as the
start of a ternary operator, breaking reformatting.

Fixes: QTCREATORBUG-27344
Change-Id: I0429d20aed0196743f1c20e6ceac11351d5a7a3b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-06 13:23:34 +00:00
Christian Stenger
1346ffc159 Dumper: Fix offsets for QFile members
Change-Id: I890b3f387505cf5acc8783e3dc7088515d6934cc
Reviewed-by: hjk <hjk@qt.io>
2022-05-05 07:42:09 +00:00
Jarek Kobus
8e931838ef Get rid of SshConnectionInfo
It's not used anymore.

Change-Id: Ie77c9d9bc8eb82c1f74cfdac2304bc6c2f92ee93
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-03 14:38:23 +00:00
Artem Sokolovskii
efd25fb43f Utils: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Ic72d173d95376276df8d1f08abdaec8370aff2ba
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-02 08:54:36 +00:00
Cristian Adam
88781a003f CMake: Qt Creator Static build support
This adds the build system feature that allows Qt Creator's libraries
and plugins to be compiled statically.

Fixes some symbol clashes when all plugins are linked into the same
executable.

Support for actually loading static plugins will be added in a separate
commit.

The feature is controlled by QTC_STATIC_BUILD which by default is OFF.

Change-Id: I1fab7953c43e42dc75619e35660029ee067106df
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-29 07:16:53 +00:00
Eike Ziller
93401c9c81 UpdateInfo: Retrieve output of maintenancetool calls separately
ShellCommand doesn't support retrieval of individual sub-jobs.
Simply use chained QtcProcesses and add a progress item directly.

This gets rid of fragile hacks that were needed to combine the output of
the two calls into a valid XML document.

Change-Id: I426c74f5fd2c522850daf9c077bfd09ce3f88bb1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-28 06:12:42 +00:00
David Schulz
11ce6e365f Utils: fix QProcess backend on Windows
Do not return false from QtcProces::waitForStarted if the process is
already running. This causes mayor issues on windows since QProcess
directly emits started and therefore switches to the running state after
calling QProcess::start.

Change-Id: I4604b08a59918d3df11c8a174b57e1e483e78a0d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-25 10:04:48 +00:00
Eike Ziller
e2d5b6616a Merge remote-tracking branch 'origin/7.0'
Change-Id: I01ce83a2da66bb65af37c0ecc92372789cb85c01
2022-04-22 10:04:39 +02:00
Christian Stenger
9656eb9e7a QmlJS: Fix more invalid M325 cases
Fixes: QTCREATORBUG-27380
Change-Id: I76d1ef3d2f2a4cc9d930a006ecb3b564efea3fbc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2022-04-22 05:24:21 +00:00
Eike Ziller
d1686e1867 UpdateInfo: Fix parsing of update info
It was no longer showing any updates. At some point MaintenanceTool
added <?xml...> headers to its responses, which broke our combine-and-
parse hack, since such a header in the middle of XML is invalid.

Add a hack that removes these headers first. This should be refactored
without the use of ShellCommand in master, because that doesn't allow us
to access the output of the two jobs separately.

Change-Id: I7248b070a8edb1a45248b3531ed50bb0d94eef73
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-21 06:56:56 +00:00
Eike Ziller
98dda165e4 UpdateInfo: Add some auto test
Change-Id: If97121bda98e1b09f093d0bcc8f60efb1aa18235
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-21 06:56:47 +00:00
Jarek Kobus
a4a651aa32 QtcProcess: Fix StartFailed result
Amends 4ca336762e

Change-Id: I3781bec37b17ea3f86eedc51657db0931a456c39
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-14 07:55:22 +00:00
hjk
76d5e7770d QmlDesigner: Avoid compilerwarning in test
[1262/1277] Building CXX object tests/aut...s/tst_qml_testcore.dir/tst_testcore.cpp.o
tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp: In member function ‘void tst_TestCore::writeAnnotations()’:
tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp:8707:21: warning: loop variable ‘child’ creates a copy from type ‘const QmlDesigner::ModelNode’ [-Wrange-loop-construct]
 8707 |     for (const auto child : rootModelNode.allSubModelNodes()) {
      |                     ^~~~~
tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp:8707:21: note: use reference type to prevent copying
 8707 |     for (const auto child : rootModelNode.allSubModelNodes()) {
      |                     ^~~~~
      |                     &

Change-Id: I496baf5424a7e07976aecdf3ad2402832bbc52d9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-12 16:06:56 +00:00
Jarek Kobus
00acccfd3d QtcProcess: Fix terminate() for process launcher
ProcessLauncherImpl::terminate() was behaving the same as
ProcessLauncherImpl::kill() in case of process launcher
implementation - in both cases the launcher
immediately returned confirmation about receiving the
close request and was putting the corresponding
process into its reaper. However, the issue with this approach
is that we can't receive anymore any potential ready
read signal from the process being terminated after
a call to terminate().

The fix is to diverge the behavior of terminate()
and kill() of ProcessLauncherImpl. The behavior of kill()
remains the same, while terminate() just instructs the
process launcher to start termination without putting
the process into the reaper, yet.

Add a test that checks for any possible zombies.

We run the RecursiveBlockingProcess recursively. The most
nested process blocks. After a short wait we terminate
the outermost process. With this test we are trying to see
if terminating the middle process terminates also its
children and doesn't leave zombies.

Before we execute the test (and also by the end of this test)
we call Singleton::deleteAll() in order to ensure that reaping
of previously running processes has finished. We ensure the
number of running processtestapps is zero. Later, we ensure that
the leaf process was already started and the number of running
processtestapps equals the depth of recursion.

Fix apparent bug in getLocalProcessesUsingProc().

Change-Id: I7e2bc46ad5ca22f26620da86fbaf0fa00a7db3c3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-12 13:59:41 +00:00
Christian Stenger
0bd4d38002 Tests: Remove ignored message
This soft assert is no more triggered a second time and
results in a fail now.

Change-Id: Ica850a19993797d412e0b5ff954b5e9760e21f53
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-12 08:05:17 +00:00
Jarek Kobus
2794b5e543 tst_QtcProcess: Get rid of lineCallbackIntern() test
This test introduced some additional private API to QtcProcess.
This makes refactorings of QtcProcess harder, as we need to
handle this artificial code working.

We have a real lineCallback() test instead which doesn't
employ this private API.

Change-Id: Idbc314210cecc2044e1ccc298e5d3e0a9747e811
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-11 15:26:10 +00:00
Jarek Kobus
a6fc7727a1 Get rid of SftpSession
Should be substituted by FilePath actions using remote paths.

Change-Id: Ib1e3913cc94d417045cbe6b922284a2f8ab6d71f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-04-08 15:12:22 +00:00
Jarek Kobus
97132cf7f0 tst_QtcProcess: Add a test that invokes a process recursively
After the required depth of recursion is met, the most
nested process waits for one seconds and crashes.

Change-Id: I8d9b359459fc7aa1983734685e5c5f19eb49ee94
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-05 11:40:20 +00:00
Jarek Kobus
8f427c1c95 tst_QtcProcess: Move subprocesses into a separate executable
Don't invoke subcreator test in order to run a custom process.
Run a separate executable instead. The advantages are:
1. Faster test running (no need for QTest specific code path
   when running subprocess).
2. Don't use std::exit() from subprocesses as it doesn't
   clean up properly. Use qApp->exit() instead.
3. This should support returning NormalExit and proper
   exit code of subprocess in case the code wasn't 0.

Change-Id: I1395bd8a7873c95a594c3e054087f00c55a15376
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-05 11:40:00 +00:00
Marcus Tillmanns
c246caf7a9 sdktool: Change tests to use QTest
* Moved all sdktool code into a static library, allowing us to link against the actual functionality in unittests
* Convert all tests to proper unittests

Change-Id: I5c93be0faecbd8b68e0923655483c870a2f408b5
Reviewed-by: hjk <hjk@qt.io>
2022-04-04 14:27:46 +00:00
Jarek Kobus
ab11c4373b QtcProcess: Introduce done() signal
Introduce QtcProcess::done() signal. It's similar to
QtcProcess::finished() signal, but also emitted when
process failed to start (so after QProcess::FailedToStart
error occurred).

SshRemoteProcess::finished() signal was already behaving
like this. So, we remove special handling of
FailedToStart error in this class and connect all clients
of SshRemoteProcess to done() signal, instead of finished().

Task-number: QTCREATORBUG-27232
Change-Id: If4240e2172f3f706e812bca669a1d5b24bdc3285
Reviewed-by: hjk <hjk@qt.io>
2022-04-04 13:28:12 +00:00
Christian Strømme
e45766cdc8 Make the ExternalTools classes accessible outside core
Change-Id: I225c22bc48b123fec4420761879382ea0a424029
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-04-04 08:02:11 +00:00
Jarek Kobus
679a7ba7ef tst_QtcProcess: Rename ProcessChannelForwarding into ChannelForwarding
Amends 91c11c769f

Change-Id: Ib38edca1f720a313c42ee6224cbd9109fb50fa84
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-04 07:20:02 +00:00
Alessandro Portale
91c11c769f Utils: Add mergedChannels test to tst_QtcProcess
Change-Id: Ia6c25004ca37c97c0cfa61bc2eb944493f796217
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-31 22:32:11 +00:00
Eike Ziller
c84380cdc8 Merge remote-tracking branch 'origin/7.0'
Change-Id: Ib2267ddbb702564a6e1c8f6b1db802bc9c45759d
2022-03-31 15:32:42 +02:00
GPery
f99094a0b8 CppEditor: Fix indentation for structured binding
Structured bindings were parsed as lambdas instead

Fixes: QTCREATORBUG-27183
Change-Id: I3c88dc1012e55edfe417504c17f6138e3356651c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-03-29 14:21:11 +00:00
Eike Ziller
780f5da7c4 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/studiowelcome/recentpresets.h
	src/plugins/studiowelcome/userpresets.h

Change-Id: Ie573b945eb28347a36ee1b3582fbd6ab0c0f866c
2022-03-28 15:10:11 +02:00
Samuel Ghinet
3935c671dd QDS New Project Dialog fix: recents should include all project properties
Previously, only the wizard category, name, and size were saved for
recent presets. Solved the problem by using the same kind of store (and
struct type) for Recent presets as for User/Custom presets - this way
we can save all properties.

Other changes introduced:
* After user creates custom preset C, then creates a project from it
(resulting in the creation of a Recent preset R), if the user then
deletes custom preset C, then the recent preset R will remain -
previously, all recents of the custom preset were deleted
* Now we can have multiple recent presets with the same name and size -
so, no distinguishing feature inside the Presets view. User will have
to look at Details and Styles panes to view differences.
* Replaced .ini format with *.json file format.

Change-Id: I500e9ac9378d4b9a393c3b0833ef6a34f785585c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2022-03-24 10:31:16 +00:00