This is needed when moving ProcessInterface beweeen threads.
Change-Id: I26158c68bdc8e77ecb3e3d4535ba767ef3d0b63c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Don't use SshDeviceProcess anymore for opening linux terminal.
Fix running the empty command so that it opens ssh shell.
Don't leak terminal processes on shutdown.
One issue is that terminals are closed when closing settings,
as settings dialog operate on a copy of device, and in case
of no modifications applied the copy is being deleted.
The current workaround is to press the "Apply" button
before closing the settings dialog. This issue is to be
addressed separately.
Change-Id: I3c48b035daf1d099a1e8fa0762a6d6d0eca9592c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Centralize some boiler plate and warn about best-guessed cases.
Keep the QByteArray based access as writeRaw()
Fixes: QTCREATORBUG-27445
Change-Id: I948d80fba78b36cf85cc73664175ab05eb7707d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This is going to replace SftpFileSystemModel.
That's needed before planed removal of SshConnection in order
to not to use SftpSession class.
Change-Id: I97f0ffd3418f7e71819ac95048a75e4a17901c71
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>
Don't rely on a synthetic marker when running a shell
command and expecting any output. The marker might always
be a part of the output data from the running command.
That's unreliable.
A solution is to do a similar thing that we are doing
inside runInShell(). We ignore the error channel there,
so it means that when calling outputForRunInShell() we
have two channels for our purposes. So, the output from
the command we pass through, and its error channel we
redirect to /dev/null. Later, we run "echo $?", which
prints the return code from the last command and we
redirect it to standard error channel. Inside
outputForRunInShell() we read the error channel as long
as we detect something there. We assert if it's being
convertible to int and we also assert that the command
itself succeeded. Afterwards we break the endless loop
and read the output channel for the first time - it
should contain all the output gathered from the running
command.
Change-Id: Ia0ad73623f813ef593c11dff9bdba4df9e524315
Reviewed-by: hjk <hjk@qt.io>
Was originally restricted to UNIX hosts, but works for Windows
as well.
Change-Id: I233ec73760134256723a927de5e9e6cc9aefa8ac
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Always add " > /dev/null 2>&1" infix so that the
output of e.g. "rm" command, when failed, is redirected
to dev/null.
Enclose the input data in runInShell() with quotation
marks and escape all the characters in passed data
accordingly. Pass the "-e" option to echo in order to
turn on the escaping mode.
Add a new test for testCreateRemoteFile().
Change-Id: I7db07b57035242279cac7dd77a80ac6dd05bfb1f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
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>
This includes replacing DeviceProcess terminal handling with base
member.
Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
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>
Somewhat slimmer interface on the user code side and follows
existing practice.
Change-Id: I20ed8f5a00591265d32ea9ce93e1f1bbc76d2437
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... into a single class.
This makes passing them around as a whole easier, and opens a path
to have "generic" filters in form of a lambda or such.
Change-Id: Ibf644b2fedcf0f1a35258030710afff8f5873f88
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
After we have started the shell it can happen that
it will finish silently soon due to e.g. ssh server not running.
Before we try to execute any command in the shell we
schedule a test echo command just after successful start
in order to confirm that the shell is running fine.
If waiting for ready read returned false (i.e. the shell
process finished) or if we don't receive the expected
newline character we report a start failure.
Fixes: QTCREATORBUG-26861
Change-Id: I7387b3a366f8e6f4a58745582bb803f5060cfc36
Reviewed-by: hjk <hjk@qt.io>
Implementation of remote file API for correct FilePath
work with RemoteLinux.
Added tests for this functionality
Run ssh shell in separate thread.
The linux device instance keeps its own thread for running
SshRemoteProcess. In this way all calls to filepath
interface of linux device coming from different threads
are executed in one thread (SshRemoteProcess is reentrant,
but not thread safe). The redirection to the device thread
is done by invoking SshRemoteProcess' methods through
BlockingQueuedConnection.
Done-by: Artem Sokolovskii
Change-Id: Id8756738d3a4597f175c8ef000c148d0c8536eeb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.
At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.
Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
That should only happen on direct user interaction.
Also use new message manager API.
Task-number: QTCREATORBUG-24430
Change-Id: I87297b2ec7191b88210d3a2037afe27b8a3f40e9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
QStringRef is gone.
qsizetype vs int.
QMultiHash::insertMulti is gone.
QXmlStreamWriter writes UTF-8 by default.
Task-number: QTCREATORBUG-24098
Change-Id: Id217e40a1f17993a84fc725976e9cb84618b0580
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
- new ambiguous overloads for mapToGlobal
- some functions now return qsizetype instead of int
Task-number: QTCREATORBUG-24098
Change-Id: I0020e5689e093653e9e0e6f0d6263720bc2e003b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>