Commit Graph

2901 Commits

Author SHA1 Message Date
Jarek Kobus
7ab95906b9 TaskItem: Move enums outside of TaskItem
Change-Id: If8a2b285bf9d9bd5a5b7222c13772c1a873daf23
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-17 15:07:59 +00:00
Jarek Kobus
a4b7e10861 TaskTree: Implement simple progress reporting
The progressMaximum is the number of tasks in tree.
The progressValueChanged signal is emitted whenever task is done
(advance by one) or when some number of tasks were skipped or stopped
due to workflow policy or dynamic setup group handler.

Change-Id: I403059a6466ae0534ef647c3c1c61c0318f10325
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-17 15:07:47 +00:00
Jarek Kobus
e38db06203 TaskTree: Add taskCount() getter
Will be helpful when implementing progressMaximum.

Change-Id: I9204b53425054a01c96f3b926b595f7888f81e3a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-17 15:07:34 +00:00
Jarek Kobus
234b3d1e6f TaskTree: Add DynamicSetup handler for groups
DynamicSetup enables finishing group (with Done or Error)
immediately before the group was even started.
The handler is invoked dynamically, just before starting
the group. The handler may also allow for running only
selected children and omitting others, so it may serve as
dynamic condition or dynamic multiplexer. This can be achieved
by modifying QSet<int> childrenToRun field inside returned
GroupConfig and setting the policy to ContinueSelected.

Change-Id: I15bddbb866a89ae9f783c59cc4bca89dd6a81c75
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-17 15:07:22 +00:00
Christian Kandeler
953000b981 CPlusPlus: Add new usage tag "Template"
For use in follow-up patch.

Change-Id: I49c057280be9b09862a89fa385a7396f1b1093bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-17 15:02:09 +00:00
Tim Jenssen
213d60ad64 Merge remote-tracking branch 'origin/qds/dev'
Change-Id: I74bf2bfb1eacb60675640c47eb41ce51dd6eb99f
2022-11-16 18:22:59 +00:00
Eike Ziller
ae67799eb3 Merge remote-tracking branch 'origin/9.0'
Change-Id: I2123e09f75199a63af6e8505fb8889e7f9d025d2
2022-11-16 09:40:34 +01:00
hjk
ef658663aa Utils: Remove internal /./ relative path marker
Some creeped into settings earlier, making the paths that were
meant to be empty look non-empty.

Also add a test for FilePath::isEmpty().

Change-Id: I99e3dd673294206558f9fee9b7c7874d2441327e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-11-16 07:23:46 +00:00
Eike Ziller
3f0f9a63c0 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/clangcodemodel/clangdcompletion.cpp

Change-Id: Iaa92bf057d7696d2da10802ff95e80863f3235d8
2022-11-14 15:26:20 +01:00
Christian Stenger
a6774dbad5 Tests: Fix dumper tests on macOS
Change-Id: I7827245017c285ff7c9eb4799a7b340061f3c4af
Reviewed-by: hjk <hjk@qt.io>
2022-11-11 14:28:00 +00:00
Eike Ziller
f147ef73eb Fix compilation of tasktree tests
Change-Id: Id20b581c53cc4f55735b4047bd9ba723b0e370da
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-11-10 12:47:33 +00:00
Christian Stenger
7205ff6c25 Tests: Fix compile with Qbs
Amends c49de14c9d.

Change-Id: Ife37f6763b9039a46d63a7f1b4ef16fd0e787d01
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-10 05:52:20 +00:00
Jarek Kobus
c49de14c9d Utils: Introduce TaskTree and Tasking namespace
The TaskTree class is responsible for running async task tree
structure defined in a declarative way.

Change-Id: Ieaf706c7d2efdc8b431a17b2db8b28bf4b7c38e5
Reviewed-by: hjk <hjk@qt.io>
2022-11-09 17:06:31 +00:00
Jarek Kobus
a8801eff5f ProcessTestApp: Make setupSubProcess const
Change-Id: I1dd45baebb32135cba6a35040d8e87a0bcc5d3ac
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-09 07:21:51 +00:00
Marco Bubke
77e49a954e QmlDesigner: Workaround strange superClasses behavior
superClasses() return not only the super classes but the type itself. We
should later fix that and introduce something like prototypes().

Change-Id: Ied9c1edad40754cb995bfb26b8d65b0aa3d17753
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-11-08 14:04:53 +00:00
Christian Kandeler
3e3569f6dc CPlusPlus: Add more usage tags
To be used in subsequent patches.

Change-Id: Id7140aa39bb2adba343cc12b0273c90f3c12abeb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-07 13:24:58 +00:00
Christian Kandeler
d891e18edc CPlusPlus: Make Usage::Type QFlags-based
We want to extend the enum with more non-exclusive values.

Change-Id: I4d8ebe1f7327139c7817b9f621b4b74a883c5e09
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-07 11:33:33 +00:00
Marco Bubke
f51162a3fe QmlDesigner: Improve ownership of QmlProjectItem
Change-Id: Ibfe4b0b5314dada85a601a8f27003af135df78f1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-11-03 12:58:21 +00:00
Marco Bubke
2bbae7d499 QmlDesigner: Detach views outside of model destructor
modelAboutToBeDetached can still calling the model. So calling the
function from inside the model destructor is a little bit undefined. To
get around it we add a custom delete which call the detachAllViews()
before it deletes the model.

Change-Id: I38ff8283f4e1ac48b256aeb9fd5bb9f3fb6bfed1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-10-27 14:48:31 +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
Christian Kandeler
13f40f5471 Utils: Add sorted() function
For simpler calling code.

Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 14:29:45 +00:00
Jarek Kobus
866a658b42 Get rid of unneeded includes of RunControl
Removed also some other includes that were marked
with yellow triangles. In some cases includes of
runcontrol.h were substituted with other includes,
like qtcassert.h.

Change-Id: Ica40f68198c7f8f70e6047acb2eddc8ef017e43d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-25 09:49:13 +00:00
Christian Kandeler
8662470aba CPlusPlus: Allow " = default" also on function implementations
Note that we only make sure not to trip over valid code; we make no
effort to check whether default/delete is actually allowed at this
type of declaration.

Fixes: QTCREATORBUG-28102
Change-Id: Ic693319b9dfaf8652cf4cae9cd907a6e258ad773
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-10-24 11:43:21 +00:00
Marcus Tillmanns
3ac5051af9 Utils: Fix FilePath::fromString host decoding
Previously FilePath::fromString did not decode %25 (%) and %2f (/),
so a round of ::fromString(::toString()) would not return the same host.

Change-Id: I99c7317fb149443c2e52c099f7da7c4ef6768aff
Reviewed-by: hjk <hjk@qt.io>
2022-10-20 06:45:42 +00:00
Marco Bubke
c2208fecfd QmlDesigner: Rewriters parses immediately
The rewriter needs to parse the file immediately and not use the timer.

Change-Id: I6399edc23201d301dcb7d8d33d1bd956dd087b4c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-10-19 11:14:41 +00:00
Marco Bubke
d554bf5e2a QmlDesigner: Remove check if setIdWithoutRefactoring throws
We don't throw any exception anymore in that case.

Change-Id: I881f22b560081beff6a6275783061228e64cbb28
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-10-19 11:14:28 +00:00
Marco Bubke
4e72e0fd27 QmlDesigner: Improve defaults of external dependencies fake
Otherwise we get rewriter errors.

Change-Id: I0ce712bc3a473fec88afc4cc59ff6b5ad4828cf1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-10-19 11:14:09 +00:00
Orgad Shaneh
7edf743583 Merge remote-tracking branch 'origin/9.0'
Change-Id: I5e6cfc111941f9609285e1b802121644fa8cdaac
2022-10-19 09:12:14 +03:00
Eike Ziller
3bdb1a3edf Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/vcsbase/vcscommand.cpp

Change-Id: I2d33113bfb2ea7134550cda1de4e2c21e6711778
2022-10-18 16:51:36 +02: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
Marcus Tillmanns
a22d62e57d Utils: Add FilePath::isSameFile()
FilePath::isSameFile() checks if two files are the same file.
It first checks if its on the same device. If it is, it will
try to read the fileId of the files and compare them.

Change-Id: I83668955cacd4e5ed03d43a3fee2be29e9d0a6f0
Reviewed-by: hjk <hjk@qt.io>
2022-10-13 11:25:48 +00:00
hjk
1fa3255242 Utils: Split off file access interface from IDevice
The file accessing functions form now a class hierarchy by themselves,
the devices return a suitable point.

The previous implementation was mildly confusing by the special handling
of the DesktopDevice, fallbacks and remote cases in the same function
leading to unnecessary boilerplate when adding new functions and
codepaths that sometimes passed the FilePath API twice.

Implemented are a "DesktopDeviceFileAccess" taking care of the
previous !needsDevice() branches and a "UnixDeviceFileAccess"
covering the current docker and RL uses.

As a side-effect this unifies to a large degree the current docker
and RL code paths with were occasionally deviating from each other
while they shouldn't.

Change-Id: I4ff59d4be2a07d13e2ca5e9ace26a84160a87c9d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-10-13 10:38:35 +00:00
Marco Bubke
ba891e7f34 QmlDesigner: Prevent calling the node instance view directly
Views should not write to the node instance view directly. Instead they
should use the model for manipulation.

Change-Id: I3941cc691addab939b8032952230cbe03951730b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-12 16:29:56 +00:00
Marcus Tillmanns
271c9055f4 FSEngine: Add filePathInfo devicehook in tests
Change-Id: I50b87e213d8c83fa8d126662655681416c1cbe4e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-12 09:36:14 +00:00
hjk
b1471fe61f Utils: Combine some of the iterateWithFind overloads
Change-Id: I668447d0049f2e35cd0c76d2c5708779196167ec
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2022-10-12 08:59:32 +00:00
Orgad Shaneh
0793184956 Merge remote-tracking branch 'origin/9.0'
Change-Id: I2e11bfba622c14578f08ca988ad98dab97cb385b
2022-10-11 17:46:50 +03:00
Jarek Kobus
c50891611a FilePath: Fix absoluteFilePath to behave like absolutePath
Change-Id: Ibb2cba32c40ec9febab5f20c78156481525c8904
Reviewed-by: hjk <hjk@qt.io>
2022-10-11 14:33:35 +00:00
Jarek Kobus
ecd9053587 tst_qtcprocess: Remove 30 seconds timeout overload
The default is 60.

Change-Id: I22585a62648376c771f6f3e4165dc4a1bef25892
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-11 07:34:39 +00:00
hjk
2e38cb6848 Utils: Add an offset parameter to the content writing FilePath function
Use QFile::seek to implement locally and a dd seek based poor man's
implementation on RL and docker.

Change-Id: I241d1c34c00e991845d132ad8edefa1377ba1311
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-10 16:08:28 +00:00
Eike Ziller
7efb0a0625 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/qmldesigner/CMakeLists.txt

Change-Id: I500420df35519e6903abc570d1283185f01bf900
2022-10-10 11:47:45 +02:00
Jarek Kobus
77a140c581 QtcProcess: Introduce TextChannelMode and textOnChannel signals
This is alternative to setStd[Out/Err](Line)Callback()
methods. In this way there may be many clients connected
to textOnStandard[Output/Error]() signals. This should
also simplify handling the lifetime of user callback.

Change-Id: If82baa1f3f9c432ed431926619b9bbf11d770a84
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-10-10 09:47:06 +00:00
hjk
5dde520a43 Utils: Return a bit more data from DeviceShell::runInShell
Pass on stderr data and exit code to the caller, it's typically
in a better condition to handle errors.

Use it to notify the user about non-available 'find' arguments
and fix the fallback to ls-based operation.

Change-Id: I535535de2ffa09cad1dd6e9b07eb69f807dbae2f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-10-10 08:39:55 +00:00
Eike Ziller
ce9da99528 FilePath: Fix isRelativePath for QRC paths
Implicitly fixing methods like absoluteFilePath too.

Fixes e.g. JSON wizards that are registered from a plugin QRC file, like
McuSupport wizards (run with McuSupport plugin enabled and create a
"Application (Qt for MCU)" application).

Change-Id: I296ba1c5eb63c9eb27f9a55e65019125faf546ea
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-10-10 06:14:44 +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
Marco Bubke
78cf5051f5 QmlDesigner: Merge cmake files
To improve testability external dependencies are now broken with an
interface. It is a first step to test individual units without injection
of source files.

Task-number: QDS-7571
Change-Id: I4255c8668022f1097947e4ea5788f2a6b605365d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-10-07 13:15:41 +00:00
hjk
23e96dd6fe Utils: Use a single QString as data store for FilePath
Plus a few integers to get access to the pieces.

This reduces sizeof(FilePath) from 72 to 32.

Change-Id: I65eb856ad47b6a250c705d8d01893781a21d8e02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-10-04 07:27:16 +00:00
Jarek Kobus
f65c42c797 Various plugins: Limit the usage of std::make_pair
Make the code less verbose.

Change-Id: I22ceb8d74567d78042f537b185f8e504227c24c6
Reviewed-by: hjk <hjk@qt.io>
2022-09-30 13:37:52 +00:00
Christian Kandeler
7b9fec2aa8 Debugger: Remove CMAKE_INCLUDE_CURRENT_DIR from autotest project file
Not needed.

Change-Id: Ia75cd0b70f2976a03948e7d8569027f6c0242344
Reviewed-by: hjk <hjk@qt.io>
2022-09-26 15:03:44 +00:00
Eike Ziller
4fd4b42f3d Fix FilePath::absoluteFilePath for default constructed file path
FilePath::absoluteFilePath() would consider an empty path to be
relative, and resolved it wrt the current working directory. That is
unexpected in the sense that QFileInfo::absoluteFilePath behaves
differently, and lead to a crash down the line when e.g. a diff editor
was opened when the current working directory is '/' (the default on
macOS when started with "open" or from Finder, Dock or Spotlight).

Make FilePath::absoluteFilePath() return and empty path if the input was
empty.

Change-Id: Ie0d4da50afa24134bd56505b2f4abcf382eee982
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-09-26 07:43:36 +00:00
Marcus Tillmanns
d97b2fd6f4 FSEngine: Add tests for reading/writing
Change-Id: If38d27933727d4af0b24758bdf1a58f5ea78fd1b
Reviewed-by: hjk <hjk@qt.io>
2022-09-23 11:19:35 +00:00