Commit Graph

10 Commits

Author SHA1 Message Date
hjk
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
Christian Kandeler
b6adaab3ea CompilationDatabaseProjectManager: Fix flags extraction
The code would blindly remove all "options" starting with /, which meant
that all file paths arguments got lost on Unix-like hosts.

Fixes: QTCREATORBUG-22949
Change-Id: I43e2b1e57ed0e9ced9da8fa46d98d9ac25f83d13
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 10:20:38 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Christian Kandeler
25ff15a1fb Add convenience functions for creating ProjectExplorer::HeaderPaths
Change-Id: I7b1f63caca6b70ba4ec1b1870b83cbf20aa6564a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-30 10:46:56 +00:00
Christian Kandeler
a952500e90 CppTools: Use only const pointers for ProjectInfo and ProjectPart
All members were already const, but this makes it clear at all points of
use that these data structures are immutable.

Change-Id: Iea615c090bde462c445d15223caccc561b0c713d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-27 10:53:54 +00:00
Christian Kandeler
33108795d6 CppTools: Turn some classes into pure value types
ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers
to Project and/or Toolchain, even though they were used in contexts
where these pointers were either unsafe to access or not guaranteed to
be valid anymore, which made their use difficult and error-prone.
We turn these classes into pure value types by copying in all relevant
information before the first async operation takes place.

Fixes: QTCREATORBUG-25678
Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-13 12:35:49 +00:00
Christian Kandeler
da588b7cc4 CompilationDatabaseProjectManager: Move tests to plugin
Change-Id: Ife4ee68cdbd1560830f294610f8fab40653a4f5b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-22 07:45:19 +00:00
Christian Stenger
505401a7d4 CompilationDatabasePM: Be more verbose inside test
Makes it easier to understand what is failing.

Change-Id: I23140641a796150aa97f02c514c0ccd8e7623f51
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-12 10:03:29 +00:00
Ivan Donchevskii
b991e0ca95 CompilationDatabase: Fix few bugs and plugin tests
- do not convert the DOS path if it does not exist
 - pass the proper flags to addDriverModeFlagIfNeeded
 - reset the kit toolchain before picking the matching one
 - do not show the popup when running plugin tests
 - clang++ contains 'g++' but it's not a gcc compiler

Change-Id: Ia5018a2131bb123202b87e34e0ac3a79f0feb45d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-26 08:34:11 +00:00
Ivan Donchevskii
f604c8a77c CompilationDatabase: Support both code models
Extract headers, defines and fileKind from flags in
order to have complete project parts.

Side-effect: better support for MSVC-specific flags.
Change-Id: Iaa1413c91c96c3cf89ddbe76a7a1f0f46c5289c0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-01 14:52:05 +00:00