Commit Graph

24 Commits

Author SHA1 Message Date
Marco Bubke
98cba6e50c QmlDesigner: Improve file status cache
It is caching the file size now too.

Task-number: QDS-4788
Change-Id: I5cb816b8359bf3d2ef372ea319ce5920d9e0e4e9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-16 15:23:10 +00:00
Marco Bubke
4ebc0f5078 QmlDesigner: Add file status support to the project storage
Task-number: QDS-4785
Change-Id: Idaadf6992fad938e3620169a415f9d3cf7b9927f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-16 15:23:04 +00:00
Marco Bubke
19a30631af QmlDesigner: Improve support for explicit type names
Explicit type name ids are now saved as negative ids into the database
so they can be distingished by that 'flag'. For types we now use imports
and not anymore import ids. The resolving of the imports are done
internally to enable atomic synchronization.

Task-number: QDS-4662
Task-number: QDS-4725
Change-Id: Ia59763ec5578baec84f3c81fa1fd35ba075b8d84
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-16 12:25:00 +00:00
Marco Bubke
3ed4c8dd05 QmlDesigner: Remove document imports for deleted documents
Task-number: QDS-4724
Change-Id: Ie5ec1788387c224b48380fa0f256b012f2b7dbcf
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-29 12:16:11 +00:00
Marco Bubke
a98d2a6770 QmlDesigner: Imports updates are source id aware
Imports are now only updated for their source id. The source id is now
used as import id too.

Task-number: QDS-4724
Change-Id: I12988e9c19746291bbc26d5c80fc7dfdd33528e9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-26 09:46:55 +00:00
Marco Bubke
1ba8899749 QmlDesigner: Atomic synchronize
Merging the synchronization function into one function. This is needed
to exclude inconsistent states of the database.

Task-number: QDS-4715
Change-Id: I9915726d78d81a471c0494c584f141f011714c39
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-26 09:46:37 +00:00
Marco Bubke
3591735293 QmlDesigner: Detect alias cycle
An exception is thrown if an alias cycle is detected. This prevents that
the designer would get in an endless loop.

Task-number: QDS-4682
Change-Id: Iffbfb42d7334aa2a5490fe2830b5cfab8c8e627a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-26 09:46:04 +00:00
Marco Bubke
15f44db84c QmlDesigner: Support recursive aliases
So far we push changes up to aliases. But because we have recursive
aliases we have to separate different phases off the declaration and
linking. First we simply declare. Later we set the alias ids and then we
can find out the alias property types. To minimize the changes we stick
to the push model.

AliasPropertyDeclaration was merged into PropertyDeclaration so that
Sqlite::insertUpdateDelete can be called on one sequence. This prevents
inconsistent states as aliases would be changed into properties and vice
versa.

Task-number: QDS-4654
Task-number: QDS-4711
Change-Id: I8459ab07fd6b30efa19cfd4bc335286a039a511f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-26 09:45:50 +00:00
Marco Bubke
a30775a19e QmlDesigner: Prevent prototype chains cycles
A cycle would lead to an endless loop. So we throw an exception for
synchronization. Maybe we can add later more information to user so
he can easily resolve the error.

Task-number: QDS-4457
Change-Id: I83092ccdff030a610942c155571a0bfa899e808c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-15 07:05:00 +00:00
Marco Bubke
e9407c23fa QmlDesigner: Relink prototypes
Task-number: QDS-4552
Change-Id: Ibb0d0048c114e100c215493bc9d633d4dbe3c4e0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-14 10:44:57 +00:00
Marco Bubke
32fd70ce3c QmlDesigner: Handle more corner cases for alias relinking
Synchronization should always throw an exception if it gets in an
inconsitent state.

Task-number: QDS-4551
Change-Id: I8c55198115aa79b676a13fe0cd7ab225fb6723d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-14 10:44:52 +00:00
Marco Bubke
b1fcc4b7a0 QmlDesigner: Relink alias properties
There are still some corner cases but this will be done in follow-up
patches. The link information moved to the typenames table so only
indirections are saved in the propertyDeclarations table. Otherwise
the duplication would increase the database size too much.

Task-number: QDS-4551
Change-Id: I4aca85dd2d803b43aa9860183e500ced2d91141f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-05 12:40:49 +00:00
Eike Ziller
d23cf2cced unittest: Fix build on macOS
We are still using our own Utils::variant and corresponding functions
on macOS.

Amends 90cc7fed3b

Change-Id: I829bdd3a4cc03f994a825ee3a962d4eb523a3bf1
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-06-15 10:50:13 +00:00
Marco Bubke
3112d063e8 QmlDesigner: Update alias property declarations
Alias property declaration removal is now done before the normal
property declarations are synchronized.

Task-number: QDS-4525
Change-Id: Icddf5e041b672e4abfab89540906bbfdcc1a10ba
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-14 12:08:38 +00:00
Marco Bubke
66ba9c4843 QmlDesigner: Synchronize alias properties
Alias property declarations are handled like normal property declarations
except that the have an value for the target property declaration id.
So they are distinguishable by the alias id. If it is not set it is a
normal property declaration. If it is set it is alias property
declaration. Alias property declaration are always synchronized after
all normal property declaration are synchronized. This synchronization
is not checking if the target property declaration changed. This update
has to be executed by the target property declaration.

Task-number: QDS-4524
Change-Id: I483840c821e12c93f1be67bf5ed6da396f8b45a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-06-14 12:08:24 +00:00
Marco Bubke
90cc7fed3b QmlDesigner: Handle implicit and explicit type names
Types are now handled by their import. Impicitly by an import list or
explicit for exported type.

Task-number: QDS-4496
Change-Id: I63f40df32760389e25b73597b4363f95ee304592
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-14 12:02:44 +00:00
Marco Bubke
d3a91cd3a7 QmlDesigner: Use import in exported types
We can remove the version from exported types because the are
implicit by the import.

Task-number: QDS-4458
Change-Id: I4a259dff5e59537b72a57d7df95256a38d036e7b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:28 +00:00
Marco Bubke
f32207c930 QmlDesigner: Add importId to types
If we now try to synchrize to an inconsistent type model we get an
exception.

Task-number: QDS-4458
Change-Id: I86f7ce90d14b18227a66314fb341f5b528bdfb95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:23 +00:00
Marco Bubke
fc0668882d QmlDesigner: Add Import Synchronization
Task-number: QDS-4460
Change-Id: Icd419baa7881fe882539f10d335ab6b3d36bc7b5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:19 +00:00
Marco Bubke
029aecef1e QmlDesigner: Synchronize type
A type should not removed but all it's fields should be reseted. This
has the advantage that if you remove a file and add it again later the
id is stable.

Change-Id: I3a1f51e14195cff2fc39681acdf7072d1a2e4616
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:09 +00:00
Marco Bubke
da267946d9 QmlDesigner: Sync project storage
Task-number: QDS-4423
Change-Id: Ia99df711effff2909b0a57ecebfb386ca51165f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:19 +00:00
Marco Bubke
494469641a QmlDesigner: Move source cache types to their own header
The namespace is now Cache for that types.

Task-number: QDS-4306
Change-Id: I479f1ca534455a41de9dc1d6a1fd891e1d8973eb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:37:59 +00:00
Marco Bubke
019d948552 QmlDesigner: Move project storage to projectstorage subdirectory
We save their not meta info related data. So it is better we move it
their own subdirectory.

Task-number: QDS-4304
Change-Id: Ib99419e992fced93fb245a8c48e02ee256823def
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:32:12 +00:00
Marco Bubke
e4fea9f159 QmlDesigner: Add project storage
Task-number: QDS-4252
Change-Id: Ic74e027b20bc41f3712e3ae155cddc64f8972cb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:16:48 +00:00