Commit Graph

22 Commits

Author SHA1 Message Date
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +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
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
Eike Ziller
0777b65db3 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	src/plugins/android/androidconfigurations.cpp

Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
2021-08-26 11:09:08 +02:00
Cristian Adam
54c5322322 CppTools: Code model fix for C++20, MSVC, and newer CMake versions
Starting with version 3.20 CMake adds -std:c++20, which breaks the
code model when using MSVC.

Clang-cl 12 doesn't know about -std:c++20, but clang driver knows
about -std=c++20.

Fixes: QTCREATORBUG-26146
Change-Id: I696842e11b0a9ba8849455d2f81f8dde6dd95a27
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-20 15:28:57 +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
Eike Ziller
eaefcbd8f0 Use new, more evocative MessageManager API
At various places where semantics doesn't change.

Change-Id: Ib4d4a5c9f067e109126c6de88257f9e198a71447
Reviewed-by: hjk <hjk@qt.io>
2020-12-16 09:30:44 +00:00
Christian Stenger
6c5eaed92c Utils: Fix matching wildcards to full paths
Fixes: QTCREATORBUG-24792
Change-Id: I82b4edea6260b07e1bdff065b157a4cd044ec629
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-19 13:02:00 +00:00
Christian Stenger
feb873ca34 CppCheck: Replace QRegExp by QRegularExpression
Task-number: QTCREATORBUG-24098
Change-Id: I7b9198f3762f5fa753b5be0e1c0a81abc7f94560
Reviewed-by: hjk <hjk@qt.io>
2020-07-13 12:09:04 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
hjk
e109b731ad Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here.

Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-18 08:43:18 +00:00
Sergey Morozov
0aa95576c2 Cppcheck: Add ability to manually run cppcheck
Run cppcheck on selected files from current project via "Analyze"->"Cppcheck...."
Show results in a separate view in the same manner as ClangTools plugin.

Fixes: QTCREATORBUG-21673
Change-Id: Ibcaf4057a387a990f1da59025f15ba58f996953f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-12-04 18:15:41 +00:00
Eike Ziller
8452264a18 CppTools: Move QtVersion and BuildTargetType
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.

BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).

Removes dependency on ProjectPart from RawProjectPart.

Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-10 07:31:21 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Marco Bubke
a78655e521 Fix Utils::LanguageVersion::None handling
Change-Id: Id0d8bd59c1a317103ea309ee2f9b982ecfd6d6c7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-04 09:12:50 +00:00
Marco Bubke
5dbaf387ba Utils: Move C++ language details from ProjectExplorer to Utils
We want to use them in the backend processes too so it's nice to share them
in Utils. A concrete size was added too because they should be serialized.

Change-Id: Id5eb8f46643d5159f034fc9559f68a08d7e5847a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-15 10:37:03 +00:00
Nikolai Kosjar
6aa11eb75e CppTools/ProjectExplorer: Remove enum duplication
... between CppTools::ProjectPart and ProjectExplorer::ToolChain.

Change-Id: I8b448747e454adbed77547460383b8515462cc81
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-08 12:34:57 +00:00
Nikolai Kosjar
5900766ecb Toolchains: Detect unspecified language version
We checked the command line from the project manager for "-std=X" and
friends to figure out the language version to use. However, if such a
flag was not provided, we assumed the latest version we support. This
could conflict with the actual version of the compiler and its
predefined macros.

Figure out the version by inspecting __cplusplus/__STDC_VERSION__ in the
predefined macros of the toolchain. The MSVC compiler is an exception to
this, as it does not seem to properly set the value - check for
_MSVC_LANG if possible, otherwise simply assume some versions as before.

While at it, add also support for C17/C18 and the upcoming C++2a.

Task-number: QTCREATORBUG-20884
Task-number: QTCREATORBUG-21188
Change-Id: I464ffcd52d2120c0208275a050e82efda44fae1c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-08 09:07:56 +00:00
Sergey Morozov
f01ee04f4f Cppcheck: Kill current check process only when needed
Kill only if it processes specified files

Change-Id: I5dee99ec8aeaf3bf4d9dbf6aad195f54176170a2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-30 07:38:40 +00:00
Sergey Morozov
a108a912dd Cppcheck: Fix progress parsing
Change-Id: I14bc5b93b00fee25d9e307606c4fc7b30ca23fe8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-28 15:44:14 +00:00
Orgad Shaneh
7f2bbe9cfb Cppcheck: Reduce uses of auto
Conform to coding rules.

Change-Id: I57600bd450665d5db87710bb2444e39e7ecbf3e3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-09-26 10:02:32 +00:00
Sergey Morozov
31b595314c Cppcheck: Add cppcheck static analysis tool
Automatically checks currently opened documents and displays results via text marks/annotations.

CppcheckTrigger detects when to check files or clear results.
CppcheckTextMarkManager stores/clears text marks with checks' results.
CppcheckTool generates run arguments and parses output.
CppcheckRunner runs cppcheck binary.
CppcheckOptions configures CppcheckTool.

Task-number: QTCREATORBUG-20418
Change-Id: I8eafeac7af6137d2c9061ae75d4a56c85b3b5a2d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-09-18 19:07:12 +00:00