Commit Graph

340 Commits

Author SHA1 Message Date
Orgad Shaneh
3122a1bfc5 Aspects: Remove some more default values
Change-Id: Iadee8b8f1eeb3ff009a667d45a51f6f5a94329ca
Reviewed-by: hjk <hjk@qt.io>
2020-11-10 08:06:51 +00:00
Leena Miettinen
f2254419af Project explorer: Fix UI text
Fix punctuation.

Task-number: QTCREATORBUG-24873
Change-Id: I5cc5e80915b891efa2cd2268e3302feb39b7a576
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-09 09:52:12 +00:00
Fawzi Mohamed
f26b7a3700 projectexplorer: avoid crash if recovery of kit fails
Change-Id: I8bf3a24b1485da2bfd1eb13e61c2712b66b30a70
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-09-29 21:41:22 +00:00
Christian Kandeler
4c1c11b7b6 QmakeProjectManager: Fix crash on reparsing
After a re-parse, the existing IDocuments need to be updated with the
new QmakePriFile object, as the old one may no longer be valid and thus
cause a crash on the next re-parse.
Amends f3bd07efd1.

Fixes: QTCREATORBUG-24683
Change-Id: Ib03d3005cb7831f1e05cb116aa3cdfe6cf5e72ad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-28 11:29:41 +00:00
Christian Kandeler
781a4484a1 ProjectExplorer: Remove replacement kits
... for which the original kit has turned up again. Otherwise we'd have
more than one kit with the same id.

Fixes: QTCREATORBUG-24589
Change-Id: I7ce16615694d3d2c5a5441f676ecb7dc85c2239c
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-21 11:57:03 +00:00
Christian Kandeler
f3bd07efd1 QmakeProjectManager: Restore incremental re-parsing
This was broken in commit 37aecdd112, where we overlooked that a special
type of IDocument was used that triggers a re-parse of only the affected
part of the project tree. As a result, all changes to a .pri or .pro file
would trigger a re-parse of the entire project.

Fixes: QTCREATORBUG-24572
Change-Id: I480cff4e53cf86a17e1eaac0eb9b32901bc87051
Reviewed-by: hjk <hjk@qt.io>
2020-09-15 09:19:23 +00:00
Tim Jenssen
4fe5b923cd Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Change-Id: Ic720f3adab305c5ef8cd10e713ccabf510eff0c0
2020-08-13 06:39:40 +00:00
Tim Jenssen
e95a95cdfe projectexplorer: add availableQmlPreviewTranslations()
Preparation for a test translations feature.

Change-Id: I1a7ccecab803f5838cd765b7dca99bcf5bb9e8a1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-15 21:37:50 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
Christian Stenger
6e798401a0 Fix plugin unit tests when using projects
The ClangTools and the AutoTest plugins use an internal
mechanism to load and configure a project when performing
their integrated unit tests.
Both assumed to have exactly one kit present for these
tests.
Make it possible to have more kits present when starting
with existing settings or if more kits get automatically
generated when starting with clean settings.

Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-17 04:13:30 +00:00
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
Christian Kandeler
4657563e4a ProjectExplorer: Try harder not to lose custom project settings
... when a kit disappears.
This can easily happen, for instance due to a Qt version update via the
installer, and until now resulted in the disappearance of all user
customizations of build and run configurations.
We now store some additional data when serializing a target, and use it
to recreate a kit of the same type upon restoring. While the resulting
configurations are not guaranteed to be functional, they should contain
all the customizations, which the user can then copy over to a proper
kit.

Fixes: QTCREATORBUG-23023
Change-Id: I659d52808b2f8a308e6aa094e8ef2ee60d586952
Reviewed-by: hjk <hjk@qt.io>
2020-03-19 14:28:40 +00:00
Christian Kandeler
ae0d2bd1ac QmakeProjectManager: Try harder not to access nodes of in-parse project
For extra safety, do not touch the project nodes if any build system of
any build configuration is currently parsing.
This is a bit of a stab in the dark, as I cannot reproduce the crash
described in the linked bug report.

Task-number: QTCREATORBUG-23597
Change-Id: Ie62a94232e89d8fba5866ea3572535e2ab209924
Reviewed-by: hjk <hjk@qt.io>
2020-03-05 12:40:47 +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
Christian Kandeler
757628bf4a ProjectExplorer: Fix Project::setExtraProjectFiles()
This function was buggy and could erroneously un-watch all the project
files after the first update.

Change-Id: I528fd8da7f873598e08f4c0177757a052fbb97ef
Reviewed-by: hjk <hjk@qt.io>
2020-03-02 16:40:34 +00:00
hjk
6164378372 ProjectExplorer: Replace a few foreach()
Change-Id: I445cdfaac13ac894be3cd6fc8c20b4a09f460a01
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-02 11:54:00 +00:00
hjk
8a8c49eb2e ProjectExplorer: Simplify update logic after active target change
Change-Id: Ia1d9366b1f2ff2b7ae02604bc43b38ca4b914c17
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-02 10:07:33 +00:00
hjk
3c436d0e42 ProjectExplorer: Introduce BuildSystem::parsingStarted/Finished
Some listeners are only interested in a particular build system
instance, not all of one target.

Change-Id: Id89bd96c1f7f68bac13886bdc31cb899978d76ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-12 16:59:29 +00:00
Tobias Hunger
e4738904d9 TargetSetupPage: Improve reporting on invalid kits
Give the reason for a kit being disabled in the tooltip.

E.g. for a CMake project you will now get

"Kit is invalid: No CMake tool set."

instead of a generic error message about the kit being invalid.

Change-Id: Ic776dc24149d65ebf27163b605ec2e52a3a504a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 13:50:57 +00:00
Christian Kandeler
38cd7b1aa0 ProjectExplorer: Use different build dir when copying build config
...into another target.
Using the same build directory in two different targets will likely lead
to errors.

Fixes: QTCREATORBUG-23462
Change-Id: I7daa510b3128a344adb51772d44a79415419acc3
Reviewed-by: hjk <hjk@qt.io>
2020-01-16 13:32:52 +00:00
hjk
82265d51a7 ClangTools: Attach ClangToolsProjectSettings data to project itself
Easier to reason about life time.

Change-Id: I2c61527532f6faa344fc59d858921e66daaf0b7e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-14 14:04:36 +00:00
hjk
b4ee6eb3c0 ProjectExplorer: Move some of the BuildInfo setup code to central places
Change-Id: I8893366acb187ea1a94a8ca272ded2c46cb521d1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-14 13:56:10 +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
Christian Kandeler
6e0d44b0ff ProjectExplorer: Let users provide project-specific environment
Add a new project panel where users can set environment variables for
the current project in all configurations.

Fixes: QTCREATORBUG-21862
Change-Id: Id98c7f1cf579927a8004a63172f193f943556f44
Reviewed-by: hjk <hjk@qt.io>
2019-12-12 16:34:22 +00:00
hjk
3c41b91d44 ProjectExplorer: Settle on fixed set of build step lists
Even if the implementation allowed different lists than 'build'
and 'clean', that's the only set that has been used, ever.

If really needed, this could be re-instated, but for now having
them fixed removes part of the neeed for a two-phase construction
and helps to simplify user code.

Change-Id: I3df09a1829a7d020ef8963d358ea80f8d199ba13
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-06 14:49:59 +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
hjk
6a878c7293 ProjectExplorer: Use a functor for BuildSystem creation
... instead of creating the BuildSystem direct. This will help the
shift of BuildSystem owner ship as a Project will have potentially
multiple BuildSystem instances (one per BuildConfiguration), but
still be responsible for creating them with the Targets.

Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 09:01:52 +00:00
hjk
67c74fbe29 ProjectExplorer: Do not return early on parsingFinished assert
This is a hack, not a proper solution. In theory, this here should
serve as a lock.

We currently get start - start - finish - finish sequences when
switching qmake targets quickly, keeping the run button disabled.

The whole setup here is unfortunate. Parsing inherently depend on
more than the project alone, it's roughly per-Target. So keeping
track of it in the Project complicates it.

Change-Id: I57d361ce21088d8e1ec53ce75f83ff3bd04851e1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-22 13:20:38 +00:00
Orgad Shaneh
d26140e7f1 Qmake: Show real effective make call on Make step - take 2
Include custom Makefile.

Change-Id: Ibc6a341590f8b1ff0da2fa87f5e5bcd75182b6a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-08 08:33:25 +00:00
Tobias Hunger
b7e4046a17 ProjectExplorer: Add BuildSystem class
Add a class to abstract out the BuildSystem from the Project.

Thie idea is to make a Project have-a BuildSystem, so that
it can stop being one.

The Projects in the different ProjectManagers will get much
simpler that way (and many will only consist of a constructor
with some setter calls) and handles all the interactions
between the rest of Qt Creator and the project.

The complex code to interact with the build systems is then
separate from that.

Change-Id: I3bbb000bb1aed91f0b547ac493f743ede8afb8cd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 07:28:04 +00:00
Tobias Hunger
a699a0c92e Project: Improve activeParseEnvironment
Not all Projects have build configurations. Handle those better.

Change-Id: I72e63798f034a2a497978a2844c4158dfd09ef0f
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 07:28:34 +00:00
Tobias Hunger
3eea938a04 Project: Rename Project::activeBuildEnvironment to Project::activeParseEnvironment
This is used for parsing the project only, so reflect that in the name. Not all
projects have build configurations, so the old name did not make too much sense
for what this has been used for.

Eventually this code should move into the BuildSystem.

Change-Id: Iff766150b5fe370f2912b0b3b15348b1c1fad5b5
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 07:28:18 +00:00
Tobias Hunger
14b1b3137b ProjectExplorer: Assert that the filter passed to Project::files is valid
QTC_ASSERT that the filter passed to Project::files is valid before
calling it.

Change-Id: I17776fa4ab3e2aa21ac34db015fdbbb382439669
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-26 11:10:15 +00:00
Tobias Hunger
d272a64eab Project: Remove Project::document() method
The document is used to do file watching, which may or may not be
ideal. So make sure we do not leak the information how we watch
files into the API and its users.

The method is not used sensibly anywhere in creator, so it seems
safe to remove it entirely.

Change-Id: Ieed755bd5c852875378e4e96665dc906499975b0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:27:06 +00:00
Tobias Hunger
109a8b1829 ProjectExplorer: Clean up Project
Change-Id: I870ef9f57e1a3ae3bc61351322c71d3ce5381d98
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:26:50 +00:00
Tobias Hunger
d13307b5bf Project: Add signal triggered by project files becoming dirty
Add a signal triggered by project files becoming dirty and add
a way to register more project files than just the default with the
project.

This change enables getting rid of filesystemwatchers in derived
classes.

Change-Id: If985b46edf7cb88dd49f1c574f35cf13b5ce82d4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-16 12:43:21 +00:00
hjk
d2a0b13252 AutoTest/ProjectExplorer: Move some unusual function towards only user
Change-Id: I1101a21871c8b1eac5c01afc033e5416850bc794
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-14 11:48:36 +00:00
Tobias Hunger
ae345003aa ProjectExplorer: De-virtualize some more virtual methods
Use setters/getters for the bool flags in
Project::needsBuildConfigurations() and
Project::hasMakeInstallEquivalent.

Change-Id: I5ce937c3a5e8e0db627cda02a9007f8c28ccda0c
Reviewed-by: hjk <hjk@qt.io>
2019-08-13 10:24:30 +00:00
Tobias Hunger
09530d6dcc ProjectExplorer: Use RAII pattern for parsing start/stop signalling
Change-Id: I13de537140f265db3e3d0ab1cd924d6897cd90c8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-09 12:45:29 +00:00
Tobias Hunger
d880f1f771 ProjectExplorer: De-virtualize knowsAllBuildExectuables method on Project
Just use a setter instead.

Change-Id: Id5dff64e9a7fcdf64a245b71432318299a49d9f7
Reviewed-by: hjk <hjk@qt.io>
2019-08-09 12:42:53 +00:00
Tobias Hunger
2fa555bdfd ProjectExplorer: Add another missing activeBuildConfigurationChanged signal
Change-Id: If31157a569f13df6e6dbd09ab8148b325bf6858d
Reviewed-by: hjk <hjk@qt.io>
2019-08-09 10:27:34 +00:00
Tobias Hunger
2d6ec5a287 ProjectExplorer: Fix warning
Change-Id: I091746e494ef2cb92f395a09111c055226827804
Reviewed-by: hjk <hjk@qt.io>
2019-08-09 10:27:25 +00:00
Tobias Hunger
926338f509 ProjectExplorer: Emit activeBuildConfigurationChanged on project restore
Change-Id: Id5f2d8b36d99df1ffc6e4e0d8a680b55e57c336e
Reviewed-by: hjk <hjk@qt.io>
2019-08-06 09:14:09 +00:00
hjk
09e5c167bd ProjectExplorer: Add convenience Project::addTargetFor{Default,}Kit
Less noise on the user side.

Change-Id: I5cdf4af4910a3cc1ee0af1b43fcbc7329a6d59db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 16:16:29 +00:00
hjk
72fe2c706e ProjectExplorer: Inline Project::restoreTarget()
... into its only internal user.

Change-Id: I3f2d1a3af757036cc2194967a71ad0d48ed05d9a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 16:16:02 +00:00
hjk
4c80380478 ProjectExplorer: Remove Target::*ProjectConfiguration(...) signals
The only listener left is the target's project, which is known at each
emitting location and can be called directly.

Change-Id: If07d2c1c43fcf5d2094c0b6d59f773d12b4f6d6b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 15:23:25 +00:00
hjk
7d3091a7b9 ProjectExplorer: Remove ProjectConfiguration base from Target
Targets are different from {Run,Build,Deployment}Configurations,
both regarding the level in the ProjectExplorer hierarchy, and
also by the set of supported operations (e.g. aspects).

Change-Id: Ia8490e2280a9ecc518395c5e48ce2fd5d6d58fd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-31 11:18:16 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Christian Kandeler
f7520b7d99 Make the project managers tell the code model about include paths
... from the environment.

Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-12 09:13:42 +00:00
hjk
b9d6721be8 ProjectExplorer: Reduce ProjectExplorer::configureAsExampleProject()
... to the bits that are actually used.

Change-Id: I39a6ed1f4136d75b776bb89eec6165479097a4ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-01 10:05:19 +00:00