Commit Graph

92 Commits

Author SHA1 Message Date
Eike Ziller
8db0d3b0ff Fix lupdate issues
- missing Q_DECLARE_TR_FUNCTIONS
- some full qualifications needed for confused lupdate
- avoid breaking some translations from former TaskListPlugin,
  VcsCommand and highlighter settings refactoring

Change-Id: Ia3b34095512a7bad6903f0aff6095313ee39e3e4
Reviewed-by: hjk <hjk@qt.io>
2022-10-14 13:26:45 +00:00
Jarek Kobus
7c0c57fef9 VcsCommand: Remove outdated comments
Amends 93dfa93b7d

Change-Id: Iad2f4002aaa4579aa90209daf7a7a960607e3c36
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-09 06:53:40 +00:00
Jarek Kobus
93dfa93b7d VcsCommand: Simplify ProgressParser
Get rid of abstract base ProgressParser and replace
it with ProgressParser function. The only one former
subclass GitProgressParser is now functor object.
Pass future interface directly to the ProgressParser
function, along with input text to be parsed.

Change-Id: Icbcf0b6e55097f8b38eb8a32ceaa4414723116d0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-07 14:52:14 +00:00
Jarek Kobus
363731a8c8 RunFlags: Add ProgressiveOutput flag
It replaces VcsCommand::setProgressiveOutput() property.

Change-Id: Icebd2205a5b489f60ded1eeee21e2deacbfde1fe
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-06 13:35:48 +00:00
Jarek Kobus
eec0679234 VcsBase: Move RunFlags into separate header
It is going to be used outside of VcsCommand, too.
Use RunFlags enum as an argument to several functions
instead of unsigned.

Change-Id: I355c80a845a9b5982108fbde3412754392dce702
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-06 12:00:35 +00:00
Jarek Kobus
7591b2f56d VcsCommand: Make runCommand() a static method
And rename it to runBlocking() in order to conform
a bit more to QtcProcess API.

In case of blocking run there is no need to instantiate
VcsCommand on user side. This nicely draw a line between
async usages (i.e. when start() is called and we need
an instance) and blocking ones (i.e. when runBlocking()
is called).

Change-Id: I1ba94ee36c92956d5044236cb9e2dd896bf3cfcf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-05 17:13:49 +00:00
Jarek Kobus
688ec935cd VcsCommand: Remove internal terminate() signal
This signal was emitted only from cancel() method and
used only when runCommand() was called. However, with
just 2 public usages of cancel() no-one was used
in conjunction with runCommand(). So, this signal is
no-op.

Change-Id: I2541c6498928d313faafc2fbe47ab609393486d1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-05 17:11:17 +00:00
Jarek Kobus
f4233a1c22 VcsCommand: Change the default logic for fully sync
Remove VcsCommand::FullySynchronous flag.
Rename VcsCommand::NoFullySync into UseEventLoop.
By default the command will run fully synchronous
(i.e. without nested event loop). Only when
UseEventLoop is specified, and the command runs in
main thread, the nested event loop will be used.

This change should preserve the current behavior
on all code paths.

Change-Id: Id4bbaf68402ceed5e3fcc6f294521e87eb0b8d4d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-05 17:10:04 +00:00
Jarek Kobus
29ecc7b5dd VcsCommand: Rename execute() to start()
In order to conform to QtcProcess API.

Change-Id: I71fcc03846f32cd3c2df39824ce3f6730c20ebbb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-21 05:33:46 +00:00
Jarek Kobus
353f50693e VcsCommand: Remove finished() signal
Change-Id: I79a1ca05c1bc246f3a850fcbf585c89dddb45cb1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-20 19:10:44 +00:00
Jarek Kobus
5e10ea19c1 VcsCommand: Conform to QtcProcess API
Add result() getter and done() signal in order to
conform to QtcProcess API.

Change-Id: Idc7c57e03d6e8acead9d4c034f4efc56250f944d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-20 10:41:25 +00:00
Jarek Kobus
f729efe3df VcsCommand: Don't emit std channel signals when finished
Conform to QtcProcess behavior and don't emit stdOutText()
and stdErrText() on finished when progressive output is off.
Use cleanedStdOut() / cleanedStdErr() getter instead.

Change-Id: I2c416c0264f2203c7a9c73de900c12777f4fd3b3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-20 10:41:18 +00:00
Jarek Kobus
3978cdde6c VcsCommand: Add std channel getters
Conform to QtcProcess interface and provide cleanedStdOut()
and cleanedStdErr() getters, to be called after the process
finished.

Use cleanedStdOut() inside DiffEditorController for getting
the output after the process finished instead of connecting
to stdOutText() signal.

Change-Id: I7ba3735b0ab2167ac1f3b0954dd5dc9553910aac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-19 10:31:35 +00:00
Jarek Kobus
7274cad083 VcsCommand: Always install std callbacks
Do it also in fully synchronous case, as QtcProcess
is able to handle them even when EventLoopMode is off.

Change-Id: Ic24ff34e3d8808d2aaaf0300ba4ac95662e46d23
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-16 07:20:21 +00:00
Jarek Kobus
2b3c05ba90 VcsCommand: Handle SilentOutput
Handle SilentOutput flag into accound when runSynchronous()
to make it consistent with fully synchronous case.

Change-Id: I955714872601f8fb7ffff8d570eec5ff610d9cfe
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-15 15:26:00 +00:00
Jarek Kobus
683d2fec2d VcsCommand: Fix reporting error channel
Make error reporting consistent with runSynchronous() case,
where error channel is reported via appendError().

Amends 2c5095c94d

Change-Id: I0d962d42eb696e91f05ebb4f1f92677607b24a27
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-15 15:25:54 +00:00
Jarek Kobus
bf99841eb9 VcsCommand: Fix progress reporting during execute()
In case of calling execute() the fully or not fully
synchronous setting is no-op now, as we execute
always in the caller thread and don't use blocking
API of QtcProcess and don't create nested event loop.
Behave the same regardless of these flags and always
setup std callbacks if needed.

Rename setupSynchronous() into installStdCallbacks()
to better reflect the current intention.

Change-Id: I93642c61d98a26c16298725f0d910d0dd80414b1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-08 15:41:41 +00:00
Jarek Kobus
5047802f0a VcsCommand: Remove one runCommand() overload
Not used anymore after changing implementation of execute().

Change-Id: I0af0e61b3bd9184f30f11cd80d377d25acf805f8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-05 06:11:41 +00:00
Jarek Kobus
2a2b136624 VcsCommand: Get rid of abort()
Use destructor of VcsCommand instead.

Change-Id: Ie914d016c6d3d57a88674ce8534d5edec4bc79c1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-02 13:22:15 +00:00
Jarek Kobus
84426350d4 VcsCommand: Fix unblocking GlobalFileChangeBlocker on abort
Change-Id: Ied60a0ecb291e50f4c48dc2e5df3371e4010932e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-02 13:22:10 +00:00
Jarek Kobus
3dc3870475 VcsCommand: Don't run in separate thread
Change-Id: Ief0e859d3ce48f804e128cc0f5cb1b390a066923
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-02 13:21:57 +00:00
Jarek Kobus
6f50040e13 VcsCommand: Extract some methods for further usage
Change-Id: I385a02d773527a73bbd7fff0a40a40db476a70b8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-01 16:31:17 +00:00
Jarek Kobus
28fdeefe6f VcsCommand: Move some methods into VcsCommandPrivate
Change-Id: I49302dadcc1ceaa7c73970aff9e41237d554098a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-01 15:16:07 +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
Jarek Kobus
8703bcd777 VcsCommand: Don't cancel finished task from d'tor
Amends a5683616b9

Change-Id: I6b746dfa444737e87c98b878c017374f2034d400
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-15 10:58:51 +00:00
Jarek Kobus
a714ddf59f VcsCommand: Create ProgressTimer manually
The QFutureInterface<void>::get() method was introduced
in 6.3, so we can't use it yet. Create ProgressTimer
manually in the caller thread for the future passed to
ProgressManager::addTask().

Amends a5683616b9

Change-Id: I1f96c433e759d66eaaa1a32489e9db4facecf46a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-03 14:06:05 +00:00
Jarek Kobus
4edb238073 VcsOutputWindow: Use FilePath for repository
Change-Id: Ie6669c94a1fa29e48524b9338e74413bb0830229
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 12:23:52 +00:00
Jarek Kobus
7bd33bc247 VcsCommand: Remove defaultWorkingRepository() getter
It wasn't really broadly used.

Change-Id: If2e185a7d8d0f920f3ec7f507bf96dd81f4559b0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 11:30:36 +00:00
Jarek Kobus
a5683616b9 VcsCommand: Fix timed task's future interface
Pass the future interface of the running task into
ProgressManager::addTimedTask() instead of not
related future. In this way canceling the timed task
(after pressing the small x button) makes the
future interface canceled in the worker thread.

Change-Id: I4596823d40bd079841e59c9bdba025d30cb33711
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 11:30:31 +00:00
Jarek Kobus
8e48dd5c92 VcsCommand: Remove unused field
Change-Id: I14ce1c616bb98bef127aec666ca9241e63584e40
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-03 06:12:01 +00:00
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
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
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
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
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
Jarek Kobus
06023df8be VcsCommand: Move the class into vcsbaseclient.cpp
No need for a separate header.

Change-Id: I870ea0d9547829037644d79a286d87d4c77dc4ae
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-14 08:57:21 +00:00
Jarek Kobus
cb9ead8c8d VcsCommand: Remove m_preventRepositoryChanged field
Disconnect the appropriate connection instead.

Change-Id: Ie5cd8b3bcbab526aa770c493a465c9cdb07437f6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-14 08:57:14 +00:00
Jarek Kobus
84de21b702 VcsCommand: Don't store the FutureProgress
Amends 9891a879aa

Change-Id: I164eda5935847343bf76bfbcf650ba372ccb6681
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-14 07:39:50 +00:00
Jarek Kobus
197ad524a6 ShellCommand: De-virtualize postRunCommand()
Provide runCommandFinished() signal instead.

Change-Id: I7c5e7d4aa484a7248dc369880343996e18c7c4b0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-14 07:39:44 +00:00
Jarek Kobus
c7f24f9f13 ShellCommand: De-virtualize addTask()
Provide executedAsync() signal instead.

Change-Id: I8f04dc90875e5f27827ea553a9f23f41656cc4db
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-14 07:39:37 +00:00
Jarek Kobus
85071d8e8d ShellCommand: De-virtualize environment()
Provide instead a protected setter, used in VcsCommand c'tor.

Remove a forceCLocale arg from setProcessEnvironment() method,
as it is used only in VcsCommand context when
ShellCommand::ForceCLocale flag was set. Move setting
C locale env directly to the shell command, just before
the command is executed, so that we are sure the flag
was already set.

Modify env directly in VcsCommand c'tor with regards to
SSH_ASKPASS variable.

Change-Id: Icff555ade4984368f7ce79f762d1bb5d3614076a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-13 19:29:10 +00:00
Jarek Kobus
0490e3426d ShellCommand: Merge VcsCommand::VcsRunFlags into RunFlags
Use ShellCommand class name in signal-slot connections.

Change-Id: Id50ee6887708558a2ba0972ece6c420b0be36f72
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-12 14:49:10 +00:00
Jarek Kobus
e3da02248a ShellCommand: De-virtualize runCommand()
Add virtual postRunCommand() method, called
by the end of runCommand().

In this way the rest of the API of VcsCommand remains
an implementation detail.

Change-Id: Ia4149334bd39a1448266d2406e0987bee07a9c58
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-12 14:49:00 +00:00
Jarek Kobus
cea7be0486 VcsBase: Remove some ssh related methods
Remove VcsCommand::m_sshPrompt, as it is always taken
from settings.

Change-Id: I9f46bb5a9de03e907f2098ca72a647c969e55a27
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-12 11:04:29 +00:00
Jarek Kobus
975baf23ac ShellCommand: Make processEnvironment() protected
Rename it to environment().

Change-Id: Ib393ea09d324cbd86b0b74ac928fcb37f243f8fc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-12 11:04:23 +00:00
Jarek Kobus
e793841b4f Remove Core::ShellCommand
Move the implementation into VcsCommand.
Use Utils::ShellCommand inside coreplugin API.

Change-Id: I74a34057b33832a138b05f1dfa6937565027edb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-07-11 10:04:08 +00:00
Jarek Kobus
92d7e4601d QtcProcess: Forward declare Environment in QtcProcess header
Change-Id: If85a8a07b144c94cb6e45f66dcb06573ef07c777
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:40 +00:00
hjk
bbde6ac9bf VCS: Use more FilePath in ShellCommand and surroundings
Change-Id: Ie8c5fac09b45a54bcbe9a876044b653e7fccede5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-17 07:16:04 +00:00
hjk
ff57cb548d Vcs: Use more FilePath for file paths
Change-Id: I855cde65d034a9647972a7fddf1e8266d7ccfa88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-02 14:40:33 +00:00