Commit Graph

2291 Commits

Author SHA1 Message Date
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
Andre Hartmann
61fab0b736 Git: Fix instant blame text encoding
Fixes: QTCREATORBUG-28728
Change-Id: I875488badc84b664eaa1223b37657dcb417157de
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-30 12:32:03 +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
hjk
fa7dd2fd3b VcsBase: Convert to Tr::tr
To reduce the amount of duplicated strings for translators to handle.
The problem is not very prominent in vcsbase, but that's where we
are moving everywhere else.

Change-Id: Icb11fad3bccfea8a1408420e729566a75adccb66
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-18 15:33:59 +00:00
hjk
17b20e0622 TextEditor: Tr::tr
Change-Id: I28aa68e25c53c3a4d1c370074d7b3318944dc45a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-18 07:02:12 +00:00
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +00:00
David Schulz
baa1e3c2e1 Editor: Allow to hide annotations for a group of text marks
The hiding is not persistent, so on the next Qt Creator start all
annotations are visible again. This is meant to quickly get rid of
annotations if there are to many irrelevant of a specific kind.

Change-Id: I4862e56e0f5624f30aadda26efc9dea672ab1f57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-12 10:19:10 +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
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +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
850d5e6a06 GerritModel: Reuse ProcessProgress
Change-Id: I229ab2cbb8137b6e1debe86eaa462110fdcc337e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-04 18:16:36 +00:00
Jarek Kobus
330a748f17 GerritPlugin: Reuse ProcessProgress
Get rid of unneeded State enum, future watcher and future
interface.

Change-Id: Id217d557c9051479cd3da872c1661c163cdf3a21
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-04 16:40:24 +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
Orgad Shaneh
371e674967 Git/VCS: Use ctrlc stub for process execution
This ensures that child processes are also terminated.

Required specifically for Git on Windows, when running in cmd directory,
which spawns a child process for usr/bin/git. On this case, if git takes
long to finish and is aborted while running, the main process was killed
as expected, but the child process remained alive.

Task-number: QTCREATORBUG-27567
Change-Id: I40271eb42cfaefd81f2fe5af138254ab0a2c8da8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-12-15 11:34: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
Orgad Shaneh
038847709c Git: Suppress all output for instant blame
Change-Id: I5ad295cef22d0448f79d9187df85b582287b2835
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-12-14 11:54:05 +00:00
Orgad Shaneh
2119dd4397 Git: Do not show progress bar and the command on instant blame
Change-Id: I22d06d0359d82d086062be4990b51858754b9145
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-12-14 11:04:18 +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
Jarek Kobus
46213c82be GitClient: Simplify vcsExec
Get rid of editor arg.
Reorder last two args (to conform to vcsExecWithHandler).

Change-Id: Ia32757ac8b766640b76bef81f1b2e0f5efe4d48c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-09 10:29:36 +00:00
Jarek Kobus
0cdfac0cb5 GitClient: Introduce execWithEditor()
Change-Id: I3a7edde4b978cb8e99fe0020d69a0a5e3e09c0fb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-09 10:29:23 +00:00
Jarek Kobus
287a7c9268 VcsBase: Introduce vcsExecWithHandler()
Before, vcsExec() returned already started VcsCommand.
Later, callers of vcsExec() were establishing connections
to the retured VcsCommand::done() signal. However, when
process fails to start (e.g. because of non-existing
executable), the done() signal may be emitted synchonously
from inside VcsCommand::start(). In this scenario
callers of VcsCommand could miss the emission of done()
signal and connect to already finished command.

Instead, provide a vcsExecWithHandler() function which
takes a handler to be called when command finished.
In addition it takes the context object, too.
Don't return VcsCommand from vcsExec() anymore.

Change-Id: I2fb5fbe5d27632ea039c650d37e5d7d1b60cebc0
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-09 10:29:04 +00:00
Jarek Kobus
a6b17d127a VcsBase, Git: Don't use queued connections to VcsCommand
Otherwise, the destructor of VcsCommand could have been
executed in meantime (since it's invoked automatically
after done()) and we might access invalid pointer to the
command inside the done handler.

Change-Id: I031e2281952451d4e01c47f437097a1e7bf8899f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-08 20:54:49 +00:00
Jarek Kobus
533d969735 GitClient: Remove unused connectRepositoryChanged()
It wasn't implemented, neither.

Change-Id: Ic6cdf70e10b232d326dcc936337a38488adca0ac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-08 20:54:32 +00:00
Jarek Kobus
b67201c410 Git: Simplify ConflictHandler
Don't create QObject instance when handling conflicts.
Operate on static functions only.
Replace destructor of ConflictHandler with finalize() method.

Change-Id: If579edc6213faa50c73a90cedf4b67cf985478ac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-08 13:46:59 +00:00
Jarek Kobus
c021fb5179 Don't call non-const methods on temporary QList
Otherwise it may unnecessarily detach. Either store a local
const reference or call const equivalent (e.g. constFirst()).

Change-Id: I96d665487cf28c17e72bea17f1b8f164ce06cc70
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-08 10:21:57 +00:00
Jarek Kobus
0313470db0 VcsBase: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: I20e43625793401544e86efb627f5921c395026bb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-07 21:54:39 +00:00
Andre Hartmann
8e5c84e3dd Git: Disable instant blame for modified files
Change-Id: Iae24a8bbcbdb3663367ee863e8cc27ad92942e17
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-28 14:37:11 +00:00
Orgad Shaneh
a2baeea394 Git: Enable instant blame only if current file is managed
If the current project is Git managed, but the user opens a header from an
unmanaged directory, don't try to run blame.

Change-Id: I563f7a687b2ea03f4c03bf97c8f5c27c1f8411ec
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2022-11-22 16:43:36 +00:00