Commit Graph

25 Commits

Author SHA1 Message Date
Jarek Kobus
a70cb04bdf AutotoolsPM: Hide MakefileParser in cpp
Provide parseMakefile() global function instead.

Change-Id: Id2eebfb491f57f43ea0c98cec63de491fdfb9ea0
Reviewed-by: hjk <hjk@qt.io>
2024-07-15 14:34:26 +00:00
Jarek Kobus
1d3de2b5be AutotoolsPM: Make MakefileParser cancelable
Change-Id: Iccd3c54c401433b82f567cfef281a0043af2efff
Reviewed-by: hjk <hjk@qt.io>
2024-07-15 14:12:36 +00:00
Jarek Kobus
931cc6820a AutotoolsPM: Replace QThread with TaskTree
Don't create a permanent thread for just one parsing.
Use TaskTree with async recipe instead.

Change-Id: I8eef0082c5d39a45fb0d8751c632ba02a955faef
Reviewed-by: hjk <hjk@qt.io>
2024-07-15 13:42:20 +00:00
Jarek Kobus
9616254534 AutotoolsPM: Inline updateCppCodeModel()
Change-Id: I68885dda050f7942165da74e8011a25bcc075530
Reviewed-by: hjk <hjk@qt.io>
2024-07-15 12:55:47 +00:00
hjk
27ef041d28 ProjectExplorer: Some more ToolChain->Toolchain renamings
Change-Id: I5cb2adf544a846f45f7fe7ce60f67b10ad100d91
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-12 08:14:59 +00:00
hjk
b89baec2c1 ProjectExplorer: Promote CppProjectUpdaterInterface
... to ProjectExplorer::ProjectUpdaterInterface and generalize it
regarding language, but create a convience function for the C++
case, as that's the only user right now.

Also add the self-registering factory boilerplate and adapt all
buildsystems.

Change-Id: If928512609d41c25fad2aa58633c8bffabc4c48f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-06 14:50:10 +00:00
hjk
2704f8ff0b ProjectExplorer: Proliferate FilePath a bit
Change-Id: Ia671a1de17b9e58764375c5f64cc47b053b0725a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-15 09:57:02 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
685cc1a2fc AutoTools: Move to Tr::tr
Change-Id: I605c2b5c812b500c1db2bdbfab26882ee55249d2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-30 07:09:50 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Jarek Kobus
f6b37328c7 AutotoolsBuildSystem: Avoid using sender()
According to the old explanation inside makefileParsingFinished()
the solution of using sender() can't work reliably in this
case. In scenarion where the old, deleted m_makefileParserThread
had the same address as newly allocated one we might not detect
correctly posted finished() signal of the deleted object.
According to QObject::sender() documentation:
"The pointer returned by this function becomes invalid if the
sender is destroyed", so we can't rely on its value.

Instead, add a new done() signal to the MakefileParserThread,
which is being emitted from MakefileParserThread thread (i.e. from
the thread where MakefileParserThread object lives in). In this way
the finished() signal is still posted to the caller's thread,
but this time if the MakefileParserThread object is already
deleted, the finished() signal will be gone together with the
MakefileParserThread object itself, so we also won't receive done()
signal anymore.

Simplify the internals by using std::unique_ptr.

Change-Id: I43be209ecb71539ddefd72e50e9d60bfb43c49cb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-26 11:15:58 +00:00
Artem Sokolovskii
30e60e9979 macros: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Id779aaf869406571288519083883ab57e5c29cec
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-06-03 07:58:05 +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
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Nikolai Kosjar
888ea6bbbb CppTools: Take "-include" files into account
Fixes: QTCREATORBUG-20602
Change-Id: Ibfc518fc64ed75f93265db800558ec1d2e424bb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-05 08:49:24 +00:00
hjk
b0b50257ec ProjectExplorer: Pass extra project files as QSet
They are available in some cases as such, and consumed as such.

Change-Id: I9866c7d7bd817fb19a8b11a0efbe583ed55fe393
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-03 09:17:20 +00:00
hjk
e94e1f116e AutoTools: Avoid an unneeded use of Project::activeTarget()
Change-Id: I0fa1b788ddbbe96973ead65ad09b4c8742e1832f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-21 15:00:09 +00:00
hjk
c2127c9ec4 ProjectExplorer: Introduce and use a Target::buildSystemUpdated signal
Change-Id: I497d46866146600a1ed9162bd720c574ee4d4769
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 13:08:06 +00:00
hjk
738bbf1a87 ProjectExplorer: Introduce per-buildsystem setRootProjectNode
Currently diverting to the original Project::setRootProjectNode.
Idea is to focus on the BuildSystem <-> generated tree relation.

Change-Id: I8b20173e364713f0919cf4f8b76a2f79ef8770bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 07:40:22 +00:00
hjk
7dec498323 ProjectExplorer: Make more use of available convenience functions
Change-Id: I53089c5e2138b1c9943d0dbff3857a2dff8ea233
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 07:40:07 +00:00
hjk
95ba85c86e ProjectExplorer: Use a Kit to initialize KitInfo
Change-Id: I70a83ff9a9da814b4e1ad9ce5e0b626105c09ca4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-11-20 11:31:14 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Eike Ziller
9cc45fe1fb CppTools: Move RawProjectPart to ProjectExplorer
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.

Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 06:22:12 +00:00
Tobias Hunger
fb21b78444 Autotools: Introduce AutotoolsBuildSystem
Introduce AutotoolsBuildSystem and slim down AutotoolsProject.

Change-Id: I68296152f9ecd5d14198c8d0b36a06c2d1b162ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 07:28:26 +00:00