Commit Graph

22 Commits

Author SHA1 Message Date
Jarek Kobus
7802e475ce Process: Fix EventLoopMode::On
Queue the call to start() so that it's executed after the nested
event loop is started, otherwise it fails on Windows with QProcessImpl.

Fixes: QTCREATORBUG-30066
Change-Id: Ibb17ef0f668f52c05b26a521e18c94e637992ba5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-13 13:38:49 +00:00
Jarek Kobus
8487df5130 Process: Ensure the application is of QGuiApplication type
Checking the existence of qGuiApp isn't enough, since the
implementation just static_casts qApp to QGuiApplication.

The issue might happen in autotests if some function calls
methods of QGuiApplication. The autotests instantiate just
QCoreApplication by default.

Change-Id: Id384fb21b2a2ad66fac59bf5de35668ce50df1d1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-11 17:16:24 +00:00
Serg Kryvonos
c3a7279f05 Work on lambdas C++20 compatibility
Change-Id: I0d391c02ae1e1c5a1751b33ca7e83902e1cfe269
Reviewed-by: hjk <hjk@qt.io>
2023-12-13 13:24:22 +00:00
Jarek Kobus
a737ddd931 Process: Use GeneralProcessBlockingImpl for QProcess implementation
This should fix the Process::waitForReadyRead() when the data
appeared on stdErr channel and not on stdOut channel.

Amends ec722b9132

Change-Id: Ib9f361f4d1602487bdbbb735e55d0ad24fb5e4c3
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>
2023-12-07 10:47:59 +00:00
Jarek Kobus
659f0f000c TaskTree: Unify TaskInterface::done(DoneResult) signal
Change the argument of TaskInterface::done() signal
from bool into DoneResult. Make it consistent with
other TaskTree API.

Introduce toDoneResult(bool success) helper.

Change-Id: I7b3041d7c1ed0317c76adbc1fd37448231e85f82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-11-17 09:44:20 +00:00
Jarek Kobus
a53dfaf623 Process: Switch the default implementation into QProcess
Task-number: QTCREATORBUG-28811
Change-Id: I5647b760998a80f59583b478a65de6d615e1ca55
Reviewed-by: hjk <hjk@qt.io>
2023-11-15 10:26:09 +00:00
Alessandro Portale
f96feadad0 Fix missing overrides and redundant virtual
Change-Id: Id2a247b6032602c2295d928067c2462d3f9b5221
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-14 14:27:45 +00:00
Leena Miettinen
61088bba69 Fix UI text capitalization, punctuation, and phrasing
Change-Id: I41951660a464601063e5cedd417db2cb7cd37e44
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 14:55:38 +00:00
Marcus Tillmanns
2a510011f1 Utils: Send start failed if no ProcessInterface
Change-Id: I38cdce9812bcec3240e3fb4f30a1dd266a5515e9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-10-12 08:41:19 +00:00
Marcus Tillmanns
577b26bf1c Utils: Remove unused function
Change-Id: Ib6aadb180a1208f5ee124f788619afa213aa6823
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-10-06 06:18:47 +00:00
Marcus Tillmanns
e17866e283 Terminal: Show key when input is hidden
Change-Id: I5fca6a8c4f43ea2b95bad4df247b5df0abad521c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-05 13:18:36 +00:00
Jarek Kobus
f4eb25ccec Process: Add setRunData() helper
It allows to set command/workingDir/env in one go.

Fix condition for setCommand() to match the one for setWorkingDir().

Change-Id: I0aa4639f3357c387a0fe8da321e94e34a3ea232d
Reviewed-by: hjk <hjk@qt.io>
2023-08-17 08:08:09 +00:00
Marcus Tillmanns
31f7ed44b6 FilePath: Use isSameDevice
Some places compared the scheme and host of a filepath to
decide whether its the same device. This is incorrect and
leads to false negatives. isSameDevice is the correct way
to decide whether two paths are from the same device.

Fixes: QTCREATORBUG-29474
Change-Id: Iced8f434dadb931f6595f47f95647b341c48d3aa
Reviewed-by: hjk <hjk@qt.io>
2023-08-08 13:19:35 +00:00
Marcus Tillmanns
def291f260 Terminal: Improve paste performance
Pasting large amounts of data on macos would block the App indefinitely.

The issue was a blocking call to ::write. The first fix for that was to
set O_NONBLOCK on the tty stdout fd. The second fix was to pass the
actual result of the write back to the caller so they can react to it.

In the TerminalSurface we now check if the write was successful and
if not we buffer the data and try again later.

Change-Id: Ibc92cce57fad88b5e9aa325197b42e17bec5e746
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-26 09:48:17 +00:00
Marcus Tillmanns
2edaf459bd Utils: Support relative path for PtyProcess
Change-Id: I8af96e51a4b75c192f5fab339449f4d07b1a040a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-13 07:40:41 +00:00
Marcus Tillmanns
11ec14ebf4 Utils: Dont auto add sudo to all processes
Terminal processes need to add to the stub and not the target app,
so sudo is only automatically added for default processes.

The terminal interface is changed such that sudo is added to the stub.

Task-number: QTCREATORBUG-27519
Change-Id: Ife11e937644c4e946401a5b079e90fa64aee2c52
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-06-12 08:09:04 +00:00
Jarek Kobus
abb85b073a QScopeGuard: Make all usages of QScopeGuard consistent
Change-Id: Icfc35ecbdbdee8dadbb1b17789694093427c3ed9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-07 10:35:01 +00:00
hjk
52db6f38f7 Utils: Replace two deprecated uses of .count()
Change-Id: I13d683b762c5093231e42c57d58ae322746d9922
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-06 14:35:46 +00:00
Leena Miettinen
48e2c66a4e Doc: Remove docs for Utils::SynchronousProcess
...that has been integrated into QtcProcess.

Change-Id: I39b6e4cb5d713d59345015b2a471cd4e6ef99f57
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-26 07:35:53 +00:00
Leena Miettinen
8c288bf05f Doc: Add "\inmodule QtCreator" to \class and \namespace docs
To get rid of QDoc warnings.

Change-Id: Idd39b7ae4327798c376f424c94d6617bcaee2258
Reviewed-by: hjk <hjk@qt.io>
2023-05-22 12:48:35 +00:00
Jarek Kobus
c75b59f9b4 Process: Rename QtcProcessPrivate -> ProcessPrivate
Rename the logging category for Process.
Fix inline comments accordingly.
Adapt warning/debug messages accordingly.

Change-Id: I2b1f0f558701def3afa3c1b04adf629833dba9e7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 06:07:22 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00