Commit Graph

44 Commits

Author SHA1 Message Date
Jarek Kobus
adac83367c LinuxDevice: Fix stopping remote app when run in terminal
Before, the SshProcessInterface was trying to run kill
command (on remote host) for the running processId. However,
in case of terminal process the returned processId is an id
of ssh running through creator process stub, not the id of
remote process. The fix is to redirect a call to sendControlSignal
into the internal terminal process.

Change-Id: I57509fd61a54c335ab0a34f8ca0dffb3d75da696
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-11-15 11:11:39 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
e8ac0ec79b Qnx: Modernize a bit
Drop unused Q_DECLARE_TR_FUNCTIONS and QObject, C++17 namespaces, ...

Change-Id: Iea5351cbd7e3d434f3ff7123fc385aeb16c1adf9
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-22 06:54:05 +00:00
hjk
b1f9cdac35 Qnx: Move to Tr::tr
Change-Id: I43b49d325a129c180869140c4ae1774f7f89d2fd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-13 10:52:18 +00:00
hjk
6ea8a76e44 Utils: Consolidate port parsing methods
Change-Id: I137e9faa2c5f18e9ade0e2c59d73811d682abf13
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-16 08:43:16 +00:00
hjk
7f2288d9cc ProjectExplorer: Avoid need to fix up portsgatherer command lines
... by creating them with the right device to start with.

Change-Id: Ib2f0f10b67322fe66a609287a629d3d720d83c93
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-12 06:23:45 +00:00
hjk
1ffaf0139a ProjectExplorer: Introduce a IDevice::filePath
Same function as mapToGlobalPath, but operating on a QString specifying
the local path part. It's the majority use case and arguably the 'right
thing' to use instead of a full FilePath that can refer to arbitrary
devices.

Change-Id: Ifc8bd340e2e8859fe549f5724eb94269f587c418
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-10 15:20:06 +00:00
hjk
e657bc8781 Utils: Introduce QtcProcess::controlEnvironment()
... and drop QtcProcess::removeEnvironment()

This shifts the meaning of the unqualified QtcProcess::environment()
to always refer to (possibly remote) "main" process this QtcProcess
wraps. The controlEnvironment is now referring to secondary helper
processes (if any...) typically(?) running on the host system.

This helps to avoid local/remote distinctions in some places.

Change-Id: Ib7cd15dd226617484b5358acd7deaed29e751883
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-10 09:53:53 +00:00
Jarek Kobus
da0f950821 RemoteLinuxSignalOperation: Don't use SshRemoteProcessRunner
Use QtcProcess with a path on device instead.

Change-Id: I14a557f61414a12dabc19e3b2f8c9c277ecfb52d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 10:05:00 +00:00
Jarek Kobus
85cb7d2b71 Get rid of IDevice::createProcess()
And most of QtcProcess subclasses.

Change-Id: Ic891defbf49736442243f9ee0f9d28d140e0ba9d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 08:28:15 +00:00
Jarek Kobus
340b61889d SshProcessInterface: Remove pidArgumentForKill()
This interface method wasn't really sensible.

Change-Id: Ia47c893886ec06a2263b96d161578d46d2df5ffa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 08:27:26 +00:00
Jarek Kobus
b0afd728d1 QnxDevice: Don't use SshDeviceProcess
Use QtcProcess with a path on qnx device instead.
Fix QtcProcess::runBlocking() for remotes.

Change-Id: Ic9364037835b247479f4b4329e40a314e09d5492
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
2022-05-03 08:45:48 +00:00
Jarek Kobus
8d2c9aa8d4 LinuxDevice: Implement shared ssh connection
Change-Id: I1897f0a468e477e0be61767d4bad0086d59fb075
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-26 17:36:01 +00:00
Jarek Kobus
db5ae9d236 QnxDevice: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.

Change-Id: Ic01a00c9afb05a7ceff8aa8c6608c0992c82071d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
2022-04-19 06:15:44 +00:00
Jarek Kobus
8af62eb256 DeviceProcess: Minimize the usage of DeviceProcess
DeviceProcess doesn't provide any public API, so
replace all usages of it with QtcProcess.
Keep using DeviceProcess only for reimplementations.

Change-Id: I35a14251a81dd0dde426f56ca2e809b527cc863c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-28 13:10:42 +00:00
hjk
95c9579c58 ProjectExplorer: Normalize DeviceProcess::start() signature
Change-Id: I2915be34d4a1eed64567874dcf0263b7583cc142
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-14 15:10:12 +00:00
hjk
75ef67615d ProjectExplorer: Remove IDeviceFactory::setCanCreate
That's implicit now by using setCreator()

The Android case looks odd as this is (and was) effectively static
information at startup. This will be addressed in a follow-up patch,
for now keep it functionally equivalent.

Change-Id: I4e6082f88dcd21379186340189acb581caef172a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-02-04 12:10:07 +00:00
hjk
2be0fc2537 ProjectExplorer: Use CommandLine instead of Runnable
Lighter and sufficient for all use cases.

Change-Id: Ic6749a1a9e3e6906ce71b87b237cc94a6d8a4cbf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-03 10:15:44 +00:00
hjk
4e34921451 ProjectExplorer: Rename DeviceProcess::error to errorOccured
That's what QProcess favors nowadays and QtcProcess uses.

Change-Id: Ie9492ae62f23e35a8a70f72196c3d1b6bc50cbdc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-27 10:12:38 +00:00
hjk
2b6f26dee2 ProjectExplorer: Use a lambda for DeviceFactory::create()
Somewhat slimmer interface on the user code side and follows
existing practice.

Change-Id: I20ed8f5a00591265d32ea9ce93e1f1bbc76d2437
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-26 14:51:09 +00:00
hjk
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +00:00
Christian Stenger
f82b96107f Qnx: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: Ic32313d8879b6497209196b0e3e4846c00c9846a
Reviewed-by: hjk <hjk@qt.io>
2020-06-19 12:29:06 +00:00
hjk
d08c0f31c4 De-Q_OBJECT-ify most DeviceFactories
WinRt is the odd one out.

Some were using setObjectName, but only used for debug reasons,
not really needed.

Change-Id: I4a370e4694443bc1c455fda4337ef3acfb9259b8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-23 13:32:12 +00:00
hjk
36d98d4af7 ProjectExplorer: Base IDevice::osType on a data member
Change-Id: I969563e6e62895a51fb4692c8eb0bab278f0ecae
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 07:44:45 +00:00
Christian Kandeler
45f9c178e1 ProjectExplorer::IDevice: Add a default display name
Task-number: QTCREATORBUG-16281
Change-Id: Ieff929343b5dc3a84d9ecf5f4f0a032cb4ae4076
Reviewed-by: hjk <hjk@qt.io>
2019-08-02 12:23:12 +00:00
hjk
5efa84b91f Replace remaining Utils::FileName occurrences by Utils::FilePath
Change-Id: Ic3120f18b4fbe90219de9128dba53d7453630b03
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 13:40:22 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
hjk
f420788465 ProjectExplorer: Make Device::displayType a data member
Change-Id: If650f660e3b10bc28d575ded07a854f59be26f87
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-19 13:44:30 +00:00
hjk
555360c1d4 ProjectExplorer: Use the fromMap(toMap()) pattern to clone devices
Change-Id: Ie6e73f5ef1019907dd311aac116d71f08b5a5202
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-10 12:35:59 +00:00
hjk
164ae1428e ProjectExplorer: Move RunControl related classes to separate file pair
Change-Id: I5da56f80336673d595907abcc797f628be680cd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 14:44:46 +00:00
hjk
1e615d7acf Qnx: Inline only use of QnxDeviceFactory::deviceType()
And add a comment to the secondary use of Constants::QNX_QNX_OS_TYPE
as device type.

Change-Id: I1ae4bda890c87500a23e1df5cb7fa6e4f1079c96
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-22 06:46:24 +00:00
hjk
9e965409d1 Move IDeviceFactory closer to IDevice implementation
Except for the DesktopDevice, which is kind of special. Also try
a bit to make (and partially fail at doing so) naming and code
structure (#include, use of namespaces) more similar to each other.

Change-Id: I9fe266e706b72c14f59ff03ca1ae02dba3adcc71
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-21 13:20:16 +00:00
hjk
25ec606c0b Qnx: Streamline device construction
Remove some functions and ctors.

Change-Id: I2b7d5fd0ec5bab0246967b2742f1d3e142f930da
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-16 08:45:10 +00:00
hjk
596017c43d ProjectExplorer: Dissolve one of the LinuxDevice constructors
Use the remaining one plus setters.

Change-Id: I21b11d6ace1c7e1e7a3e8691e22b43931137e9e9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-15 13:04:39 +00:00
hjk
09c1c170d2 ProjectExplorer: Use setter for IDevice::type
Second step towards streamlining the IDevice::ctor/create lines
of functions.

Change-Id: I8b0f2270a9f6545ff9419ef8cf44b456c2233223
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 15:45:00 +00:00
hjk
75bce4332d ProjectExplorer: Use setter for IDevice::machineType
First step towards streamlining the IDevice::ctor/create lines
of functions.

Change-Id: I44226f8a05902cadd40c8820ab67752070d186c0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 15:10:51 +00:00
hjk
a3c6d30b75 ProjectExplorer: Simplify IDevice extra device action setup
Function objects are easy nowadays.

Change-Id: Iec2b770b99d8f11b7a090fb3bd51af8aa60f6fe0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 12:55:51 +00:00
Alessandro Portale
ba4c434211 Qnx: Modernize
modernize-*

Change-Id: I8aae8e3edac885f23b191333d8b0d803c846af43
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-28 17:48:53 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
hjk
e3f0e1be08 Qnx: Use simpler portsgatherer command
As indicated by the removed comment, the original version was
way too complicated.

Change-Id: Ie5d8d8fbe7bd8e44e0538117cd2aaa73958f7d8c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-09-29 10:10:08 +00:00
hjk
7f87e2af3c DeviceSupport: Implement DesktopDevice::portsGatheringMethod()
The feature is useful in a QtApplicationManager debugging context.

Internally, DeviceUsedPortsGatherer uses a DeviceProcess now,
not an SshRemoteProcess, to cover cases where the (Windows Desktop)
device not have ssh available.

Change-Id: I9d33ceac65a135123a376ebd2727dcb540563179
Reviewed-by: Wolfgang Bremer <wolfgang.bremer@pelagicore.com>
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-08-10 15:23:07 +00:00
hjk
7bc88000d9 ProjectExplorer: Introduce a Utils::OsType IDevice::osType() function
E.g. for easier construction of command lines in situations like

    if (isLocal())
        runnable.commandLineArguments = argumentString(Utils::HostOsInfo::hostOs());
    else
        runnable.commandLineArguments = argumentString(Utils::OsTypeLinux);

Change-Id: I5a35304e5d1b5a042952201f39f4134a5cd0ce24
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-28 15:49:56 +00:00
hjk
e05fbf153d Qnx: Rename qnxdeviceconfiguration* to qnxdevice*
All other targets call their devices "Device",
not "DeviceConfiguration".

Also, add a few namespaces and inline the trivial
QnxDeviceConfigurationWizardSetupPage files.

Change-Id: I26168d1b676f6a646b11b61d4cdb7d0f30e18242
Reviewed-by: Anton Kreuzkamp <anton.kreuzkamp@kdab.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-23 07:42:34 +00:00