Commit Graph

1382 Commits

Author SHA1 Message Date
Jarek Kobus
2596f39823 VcsBase: Fix connection in revertAll()
The original intention was to connect to done signal
of the executed command.

Change-Id: I35e1f931a54bf763c3d9ffc71237b1d96cda1343
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-09 11:24:27 +00:00
Christian Stenger
8dd939bb27 Vcs: Do not expose passwords to the output windows
Partially reverts bbde6ac9bf and
3be9f52980.

Fixes: QTCREATORBUG-28413
Change-Id: Iccfb787a5261f3963e862554fa266d62ac49ca50
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <hjk@qt.io>
2022-11-11 14:28:11 +00:00
Orgad Shaneh
913c6f037c VCS: Remove export for inline functions
vcsenums.h:29:28: warning: inline function 'void VcsBase::operator|=(VcsBase::RunFlags&, VcsBase::RunFlags)' declared as dllimport: attribute ignored [-Wattributes]
   29 | inline void VCSBASE_EXPORT operator|=(RunFlags &p, RunFlags r)
      |                            ^~~~~~~~

Change-Id: I0490965260302009bb49ed1c4be994496cbe186f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-27 06:32:58 +00:00
Orgad Shaneh
e003a02721 VCS: Fix resolving active directory for temp editors
Amends c666c93882.

Change-Id: Ib7aeb9616d3d527f829ece2a39eb5ddf77f9431e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-26 20:57:39 +00:00
hjk
4266f612e6 Utils: Rename FilePath::relativePath() to relativePathFrom()
Hopefully less confusion about the direction.

Change-Id: I61727d6c4d19e0dfe46f24ff24f5d90f9835d05c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-18 13:41:24 +00:00
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
Orgad Shaneh
183dfb48a7 VCS: Rename function
Change-Id: I593e1db222e2124f3db367620171f3a101b4b8eb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-14 12:24:18 +00:00
Orgad Shaneh
20cd55046f VCS: Do not prompt on close if nothing was done
Fixes: QTCREATORBUG-22233
Change-Id: I1e8240131ccb9a6583a8ae76b3f5c93799f588a5
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-13 06:55:17 +00:00
Orgad Shaneh
7c623f99d8 Git: Fix pattern for commit hash matching
* Avoid matching mid-word.
* Avoid matching after "mode ".
* Change to raw string literals.

Fixes: QTCREATORBUG-24768
Fixes: QTCREATORBUG-28268
Change-Id: I68abbf3de7928c60e0fe2d944adedaa6db94b1a4
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-10-11 10:00:53 +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
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Robert Löhning
fcb79ee810 Git: VcsBase: Squish: Make tst_git_local run again
Amends 1548eef10b
Amends 69f4cb86dd
Amends 9ad5c4254d
Amends e070d826e5

Change-Id: I584b1b9b662144899d0292b887e8cb3386f80d4b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-10-07 08:33:12 +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
98c4e342f8 RunFlags: Group flags into QtcProcess related
Some flags directly relate to QtcProcess setup.
Group them together. Reorder other flags to keep
related next to each other. Modify some descriptions.

Change-Id: I8694fb5ca0edd7e770a084d7d1d890d48a13a347
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-06 13:35:41 +00:00
Jarek Kobus
b8efc2f14d VcsBase: Use FilePath in editorTag()
Change-Id: I4093fa46a51767afd00a8de2f94986c708dc1efa
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-06 12:06:03 +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
772d3d7c79 NickNameDialog: Use more FilePath
Change-Id: Id7677a636977343ab6cef72ad0267f27981c640a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-05 17:08:08 +00:00
Jarek Kobus
993fd2a92a VcsBasePlugin: Use FilePath::relativePath
Instead of QDir::relativeFilePath().

Change-Id: Iacd25e51dc87b987402ff3677f6705c6e0e8edbf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-04 11:51:40 +00:00
Jarek Kobus
c666c93882 VcsBasePlugin: Use more FilePath
Change-Id: I7bc80245b093b210439efdf3ea353b52b288dcc0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-04 11:51:20 +00:00
Jarek Kobus
34f9229eef VcsOutputWindow: Use toVariant() when storing FilePath
Amends 4edb238073

Change-Id: Ied6f2d9fd78a40f70393eae1c685198ab119e575
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-04 11:51:11 +00:00
Jarek Kobus
604730f14d CleanDialog: Use more FilePath
Change-Id: Id545b8c412d55d8e1976cbe0bbdad36e22eb93a0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-02 19:04:58 +00:00
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