Commit Graph

19 Commits

Author SHA1 Message Date
Eike Ziller
1df8dd3c93 Revert "Revert "Use QtcProcess for clangbackend""
This reverts commit d65e47b5c6.
Reverts the quickfix for the performance regression of code completion.
Followed by a minimal fix.

Task-number: QTCREATORBUG-26829
Change-Id: I1afe71c24ee94caadd4fa849c29f6fc030fb1a8b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-01-06 14:34:35 +00:00
Cristian Adam
d65e47b5c6 Revert "Use QtcProcess for clangbackend"
This reverts commit 8724a4efbb.

The above commit made code completion 3-4x slower on Windows, and
8x slower on macOS.

Fixes: QTCREATORBUG-26754
Change-Id: I02424a40e10de2baf3fd01f19f9094c8e82f684a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-04 18:01:57 +00:00
Jarek Kobus
7958de05f5 Introduce Utils::Singleton
Introduce Utils::Singleton class and
Utils::SingletonWithOptionalDependencies class template
that helps implementing singletons that depend on other
singletons. It's guaranteed that whenever singleton B depends
on singleton A, than A is always created before B is being
created, and that the order of destruction is always
opposite to the order of creation.

Dependencies of singleton are listed as template arguments
for SingletonWithOptionalDependencies class template.
The first argument of SingletonWithOptionalDependencies
class template is always a singleton class itself.

Prepare a common interface for all singleton subclasses:
SingletonSubClass *SingletonWithOptionalDependencies::instance();

Make instantiating singletons and its dependencies thread-safe.

Create singletons on demand (only if some code needs them).
It's not needed anymore to explicitly instantiate
all required singletons in tests.

Make it possible (and thread-safe) to instantiate ProcessReaper
and LauncherInterface singletons in non-main threads.

Make the following dependencies between existing singletons:
   SshConnectionManager depends on:
-> LauncherInterface depends on:
-> ProcessReaper

Change-Id: Iefaacab561c2b3dcf07e7fafbb87339ea6a15278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 10:25:29 +00:00
Jarek Kobus
ace765c199 Move ProcessReaper into lib/utils
Reuse ProcessReaper inside process launcher.
Automatically reap all internal QProcesses of QtcProcess
(either direct child of QtcProcess in QProcessImpl
or indirectly inside process launcher).
Make ProcessReaper work again on QProcess instead of on
QtcProcess, so it may still be reused for non-QtcProcesses.

Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 21:28:19 +00:00
Jarek Kobus
8724a4efbb Use QtcProcess for clangbackend
Change-Id: Ifdcdba765409a09861f81dd3dff405115a986801
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-03 14:06:56 +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
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
7dc72c533e QmlDesigner: Improve imagecache
Instead of coding some arguments to extraId(state) we provide now a
std::variant there extra arguments can be saved. Because it's a
std::variant it can be easlily extended by new structs. There is a new
synchronous interface too. It has an extra method for QIcon which saves
icons in an extra table. It would be even nicer if we would have a
mipmap image too. So we could do it asynchonously too but so far it works
only in the main thread.

Task-number: QDS-3579
Fixes: QDS-3584
Change-Id: If368d84d82308a91a5f4f037021e749c9ef868ed
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-01-21 13:14:28 +00:00
Marco Bubke
d1d95e78d6 UnitTests: Fix double deletion
Change-Id: Id28f739a3f6b0c200386edf67914886ae06e2999
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:41:54 +00:00
Marco Bubke
2ee63af4cd UnitTests: Setup an environment for every test run
So there are no old file an temporary file.

Change-Id: Ida22703b5842b094f9a0f26562cd0908542e044f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:34:18 +00:00
Marco Bubke
a61eff0079 Sqlite: Add session support
Session are captured by hooking in the sqlite changes. They are saved in
blobs and containing inserts, update and deletes. Because the are
semantically coupled to translactions we add a

Change-Id: Ie095558ebc50601fcaae32958ebeeb98b72d73b9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-05 09:52:42 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
Marco Bubke
b1bb6d9641 UnitTests: Fix ODR problem for print functions
You have to include them for all translationunits because otherwise default
print function are generated. So you get to different implementations for
the same symbol.

Change-Id: I732d2e1f1774f72acdbb49cbe1848d31ca3f5c98
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-12-11 11:56:21 +00:00
Marco Bubke
2382824d7b UnitTest: Fix google benchmark
Change-Id: I3ea223c161d49c2f78751c07916398682b70767c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-10-26 11:25:27 +00:00
Marco Bubke
3dcce060b2 Sqlite: Cleanup Sqlite
We don't need the threading anymore, so we removed it. The indexer
will be run in its thread anyway, so an extra thread makes the code
only more complicated. And we added namespaces.

Change-Id: Ibcba306324763285cf653c28bb08122345e5f8da
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-27 09:14:30 +00:00
Marco Bubke
a5e96dbd99 Clang: Work around missing file
We now generate an empty fake file.

Change-Id: I92fef2b24dce788c1d1b675b034d4b31346b80d9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-21 08:25:47 +00:00
Nikolai Kosjar
340063c624 Clang: Use Utils::TemporaryDirectory
Task-number: QTCREATORBUG-17401
Change-Id: Ibf6007455ec92b1d9fcac17e1f3b5e2af21b7438
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-02-13 15:21:04 +00:00
Marco Bubke
47c01daeb2 UnitTest: Cleanup
Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:17:54 +00:00