Commit Graph

1357 Commits

Author SHA1 Message Date
Jarek Kobus
460f347757 VcsBaseEditor: Get rid of diffChunkApplied()
Drop unused arg from diffChunkReverted().

Change-Id: I5531645d317d62ae92cd0e63dadd583f8ab8996d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-29 15:15:38 +00:00
Jarek Kobus
b67c868f75 PatchTool: Introduce PatchAction enum
Add static PatchTool::confirmPatching() and reuse it
in two places.

Use Tr::tr() inside PatchTool.

Change-Id: I70779619dbb58ab6e46a585bbeff51588ccb2f53
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-29 15:15:30 +00:00
Jarek Kobus
38b19bfae6 DiffEditor: Cleanup includes
Change-Id: Id8127b9b0c99ee2a0d5d367cb551a1d5779c5d38
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-29 15:15:12 +00:00
hjk
9c47990a0a VcsBase: Simplify QActionPushButton implementation
No need for Q_OBJECT.

Change-Id: I72510ef2e4a722286d12c93016a92370393ca32c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 13:48:46 +00:00
hjk
69f4cb86dd VcsBase: Inline submiteditorwidget.ui
Quite a bit of special access from the outside, so LayoutBuilder is not
really helpful here.

Change-Id: I006b66e155c2abd46e7077add006fe31ec6b227d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 13:48:41 +00:00
hjk
aa2145ac5e VcsBase: Inline nicknamedialog.ui
Change-Id: I98b0d300d78336c67103483bdf5c552b36e0a868
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 13:48:35 +00:00
hjk
6ff6fe3b0e VcsBase: Remove Q_PROPERTY definitions
The initial intention was to make these widgets usable from Designer.

We don't expect a lot of new uses in this direction, and clazy
seems to warn about not-so-complete Q_PROPERTY definitions:

Link https://github.com/KDE/clazy/blob/master/docs/checks/README-qproperty-without-notify.md

Change-Id: I4a2e9ff6ec7ecfd989196801c789533b4c44e8af
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-28 06:00:31 +00:00
Jarek Kobus
5eae4d5279 VcsBaseClient: Fix going to default line number
Since we are being connected to the same done() signal twice,
the order of slot invocations started to play a role.
We were connecting done() signal to
VcsBaseEditorWidget::reportCommandFinished() first
and to VcsBaseEditorWidget::setPlainText() afterwards,
so they were executed exactly in this order. However, this
order isn't desired, as we need to set text first and
jump to line afterwards.

In order to fix it so that we don't rely on connection
order we handle setting the content and jumping into
the default line in one common handler.

Amends c767f193ce

Change-Id: Iea17476cc25b54759457710ecb6b6de2f0f5caf7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-21 16:31:44 +00:00
Jarek Kobus
1dbdc46ea1 ClearCasePlugin: Reuse CommandResult
Get rid of ClearCaseResponse struct.
Replace foreach with range-based for loops.

Change-Id: Id78e2ca3598c16ad16ebaeddae73a140e3473936
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-21 13:56:09 +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
b795bd8042 VcsPlugin: Use VcsCommand::done() signal instead of finished()
Conform to QtcProcess interface. Use result() when needed.

Change-Id: Idd4c71d9a103e8649b08ec7787c2f286423a31ec
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-20 10:41:35 +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
c767f193ce VcsBaseClient: Use cleanedStdOut()
Instead of connecting to stdOutText() signal.

Change-Id: Ib05113bf624d58a4f66e6c1f64217b579c8de1a9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-20 10:30:45 +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
2429232e72 VcsBaseDiffEditorController: Fix git show
Though it was looking weird, it's still needed.

Amends 73e48ef275

Change-Id: Idedc254a9dad125239becfe4f2edb9fe93298bfc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-17 21:37:34 +00:00
Jarek Kobus
73e48ef275 VcsBaseDiffEditorController: Get rid of VcsCommandResultProxy
The workaround with VcsCommandResultProxy, introduced in
0b1eaacabb isn't needed anymore
since finished() and stdOutText() signals are now emitted
synchronously from the caller's thread.

Give a context object to watcher's finished handler.

Change-Id: I6608b7c2806fc0c18649ff40f91684e9eaa7b15d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-16 11:40:12 +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
Eike Ziller
5ae23f8c66 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	.github/workflows/build_cmake.yml
	src/plugins/qmldesigner/components/connectioneditor/dynamicpropertiesmodel.cpp
	src/plugins/qmldesigner/components/materialeditor/materialeditorview.h
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
	src/plugins/qmldesigner/designercore/model/model.cpp

Change-Id: I111b9140375b894a5487cc012b17cc32100bdb8d
2022-09-13 11:15:16 +02:00
Jarek Kobus
fa9008c7f8 VcsOutputWindow: Don't append \n when line ends with \r
Amends a2797ec80e

Fixes: QTCREATORBUG-27615
Change-Id: I5b2d2bc442696a1560a2af3dfe14e70a9c42cc88
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-09 11:29:49 +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
6d6346044c VcsBase: Rename vcsFullySynchronousExec into vcsSynchronousExec
Get rid of original vcsSynchronousExec(), as it was calling
vcsFullySynchronousExec().

Change-Id: I911dc786d54c34c211d03661c37df9b58d60a20b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-02 13:46:12 +00:00
Jarek Kobus
996e1bfc45 VcsBase: Reuse vcsFullySynchronousExec() in vcsSynchronousExec()
Both implementations look the same nowadays.

Change-Id: I00503f625395db3354eefa8d55326ee22f452c2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-02 13:46:02 +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
66bfdffe0c GitClient: Replace describe command with QtcProcess
There is no need to use VcsCommand when NoOutput is passed.
Get rid of execBgCommand().

Change-Id: I58354e99ddc0c4049325560022ba6e755092b817
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-09-01 16:35:41 +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
Marcus Tillmanns
b17cf5f117 Plugins: Fix nullptr access
Some plugins access their private "d" member in their destructor.
If Plugin initialization failed, these might not have been created.

This would lead to a crash.

Change-Id: Ifd916daf90ebac9a8933dd5489ec1ac0a38254a0
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 08:19:25 +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
Orgad Shaneh
45aa6a12c4 Git: Support user configured comment character
Task-number: QTCREATORBUG-28042
Change-Id: I96aea27434ba138637728a7fd7d1450e1eee260a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-08-26 10:41:27 +00:00
Jarek Kobus
a50afa486a VcsCommand: Remove unused SshPasswordPrompt
Change-Id: I402d619656d8339b1e81bc9ae96acf56178505d2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-26 08:36:34 +00:00
Eike Ziller
025bdfe702 VCS: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I364e5b663353f37121279a58f4a9fd514cddbbf0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-26 08:03:01 +00:00
Jarek Kobus
278589a014 GitClient: Reuse VcsCommand::NoOutput
Change-Id: If30d78a34ae77a7397af6374f8b733809ecaab20
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-26 06:38:38 +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
hjk
c6ff62b299 VcsBase: inline cleandialog.ui
Change-Id: I197b3681559a2a42d5fe614840e0a61ed629dbbb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-05 14:59:56 +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
6e160b2088 VcsCommand: Limit the usage of setCookie()
Use lambda capture instead.

Change-Id: I43ff080c4909ecf12fd330c8db9a1f0bfb497011
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-08-02 08:59:52 +00:00