Commit Graph

530 Commits

Author SHA1 Message Date
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
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
Jarek Kobus
f84199f8b7 Solutions: Long live Solutions!
Short live Tasking in Solutions!

Add src/libs/solutions/README.md with the motivation and hints.

Move TaskTree and Barrier from Utils into Tasking object lib,
the first solution in Solutions project.

Tasking: Some more work is still required for adapting auto and
manual tests. Currently they use Async task, which stayed in Utils.
For Qt purposed we most probably need to have a clone of
Async task inside the Tasking namespace that is more Qt-like
(no Utils::FutureSynchronizer, no priority field,
global QThreadPool instead of a custom one for Creator).

Change-Id: I5d10a2d68170ffa467d8c299be5995b9aa4f8f77
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 06:29:03 +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
867b10a06b Remove unused includes of QFutureInterface
Change-Id: I70f5e842801b628c7f9ad4d433334ce04d4e648e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 06:50:36 +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
187a7640de Tasking::Async: Rename Async into AsyncTask
Rename Utils::AsyncTask into Utils::Async.
Rename AsyncTaskBase into AsyncTask.

Task-number: QTCREATORBUG-29102
Change-Id: I3aa24d84138c19922d4f61b1c9cf15bc8989f60e
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 12:47:28 +00:00
Jarek Kobus
c67dc5e8d4 All Plugins: Use global future synchronizer
Instead of using plugin's own synchronizers. The global
synchronizer does the synchronization just before all the
plugins' destructors run (in sync), so this should be
the right equivalent.

Change-Id: I8d09c9ea4a11b7a703684ad5319191ce310d992e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-25 13:45:39 +00:00
Jarek Kobus
90c09c65f9 DiffEditor: Fix jumping to context line immediately on git show
Fixes: QTCREATORBUG-29081
Change-Id: I7a4658209f95e98cb485e725dee07074dae5c163
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-04-24 08:26:22 +00:00
Jarek Kobus
40b0f670e1 DiffEditor: Don't use QFutureInterfaceBase::get()
It's available only since Qt 6.3.

Amends 5ff073df19

Change-Id: I38c8c3b0bc3c94612dee15614f00e83ebc86db04
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-03-10 09:16:32 +00:00
Jarek Kobus
4fc891563a DiffEditor: Fix DiffEditor tests
Amends 5ff073df19

Change-Id: I4597453b057dfce41b73b4973205cba33d8e4a58
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-10 05:40:21 +00:00
Jarek Kobus
5ff073df19 DiffEditor: Use QtConcurrent invocation for async tasks
Change-Id: I06640837ffee830e60e8dd2a566f9388f8444010
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-03-09 11:53:18 +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
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
Christian Stenger
82d2f02c3f DiffEditor: Fix compile
Amends bf64af6f52.

Change-Id: I68cae9b6444156c9d4be3f54d09c3abd415fae91
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-02-06 05:51:25 +00:00
Jarek Kobus
77616b8086 DiffUtils: Get rid of PatchFormattingFlags
Get rid of PatchFormattingFlags argument inside
DiffUtils::makePatch(), as there is the only caller of this
method. Internally, behave like the GitFormat flag was passed.

As all callers to sideFileName() were always passing
AddLevel (GitFormat flag contained AddLevel), the flag is
not needed anymore.

Change-Id: I1993cfd7212f5f60a5bdb2c9e1e4317c3ecd91d7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-02-05 17:17:09 +00:00
Jarek Kobus
ebcd8bcd51 DiffEditor: Simplify DiffEditorDocument::plainText()
Change-Id: If7c1ab43f099bbbc573ba354668c56fee0eb55a5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-02-03 15:31:58 +00:00
Jarek Kobus
bf64af6f52 DiffUtils: Simplify file name formatting
Change-Id: I11857af58fe50dae7449a763663a8a3ba123d239
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-03 15:31:47 +00:00
Jarek Kobus
202b696677 DiffEditor: Fix a crash when "No difference"
It may happen that async task associated with diffing one pair
of files may not report any value. This happens when both
file contents are the same. In this case taking a result from
async task on a successful done will lead to crash.

Add AsyncTask::isResultAvailable() method. Use it in client code
just in case, where needed.

Fix DiffFilesController, so that no result is allowed for all
running tasks (i.e. make the main group optional).
Collect list of optional results instead of direct results.
The empty optional on the list means the result wasn't delivered
by async task and it's skipped.

Fixes: QTCREATORBUG-28750
Change-Id: I4ca678a187fad619bae470da3e806e8c8da61127
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-03 15:31:25 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +00:00
Alessandro Portale
16ec720537 DiffEditor: Tr::tr
Change-Id: I71b9908ea332256044120b42ff6af2fc57a89a5e
Reviewed-by: hjk <hjk@qt.io>
2023-01-19 15:32:29 +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
Jarek Kobus
a661dc5db4 DiffEditorPlugin: Avoid code repetition
Change-Id: Ie78bb992ff145a970e1cc03f59f228851fd43b08
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-12 13:44:51 +00:00
Jarek Kobus
1ef673cb2e DiffEditorPlugin: Remove unused includes
Some includes are not needed anymore after recent refactorings.
Inline simple constructors.

Change-Id: I1a4b192b8e6014a6af9ce9f87015fa10ee0ea33f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-01-12 12:38:11 +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
0f52acfe1c DiffEditorController: Remove unused stuff
Change-Id: Ie4d5b0b3bac3e46c5db647263757222979b982be
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 20:56:38 +00:00
Jarek Kobus
d59eca8577 DiffFilesController: Reuse task tree
Change-Id: Ia83cd81dc3dad671c7ec72cdffe882775c7e4508
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-15 20:56:04 +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
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
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
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
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
Jarek Kobus
1cdf29a1e6 DiffEditorController: Make setReloader() protected
Change-Id: I2c988794176aa2e234c15ae88c425f30c1726810
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-12-11 14:31:51 +00:00
Jarek Kobus
23f53dcbda MathUtils: Add tangential interpolation
Reuse it in TaskProgress and in ProgressTimer.
Rename MathUtils::interpolate() into interpolateLinear()

Change-Id: Iff4cda1e3b8782cd26277ec75046ca5526be92c0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-28 10:07:30 +00:00
Jarek Kobus
6f299f19ac Utils: Move DiffUtils::interpolate into MathUtils
Change-Id: Iac4a21a6c760d8fbf0dce380b1a9a587a9d3468e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-28 10:07:18 +00:00
Jarek Kobus
b414268427 DiffEditor: Use AsyncTask
Change-Id: Id5b21b10c7a8805b560eb4fb36fd955b7af34afa
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 16:12:46 +00:00
Jarek Kobus
3caf82f746 Remove unused includes of Q[H/V]BoxLayout
Change-Id: Ia90b30b634281414268e00722771470f1e7b69c0
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>
2022-11-18 15:29:06 +00:00
Jarek Kobus
d81abf1fb4 DiffEditorPlugin: Expose plugin's future synchronizer
Change-Id: I208a0e6b9c9776486972177f845e76d33121a2a3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-09 17:47:02 +00:00
Tim Jenssen
aa33927651 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertychangesmodel.cpp
	src/plugins/qmldesigner/components/stateseditornew/propertymodel.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.cpp
	src/plugins/qmldesigner/qmldesignerprojectmanager.h

Change-Id: Ib029a830ee99190bc4ea2ad75d9300bfa86b42d9
2022-10-25 19:02:15 +02:00
Orgad Shaneh
bf0d2426b8 DiffEditor: Persist description widget height
Fixes: QTCREATORBUG-24286
Change-Id: Ie1bf1136bce973b7197b7378b48a85ec776e8f6d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-24 07:00:50 +00:00
Jarek Kobus
243f66f97d UnifiedDiffEditor: Fix indent visualization
Add TextEditor::setVisualIndentOffset() protected helper.

Change-Id: I0755a732d07dec651c090dd6afd87d293453f0e1
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-10-21 07:38:04 +00:00
Jarek Kobus
3c9303c3b9 SideBySideDiffEditor: Synchronize left and right foldings
Change-Id: I2ff13db98981edf17190870c4d3ecea0113c8f3e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-21 07:37:54 +00:00
Jarek Kobus
d0278ae295 SelectableTextEditorWidget: Handle display settings
Avoid code repetition inside UnifiedDiffEditorWidget
and SideDiffEditorWidget.

Connect to display settings changed signal and apply
all but 4 settings (which are not desired for diff editor).

Change-Id: If4ae7f7c55690dac04fd1a00f8822db666a9ce2b
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-10-20 09:19:07 +00:00
Orgad Shaneh
f696d1e6cf DiffEditor/VCS: Save document before applying/reverting patch chunk
Fixes: QTCREATORBUG-22506
Change-Id: I646f24068c0c81890f36052537320a743fdeb498
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
2022-10-19 09:31:48 +00:00
Jarek Kobus
161fb4c440 UnifiedDiffEditor: Fix never ending spinner when no difference
Change-Id: If0d646c760cdc8c9fb8e2481a7798eed925681b6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-13 13:21:40 +00:00
Jarek Kobus
693db6eef6 UnifiedDiffEditor: Fix '+' on added lines
Amends 15fd4a0754

Change-Id: If74b5437be241303de1e157b7980ef10ef6c060c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2022-10-11 14:34:25 +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