Commit Graph

1019 Commits

Author SHA1 Message Date
Jarek Kobus
d97d3f58ac TaskTree: Rename TaskItem into GroupItem
Not all classes derived from TaskItem are tasks,
but the common denominator is that all may be placed
inside a group: thus GroupItem sounds more appropriate.

Addresses the 10th point in the bugreport below.

Task-number: QTCREATORBUG-28741
Change-Id: I94d728a8e39ec732810f2e5bbe6b9a76f3bc387c
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
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>
2023-06-06 09:06:01 +00:00
Eike Ziller
7bd06829c4 Tr/VCS: Fix various issues with translations
Inserting the name for the "commit" operation into messages relies on a
certain sentence structure and doesn't work with translations. Same for
"optional" error messages. Use different complete messages for the
different cases instead.

Avoid explicit line endings, use automatic word wrap instead.

Add some quotes and full stops.

Fix message with plural.

Don't use %n for constant number (inline in message with assert).

Improve confusing tool tip for instant blame.

Change-Id: Ic8453763279753ebd5898858951acddcf311e6e4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2023-05-31 10:53:24 +00:00
Jarek Kobus
4e01ca18d1 TaskTree: Rename optional into finishAllAndDone
Rationale:
1. More descriptive.
2. More consistent with a planned new finishAllAndError policy.
3. Limits the possibilities of making a conflict with std::optional.

Change-Id: I5155630188e4b699e6c18b13a101e0e2d4fe98f2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-30 15:23:31 +00:00
Andre Hartmann
419f5416c5 Git: Avoid main loop blocking in instant blame
Query the author and encoding information asynchronous
after the current repository is changed.

Set the default codec to UTF-8, which should cover most
configurations (i.e. almost never be different).

In case requesting the information takes longer, the blame
mark is already created with the cached information.

In case the author or encoding changed, the blame mark
has to be recreated.

The call to refreshWorkingDirectory() is moved after the
widget checks in setupInstantBlame() to avoid requesting
these information in VCS editors.

Fixes: QTCREATORBUG-29151
Change-Id: I6feccbbed67c877f1015295f630dd63cf3ccf4a0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-05-29 06:06:54 +00:00
hjk
d740a355bb Utils: Rework CheckableMessageBox
Remove function overloads, thes are hard to read, to use and to extend.
I'd even argue this should be a plain default ctor and a few setters +
exec(), pretty much like Process::start() nowadays.

Move "decider" magic into a structure that can be filled ad-hoc outside
checkablemessagebox.cpp paving the ground for:

...removing  aspect dependency from CheckableMessageBox, Instead, add a
convenience function to BoolAspect.  Arguably, the latter is not needed
and could be done on the user side.

Use pointers instead of mutable references for in-out parameter.
Makes the "specialness" visible on the user side.

Pass ICore::settings() centrally as done elsewhere to reduce line noise
on the user side.

Change-Id: Ibb366353d1ea35401723fd05ce05672617a0a8fd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-22 06:40:13 +00:00
Jarek Kobus
0793b945f3 TaskTree: Replace usages of OnGroup... with onGroup... functions
Change-Id: I06ce6c917ac28b6362ad2cdef42355e5aa28f4eb
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>
2023-05-19 15:29:55 +00:00
hjk
6f31d87444 Use more FilePathAspect
Change-Id: Ib348df1460f8610607251498b07010df58d51ddf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-19 15:07:17 +00:00
Marcus Tillmanns
1fc2459b62 Utils: Unify CheckableMessageBox and make it look more native
Change-Id: I5690c16f38cfd2058e01441283bec28d44cadf75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 08:01:13 +00:00
hjk
545a105634 Git: Also use the latest settings setup approach
Change-Id: I34a210575d02d18927c1e0f6d8ea6cb9924c563d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-05-15 13:09:47 +00:00
hjk
c85b72000f All: Use the shorter access to aspect values in a few places
Change-Id: Ie0ff0e4e1cf4c2750897ea733dfccb743f44fa93
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-12 16:04:38 +00:00
Jarek Kobus
97a66067bb TaskTree: Prepare for de-utils-ization - part 2
Move TaskTree into Tasking namespace.
Move Tasking namespace out of Utils namespace.

Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 08:09:19 +00:00
Jarek Kobus
c68a013a3e Tasking::Tree: Rename Tree into TaskTreeTask
Task-number: QTCREATORBUG-29102
Change-Id: I70073bcb44a712c427c8c5aea42c48dbc30eebe0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 06:07:45 +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
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
Jarek Kobus
1d69f943aa Tasking::Process: Rename Process into ProcessTask
Rename QtcProcessAdapter into ProcessTaskAdapter.

Task-number: QTCREATORBUG-29102
Change-Id: I1902c7176da75db60d70125f505084a2ea5ba774
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 12:47:24 +00:00
Eike Ziller
66c0c36bc1 Fix compiler warnings
Change-Id: I9b0b4a60d1152142f62bf3f76885cf8019714623
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-02 09:05:16 +00:00
Jarek Kobus
69ec9c4361 TaskTree: Add TreeStorage::operator*()
Reuse it in some places.

Change-Id: I335f38fa0384ea17bd8e981d743f835c3f05b731
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-02-21 07:31:48 +00:00
Eike Ziller
4e9309f923 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/clangcodemodel/clangcodemodelplugin.cpp

Change-Id: Idb3d6e8fdfd278979f6180dc3795a2138bc2e61d
2023-02-16 12:47:32 +01:00
Eike Ziller
379bf65e96 Some fixes in translated strings
- doesn't make sense to translate "%1"
- showPreprocessedFile: "reason" contains full stop, put at the end
- add missing closing >
- remove whitespace at the end of translated string
- added missing quotes and full stops
- Remove some control text from tr

Change-Id: I5537c3d12d038e25e2209af1198129fbf959b43c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-02-15 12:45:48 +00:00
Orgad Shaneh
d20f543619 Git: Reduce sync processes
Change-Id: I5d83636d4a018464ba6f248aa818fb8f840df9fc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-02-14 15:33:59 +00:00
Andre Hartmann
86ffc29239 Git: Avoid passing strings to resolve text encodings
Therefore, merge the code of codecFor() and encoding()
to avoid further mis-usage.

Change-Id: I086e4ace6c791d16f43f14c423b6529ad199c456
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-30 17:51:47 +00:00
Jarek Kobus
817553f3e5 TaskTree: Merge DynamicSetup with OnGroupSetup
Don't define 2 separate group setup items. Make OnGroupSetup
be able to handle also dynamic setup - like it's done with
CustomTask's setup handler.

Change-Id: I43e135f268ea96419b44ef5a4325707a124b4921
Reviewed-by: hjk <hjk@qt.io>
2023-01-23 08:07:36 +00:00
hjk
2336ff5570 Git: Some more FilePath proliferation
Change-Id: I8d3d97d0c7979d741a7da333f922ce93359afef8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-23 07:15:17 +00:00
Jarek Kobus
98ff1d32f9 TaskTree: Remove GroupConfig / GroupAction
Use TaskAction for dynamic group setup. Get rid of possibility
of selecting group's children to be started inside group setup.
Use dynamic children's setup instead, so that each individual child
may decide itself whether it wants to be started or not.

Change-Id: Ie31f707791db0dc26be92663ca6238b8e49c3b98
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-20 14:18:56 +00:00
hjk
013ad1345e VcsBase: Proliferate use of FilePath
... and update user code.

Change-Id: I52c08e9e07238536d31fc72f97312ac582a1e32f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-20 12:02:32 +00:00
Jarek Kobus
3244819d3a GitClient: Replace DynamicSetup with dynamic task setup
Change-Id: I1a56e34274c5d7ace8fb8866c128c8dee03d2ad8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-20 09:35:40 +00:00
Jarek Kobus
c6471341f6 VcsPlugins: Use multi-arg for strings
Change-Id: I8c1c62e3d2f98781ff1468b44ad11640b873695d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-11 09:19:53 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
df2d68eb4f VcsBaseDiffEditorController: Remove unused stuff
Change-Id: I34cc9dee686929fb69253ba16ff0fd5fed023ca1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 20:55:52 +00:00
Jarek Kobus
817c13c9e1 GitBaseDiffEditorController: Remove unused method
Change-Id: Iff58be30e40a181fc259564415a9850a891b4953
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 20:55:27 +00:00
Jarek Kobus
c06c6be4ab GitDiffEditorController: Reuse task tree
Change-Id: I6f89a6865ee45eea66a0307c273ef8d76976da3b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 20:55:16 +00:00
Jarek Kobus
36fd9cb9d5 VcsBaseDiffEditorController: Make post processing reusable
Move creating the post process task into vcs base class
and reuse it in subclasses.

Change-Id: Ibd81d1640524980c0554a5d0ddc41b96ecd7f73f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 20:54:59 +00:00
Jarek Kobus
7bd26571e4 DiffEditorController: Aggregate reloadRecipe
Instead of declaring virtual getter.

Change-Id: I0f9e995bdff1b7e387e71daaf149a3726b7c09af
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 08:29:04 +00:00
Jarek Kobus
5aedb4ba56 DiffEditorController: Simplify API
Get rid of VcsBaseDiffEditorController::setWorkingDirectory()
and rename DiffEditorController::setBaseDirectory() into
setWorkingDirectory(). Don't pass workingDirectory
inside setDiffFiles().

Change-Id: I6a3a02d5e3ddc23977ed2908cd8d7b8ed51a9ee0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 08:28:44 +00:00
Jarek Kobus
ce161d0b16 VcsBase & dependent: Fix const correctness
And some minor cleanups.

Change-Id: Id0c2df6865ba84c054f0fb97c0ac42a76a128355
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-14 16:57:14 +00:00
Jarek Kobus
042087ab1d DiffEditor: Simplify internals
Don't pass startupFile arg on every setDiffFiles.
Provide a setStartupFile() separate setter inside
DiffEditorDocument and call it directly from
DiffEditorController::setStartupFile().

Correct updateDescription() implementation.

Change-Id: Ie489431632bdabc61e2c692d09caf7b2e3990764
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-14 16:52:26 +00:00
Jarek Kobus
ac7a582ca9 FileListDiffController: Don't set startupFile()
We didn't do that before. We did it only for ShowController.

Amends cbcfc0242e

Change-Id: I6ba68bdb6b16204bcc66bdfd63bf7457c713ac28
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-14 16:51:36 +00:00
Jarek Kobus
c5668952ae GitBaseDiffEditorController: Simplify internals
Remove initialize() method and do it inside reloader method.
When reloader is being executed the workingDirectory is already
set.

Amends bfcd1149eb

Change-Id: I600daaff8d15f3bdb822789623947b31df0b7edd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-14 12:54:09 +00:00
Jarek Kobus
cbcfc0242e FileListDiffController: Reuse task tree
This makes it possible that staged and unstaged
tasks are run in parallel, so the result is to be
expected earlier.

Change-Id: I0b99d17a55e39f2178d6ebed208e29fbaaa8aa5e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-14 12:53:47 +00:00
Jarek Kobus
13c7283c0e GitBaseDiffEditorController: Remove interactive branch expansion
Branches are now being automatically expanded.

Change-Id: I6c8986f39fe0ceb71841a2fea46b6038123240b7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-14 10:22:00 +00:00
Jarek Kobus
85b645f144 ShowController: Make showing branches a part of show process
Change-Id: I23d994fd489fc6a6f02419452ad2b07c756a9cd3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-14 10:21:53 +00:00
Jarek Kobus
eef9cb458b DiffEditorController: Make it possible to setup task tree
Instead of reloader function. Use task tree for ShowController.
Make diff processing a part of task tree.

Change-Id: I732d0a14eaf8de7ce0d1be891fb4700b22ea24b7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-14 10:21:44 +00:00
Orgad Shaneh
72751a9b98 Git: Remove outdated comment
Missed in eb1226df68.

Change-Id: Ib5d6d11bdb563882a2a651b3e26a30f006af973d
Reviewed-by: hjk <hjk@qt.io>
2022-12-13 15:53:42 +00:00
Jarek Kobus
32e824c762 VcsBase: Don't return editor from annotate()
Take int firstLine as last arg instead. Switch the order of
3rd and 4th args as most callers provide lineNumber
and don't provide revision.

Change-Id: Iab60c1068a4d9829d10219af39bf3dcbf51e37bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-11 11:15:15 +00:00
Jarek Kobus
db85862a8c Git: Reuse handleResponse() inside vcsExecAbortable()
Remove ConflictHandler::attachToCommand().
Rename handleResponse() into handleConflictResponse() and
move it out of ConflictHandler class.

Change-Id: I0a64bd19f288d9377a93cdb5eea2c44b65bf6fdb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-10 18:40:30 +00:00
Jarek Kobus
305dc46902 Git: Add CommandHandler into vcsExecAbortable
Don't return VcsCommand anymore.

Change-Id: I895951e8bd8d380d7b946380628e41b928c9b743
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-10 18:15:49 +00:00
Jarek Kobus
8d7ced7d83 VcsBase: Get rid of CommandOutputBindMode
Simplify createCommand() implementation. All callers
passed either non-null editor (in this case the
bindMode was always NoBind) or passed a null editor and one
of two values for bindMode (in this case the only
effect was to add (or not) a RunFlags::ShowStdOut flag).

Drop CommandOutputBindMode enum completely and pass
directly RunFlags::ShowStdOut when needed (i.e. in cases
we were passing CommandOutputBindMode::ToVcsWindow).

Change-Id: Ic3af05818933a03f615ba02267403b9f0bd326ba
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-09 13:24:34 +00:00
Jarek Kobus
112835922a VcsBase: Reuse CommandOutputBindMode instead of bool
Reuse it inside vcsExec() and vcsExecWithHandler().

Change-Id: I6ff4044bf43e0883fc46a49718f5f44da87a7e13
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-09 10:29:51 +00:00