Commit Graph

1108 Commits

Author SHA1 Message Date
Eike Ziller
f83be6debe Merge remote-tracking branch 'origin/4.15'
Change-Id: Ia6558fc2423fd9cd84ca2282bfa60d102dff682e
2021-05-19 09:54:07 +02:00
Christian Kandeler
124b7ad911 Unit test: Fix build
Amends a13aef759e.

Change-Id: I07fbb52b741a765fc9aa92f4f4752890b581ed35
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-18 15:01:42 +00:00
Christian Kandeler
2182993b97 clangbackend: Add another exception to our "find real cursor" heuristic
Leave preprocessor directives alone.

Fixes: QTCREATORBUG-25692
Change-Id: I1c31f4120e9b86a58123f8877cebd354e800fb8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 11:44:49 +00:00
Christian Kandeler
3113b0e6d6 clangbackend: Fix token length calculation
This was broken for tokens with characters that take up more than one
byte.

Fixes: QTCREATORBUG-25715
Change-Id: Ic9842b960af8d6f12487f582b100cb2edcf48cc1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 08:35:32 +00:00
Eike Ziller
bf5b1d714c Revert "Revert "Merge remote-tracking branch 'origin/4.15'""
This reverts commit f0a86d4510.

Reverting a merge doesn't "undo" it - the changes would be lost
forever even with subsequent merges.
So we need to revert the revert to get the changes.

Change-Id: I65928f876f4dc886561bed17c4b2aa42b388c1e3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-05-07 09:07:40 +00:00
Marco Bubke
f0a86d4510 Revert "Merge remote-tracking branch 'origin/4.15'"
This reverts commit 888ca0dd20.

Reason for revert: wrong patchset

Change-Id: I1291789938601aaf606c59917ff938e3c24c78dd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-05-06 15:30:02 +00:00
Tim Jenssen
888ca0dd20 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/libs/sqlite/sqlitebasestatement.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp

Change-Id: I0fa0a8a7feffed24c0d2bc26eca86590f1156755
2021-05-06 13:07:48 +02:00
Marco Bubke
1618937637 Sqlite: Use config.h instead of setting everything in the build files
Change-Id: Ia70a5e78475a8b8078276df03330060c8785bf90
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:49 +00:00
Marco Bubke
f8647ec428 Sqlite: Enable SQLITE_DEBUG for debug
Change-Id: I086dc07ae7672d1077f8469eccac5ce34d56c04d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:44 +00:00
Marco Bubke
81a36ac0ef Sqlite: Optimize the initialization
https: //www.sqlite.org/compile.html#omit_autoinit

Change-Id: Iaa91203be21f01a19235a9401cb4fa412eca8276
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:37 +00:00
Marco Bubke
8edbdd78ad Sqlite: Default column type to None
None has no type affinity. So it will not try to convert types to other
types like Numeric will do.

Change-Id: I5362a6d071459594619485b8b8a37b3f5ed12db6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:18 +00:00
Eike Ziller
b3a893e9b8 Merge remote-tracking branch 'origin/4.15'
Change-Id: I75ffc79eeb8d73296a2271a636fae48e35427947
2021-05-05 11:46:19 +02:00
Christian Stenger
c362df32ee Unittest: Fix writing CppTools.json in cmake build
Do not write additional garbage into the json file as this
will end up in a parse error.

Change-Id: I02783b5e94b016d35962ee5729d53bc218d42b42
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-30 08:18:08 +00:00
Marco Bubke
c4c3d4cc33 QmlDesigner: Remove findInSorted function
Using std::lower_bound is more generic and we have less code which
could lead to less bugs.

Change-Id: Iacf6ea550182b51a8d5dd6b18a92de68914f4df1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-27 10:26:03 +00:00
Marco Bubke
3862f67b8d QmlDesigner: Improve storage handling in StorageCache
Using an explicit class for the storage not even makes the code easier
to understand but enables the possibility of code optimizations too.

Change-Id: I9239919d3385ba1bf141c23bdc3013b6c1e624ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-27 10:25:58 +00:00
Christian Stenger
318b3f10ce Unittest: Fix build
Amends 8e352af0ec.

Change-Id: I8130996fa68d9a5fa4217a8db001745a0382f91b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-27 09:09:49 +00:00
Marco Bubke
c236a25339 QmlDesigner: Add storage cache
Task-number: QDS-4237
Change-Id: I7d587f615b5e26cc6014ea3a63dedd203fdd35eb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-26 14:52:24 +00:00
Marco Bubke
f69314b6ae Sqlite: Add range getter
Sometimes it is handy to return a range so you can break in a for range
loop. So you can now write:

for (auto [key, value] :
    statement.range<std::tuple<long long, std::string>>()) {
    values.push_back(value);
    if (value == Tuple{"foo", 23.3, 2})
         break;
}

for (auto [key, value] :
    statement.rangeWithTransaction<std::tuple<long long, std::string>>()) {
    values.push_back(value);
    if (value == Tuple{"foo", 23.3, 2})
         break;
}

It will only step over the statement to the break. So you don't fetch
not used values anymore. The second version will add a transaction
around the range.

But be careful. The range is view to the statement. Holding it longer or
reusing it can lead to strange behavior because the state of the
statement is changing.

Change-Id: I90191f7da5a015c7d8077d5bc428655a2b53246c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-26 09:42:40 +00:00
Marco Bubke
44b4c461ff Sqlite: Fix sqlite
Missed to remove the not anymore used ResultTypeCount.

Change-Id: Ia150e945bd650cc1e3d19fcb9426621d93fa16c3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-26 09:06:50 +00:00
Eike Ziller
3d1ad9db60 Merge remote-tracking branch 'origin/4.15'
Change-Id: I1d13f3543ab4bb17f0cbfe26bbea3f154f856ca6
2021-04-20 10:42:55 +02:00
Marco Bubke
5203c478a5 QmlDesigner: Add some useful iterator algorithms to NodeListProperty
Now there is iter_swap, rotate and reverse in the node list property. With
that methods we can implement slide too.

Task-number: QDS-4159
Change-Id: Ie7f80f64fd26e517ca696158a878262928dc82c4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 12:25:29 +00:00
Marco Bubke
2bf45ec998 Sqlite: Fix handling of blob and blob views
Change-Id: I90c31307ff3299975f820e191085ba93ed8afe0f
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-19 12:25:22 +00:00
Marco Bubke
040854c6f1 QmlDesigner: Add node list iterators
Task-number: QDS-4159
Change-Id: Ie6635d87beb66f766b9995f68972b80baa100ed6
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-19 12:25:15 +00:00
Marco Bubke
2e8e47622c QmlDesigner: Split nodeOrderChanged notifier
For swap we cannot provide all the arguments and they are only used in the
rewriter. So we use now a simplified notifier for all views except the
rewriter view. After the introduction of the new rewriter we can remove
the old notifier.

Task-number: QDS-4159
Change-Id: Idc91a618ea40da0bda9856888d115a84016597d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 12:25:02 +00:00
Christian Kandeler
f307c55eac ClangBackEnd: Fix mis-detection of operator<
Inside the body of a function template, clang reports a different cursor
type for operators in some cases. Make sure we don't mistake such
operator< or operator> as opening or closing a template, respectively.

Fixes: QTCREATORBUG-25596
Change-Id: Ifc357e199ea13e44ac501613639e667c333d48e3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-19 07:51:24 +00:00
Christian Kandeler
c80c724b52 ClangCodeModel: Fix template highlighting bug
We need to take into account that the ">>" in constructs such as
std::vector<std::pair<int, int>> is only one token on the clang side.

Change-Id: I90f002ca56f236032f6d39c338593a2ff7590061
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-16 07:02:19 +00:00
Eike Ziller
872660fcc5 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ibc60debb3c409ae27e99df6071cf6115b272d6d8
2021-04-15 15:48:30 +02:00
Marco Bubke
76bd140c7c UnitTests: Fix flaky test
ImageCacheGenerator.CleanIsCallingAbortCallback was not waiting for the
expected call.

Task-number: QTCREATORBUG-25580
Change-Id: I43265389a36e568dea7c7ece5524ef597232d049
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-15 12:05:20 +00:00
Christian Kandeler
b88b73d9c1 ClangFormat: Sprinkle some more magic pixie dust
Apparently, we can prevent clang-format from removing line breaks by
adding an empty comment at the end of the line.

Change-Id: Ia78ecb9e7351d059c544cbda11d33af5734e2218
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-12 09:28:55 +00:00
Eike Ziller
c0cfafdd3d Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I403b236c40d73a61ae22304e289e9d4374366395
2021-04-06 15:17:40 +02:00
Christian Kandeler
98012fb89d Unit test: Fix qbs build
Change-Id: I6046fe9b99e288dcd14a763bce9c337ab45c2eb5
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-30 11:15:09 +00:00
David Schulz
33359883f2 Fix qbs unittest build
Change-Id: Ifb7f564217921c9907dd7e300bc1c31ad7ae1536
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-03-30 10:25:00 +00:00
Marco Bubke
710b96cc89 Sqlite: Value can now handle blob too
This can be quite handy if we want to handle images in the database
dynamically.

Change-Id: I76b87d6b59e999b043bb2335192c90a371187431
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-30 07:30:08 +00:00
Marco Bubke
393c65e34e Sqlite: Use std::byte
Change-Id: Ie5bdbae67f7d0f9e533ad20ddb66d03057df2028
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-30 07:30:02 +00:00
Marco Bubke
7785a3a651 Sqlite: Move result count to class declaration
It move the magic number of column results to the sql statement
and improves the mock a little bit.

Change-Id: I101067444cf27ec5dea0c72de7fd484a7e8710f0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-03-26 12:24:37 +00:00
Christian Stenger
98ac237b7f Unittest: Rename test cases to reflect their content
Amends b746a3e562.

Change-Id: I96e37d31be7efc72533c767c882ffa62967e7a6c
Reviewed-by: Tom Praschan <tom@praschan.de>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-03-22 19:59:35 +00:00
Christian Stenger
b746a3e562 Unittest: Fix expectations
Amends 5fcd52fe83.

Change-Id: I68ce291176ab8e095b09ae6f0d64d2564e52cf0f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-18 10:49:48 +00:00
Eike Ziller
768d4321f9 Merge remote-tracking branch 'origin/4.14'
Change-Id: I214b8d59e8ff7fe0511cd6116ec7725ddc4376ee
2021-02-18 09:26:22 +01:00
Christian Kandeler
dfa24f09ad ClangCodeModel: Show only valid applicable overloads when completing
libclang is smart enough to filter the overloads according to which
arguments have already been entered, so let's make use of that.

Fixes: QTCREATORBUG-650
Change-Id: Ic2711f460c908c6fd9c8efe28c3c63a0ce2d9205
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 07:09:37 +00:00
Christian Kandeler
74177a559e clangbackend: Work around libclang cursor bug
... involving accessing the member of a nested anonymous union from
within the surrounding class. libclang reports a CXCursor_CXXThisExpr
for this location instead of a CXCursor_MemberRefExpr. However, the
latter is still locatable in the AST, so we can correct this.

Fixes: QTCREATORBUG-25342
Change-Id: I1eba13d5153205a52b3689d8ad52493a56b76c07
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-15 12:18:36 +00:00
Marco Bubke
e3d12e659a Sqlite: Add readTo method
There are cases when you want to read to an already existing container.
This will prepare for the RETURNING extension in the next Sqlite version
where you can write and read. That will simplify quite some code.

Change-Id: I740ffbedecf72bb5518392f3707a0a6b2221db56
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 10:39:45 +00:00
Marco Bubke
18fe4233f8 Sqlite: Add callback method
Sometimes it is better to have a callback instead of returning a container.
The call has to manage the state if an exception is called but otherwise
it will reduce the memory footprint. There will be to a RETURNING
to Sqlite which will read back values as you write.

Change-Id: I7eb49850e2c76f883a03277b31c5e713e9774c92
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-15 10:39:30 +00:00
Christian Kandeler
5f5f38e028 ClangCodeModel: Support "parentheses" matching for ternary operator
That is, show which ":" belongs to which "?" when the cursor is on one
of them.

Fixes: QTCREATORBUG-1410
Change-Id: Ie19360b3dfc82d92c264d99a5aa1864eda66e5c8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-11 08:52:17 +00:00
Christian Stenger
ced96a480d CMake: merge binary directories of sub projects
...into top level. Exceptions are applied explicitly.

Change-Id: I59c54967dffc0bef2e8cc05c73763fcf18c12517
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-05 14:09:12 +00:00
Marco Bubke
e34eb170dc QmlDesigner: Add an reason parameter to the image cache abort callback
Sometimes we abort the request, sometimes it failed. In the first case
we maybe want the cancel the imageprovider request, in the second we
return an empty image.

Fixes: QDS-3388
Change-Id: Iaef76aa09ac734795f86447e1a7cf6a5c7b5ae81
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-02-01 16:24:16 +00:00
Marco Bubke
62582877f6 QmlDesigner: Fix flacky test AsynchronousImageCache.WaitForFinished
Change-Id: I94afa8ec2925b85f5dbf44e7b2ad5db484f48148
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:23 +00:00
Marco Bubke
6a0cfc0c6e QmlDesigner: Fix flacky test ImageCacheGenerator.WaitForFinished
Change-Id: I7c08ec68d20a54e125805ad98f87879c99b1aad3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:19 +00:00
Marco Bubke
1cf09e5979 QmlDesigner: Compress generator tasks
A document change can generate new image request and if the are not in the
database new task for the collector are generated. But if there are already
tasks for an equal id they would generated twice. So the tasks are now
merged. The auxilialry data is not merged because it is expected that
it is not changing.

Task-number: QDS-3388
Change-Id: Id1aceb564dd9dc7c5a1ea5ae4680d7ee36611cda
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-01 16:06:13 +00:00
Christian Kandeler
11d1b8bb4c Unit test: Add missing switch cases
Amends d8c1e51bfe.

Change-Id: Ida799fdf3ac8da78c892f4f6823009a33b65340b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-26 09:52:53 +00:00
Eike Ziller
aae3bf4ef7 Merge remote-tracking branch 'origin/4.14'
Change-Id: I516e87eed1b716ec085095c9dd4f47f04a99de7c
2021-01-25 09:06:36 +01:00