Commit Graph

246 Commits

Author SHA1 Message Date
Tobias Hunger
49c910c7ab TargetSetupPage: Work for projects without BuildConfiguration
Change-Id: Ie145bc3c87f01326a25e75f5c80a4d05da58bf6b
Reviewed-by: hjk <hjk@qt.io>
2018-03-16 11:25:48 +00:00
hjk
805b28b8b7 ProjectExplorer: Simplify DeployConfigurationFactory interface
Following the RunConfigurationFactory lead this replaces
f = Foo::find(); f->do() by static Foo::do() stanzas.

Also protect DeployConfigurationFactory::canCreate()

Change-Id: I80fa491f836c3b9186f6ce6dccac4d52d4b80fc8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-15 13:09:27 +00:00
Tobias Hunger
835d4e92f3 Project: Improve default implementation of Project::needsConfiguration
Change-Id: Ic4d227334d818658f179c0589462551509274c17
Reviewed-by: hjk <hjk@qt.io>
2018-03-09 12:57:59 +00:00
hjk
8b92da254e Rename IRunConfigurationFactory to RunConfigurationFactory
It's not an *I*nterface anymore

Also, remove the in-all-but-one case unused QObject parent and the
object name that was only there for debugging purposes. The class
type serves the same purpose in the debugger.

Change-Id: I0dafb01e6b4fd7c7df04a63aaa3ef3e4bd693f6f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-07 16:07:42 +00:00
hjk
6781217280 ProjectExplorer: Consolidate RunConfig creation codepaths
Move some code around to make interfaces slimmer.
Also no need to check canHandle() twice per creation.

Change-Id: I7c86e2dc78ebd53a0f8e9609e9fa135aaf31e7b7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-02 15:32:21 +00:00
Tobias Hunger
997ece4361 Project: Remove unused Project::requiresTargetPanel(...)
Change-Id: I7a5298edefd7e26841c4070be23534dd33d093cb
Reviewed-by: hjk <hjk@qt.io>
2018-02-19 13:22:21 +00:00
Tobias Hunger
8059bf6204 Project: Make setRequiredKitPredicate private
Make calling Project::supportsKit(...) the default implementation.

Change-Id: I0e47972097e760e2ff3be229afb85eff839146b8
Reviewed-by: hjk <hjk@qt.io>
2018-02-19 09:28:02 +00:00
Tobias Hunger
034f0209b0 ProjectTree: Fix crash working with resources
Fix the notification of subtree changes to keep the project in
the loop, so that it can adjust its list of known files.

Ignoring that will cause crashes, e.g. when the ResourceEditor
updates its subtree of the project.

Task-number: QTCREATORBUG-19613
Change-Id: Ib7bb9afe48eb248cdf675ba2093b266fd728d7b2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-22 11:51:47 +00:00
Orgad Shaneh
e75dd28d0c ProjectExplorer: Fix build with Qt 5.6
Change-Id: Icb9cae9c5baaa5cdc2dd6dca2bb493cdf0d73012
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-01-11 13:48:43 +00:00
Tobias Hunger
4f49b46eaa Project: Add some basic tests
Change-Id: I2b60c9df93700a8aa659adceee4e00cf46584a5b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-11 10:32:02 +00:00
Tobias Hunger
bcc550a4e2 Project: Always report the main project file
Always report the main project file in Project::isKnownFile(...) and
Project::files(...).

Change-Id: If9b9cc205e3419a457b05b368cb524c982cbc18c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-10 14:07:28 +00:00
Tobias Hunger
a1af407f53 Project: Add mimeType() method
Add a method to retrieve the mime type of a project.

Change-Id: I9ae2cab987780597561a5ee164e2c2b9b9445e68
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-10 13:29:46 +00:00
Tobias Hunger
c20ac40ae3 Project: Make sure id() will never change
Warn and ignore attempts to change the id() of a project.

Change-Id: I26c7c585e87d8be7b9fb8da3b3685b252e05f070
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-10 13:29:40 +00:00
Orgad Shaneh
e744e6677c Project: Fix bad comparison in isKnownFile
Broke by 43f57d3f31.

Task-number: QTCREATORBUG-19523
Change-Id: Id154f680b85d0238cf096fb0d56c779309c9f598
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-08 13:43:26 +00:00
hjk
b2a16190e8 Use project id uniformly as project context
The possibly intented flexibility e.g. to have different project types
share the same idea of a common context was never used, in all cases
we had a 1:1 relation ship between project ids and ids that were used
as context. This led to oversights like the one fixed in 60fb35a2.

This patch here uses the project id unconditionally as context and
drops all context ids. If we'll ever have the situation where the
original flexibility was needed, Project::projectContext() could be
made virtual and overridden were needed.

Also, the context was never modified for any given project, so the
updating machinery is not needed.

Change-Id: I3f7fac0ed5e4704e126558987c48577f26082dfd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-20 12:35:14 +00:00
Tobias Hunger
43f57d3f31 Session: Get rid of cache of all project file names
Make the project responsible to provide information on which files
belong to it instead.

Change-Id: I80accf9104af33eaffc6b8f3e6024e9725697d37
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 11:13:34 +00:00
Tobias Hunger
f542e24eca Project: Make Project::file take a std::function to match files
Make Project::files take a standard function to match files with instead
of an enum (and a std::function).

Change-Id: I6a24e40dba0e972ff96c0a57e775d2377e2545e0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:56:29 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Tobias Hunger
bf970a5929 ProjectExplorer: Split up settingsaccessor.h
Split up settingsaccessor.h/settingsaccessor.cpp by moving
the userfileaccessor code into its own set of files called
userfileaccessor.h/userfileaccessor.cpp.

Change-Id: I634550b7ebba29a94791b163dcf05aacf61cfdd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-17 15:34:15 +00:00
Tobias Hunger
1a5eaecd97 Project: Avoid unnecessary activeTargetChanged signal
Make sure to create the active target first when reading a project
for the user data. This implicitly sets this target to the active one,
avoiding one spurious activeTargetChanged signal.

Change-Id: Iff9b19ed25bac9809ae75489ae159ffb66e71cb4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-17 08:16:25 +00:00
Tobias Hunger
93c832a621 Project: Get rid of *EnabledChanged signals on Project and Target
Change-Id: I87529e4eed73fedf34a1482c99129ecc3a5c0e98
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:20:43 +00:00
Tobias Hunger
f119eec4d1 Project: Get rid of builddirectoryChanged signal
Get rid of Project::buildDirectoryChanged signal as well as
Target::buildDirectoryChanged (and the infrastructure).

Change-Id: Ia749e62eec7e182e558d81115dc2a3d07b72b346
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:20:37 +00:00
Tobias Hunger
e52ebbf217 ProjectExplorer: Add subscribeSignal method to targets and projects
Add a subscribeSignal method to targets and projects that will make
sure all signals of all project configurations added during the lifetime
of the project/target will get connected (if the type matches).

Use this to connect to some signal in all BuildConfigurations of
a project and get rid of code that keeps connecting to the current
build configuration.

Use Project::buildEnvironmentChanged as an example and convert its
usages.

Change-Id: I689bcebac4b191bf3f8a18765bf18eaac371c5fe
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:19:28 +00:00
Tobias Hunger
34456aa906 ProjectExplorer: Add ProjectConfiguration * to activeProjectConfigurationChanged
Add ProjectConfiguration * to activeProjectConfigurationChanged signal on
Projects and Targets.

Change-Id: I56f71e034eacaaa043b19c7fd5d82e6c5ea58517
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:18:59 +00:00
Tobias Hunger
f1d735b7dd Target/Project: Add generic signals for changes in the project configuration tree
Change-Id: Iae0589620a8caf8e3748589b12329608ef3a39da
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-31 18:13:35 +00:00
Tobias Hunger
09b127f9f1 Project: Move signalling of parsing state into Project
Get rid of duplicated code to do such signaling in derived Project types.

Change-Id: I26914a1d751d72ee65c15a7943e0e7f34978f042
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-26 09:29:21 +00:00
Tobias Hunger
53c85a2676 Project: Use more std::unique_ptr
Change-Id: I06114e79b0a5b58b3dc4d13279232392709e9efc
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-11 09:54:18 +00:00
Tobias Hunger
0a3409112b ProjectNodes: add listInProject() to Node
Add a setter/getter for listInProject to Node and make the project
list all nodes with this property set in Project::files.

Task-number: QTCREATORBUG-18132
Change-Id: I334e627856d1bc0d033e13c5d629f6657d8d7fee
Reviewed-by: hjk <hjk@qt.io>
2017-05-04 09:16:56 +00:00
Tobias Hunger
9ae5591956 Project: Skip duplicate files early
Change-Id: I9e2d8ce35c3f3901391c7494f1f3b60eee1bcd00
Reviewed-by: hjk <hjk@qt.io>
2017-05-04 09:16:15 +00:00
Tobias Hunger
a1ae4affc2 Project: Remove duplicates from file list
Remove duplicate entries from list of project files. The duplicate
entries used to be visible in e.g. the locator.

Change-Id: I4a58ff11bd37ff39f4c9186ae89a2d384894bc1e
Reviewed-by: hjk <hjk@qt.io>
2017-04-24 11:41:41 +00:00
Tobias Hunger
0951589420 Project: Unify handling of displayName
Unify the handling of displayName with a proper changed signal across
all projects.

Change-Id: I7e503528854b85f6f38de4b0943775f82a0d6123
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-04-07 14:49:51 +00:00
hjk
8d1f4834b6 ProjectExplorer: Don't rebuild all projects' tree when one is closed
Removes some quadratic-in-number-of-projects behavior on session
close/switch.

Change-Id: If93bb9a67b0bebddda5319a7594a99ae66f50f5a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 13:44:27 +00:00
Tobias Hunger
14f3a86cf3 Project: Set filepath on ContainerNode
This fixes search via the context menu.

Change-Id: Ie675cae3f6e35d5d02234f3a49f7a71d02b08bc2
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:54:05 +00:00
Tobias Hunger
b0c7bb0f7b Project: Move ProjectDocument setup into Project class
Change-Id: I5c0ec79ddf066e37660fb9a6b24f9d882355d511
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:53:24 +00:00
Tobias Hunger
348aa12eaa ProjectExplorer: Provide ProjectDocument and use it in all projects
Change-Id: I6e054ebf1043bd1f6748f1567f35c68394bd6528
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:03:34 +00:00
hjk
2ee7967750 ProjectExplorer: Fix enabling state of main project nodes
Since the rootProjectNode() containing the parsed files is now nested
under a new project node the main node needs to delegate enable/disable
decisions.

Task-number: QTCREATORBUG-17922
Change-Id: Ie7bb6d6802072a2127b32c0fe51fb25fc1c9c6cc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-28 07:10:54 +00:00
Tobias Hunger
fc5ce1e710 ProjectExplorer: Handle project file list globally
Handle the generation of the list of files in a project globally, based
on the project tree.

Creator now has the concept of TreeManagers which can enrich the project
tree with additional data (e.g. the files found in a resource file), which
the project does not necessarily know about. So use that tree to find
the files that belong to a project instead of implementing similar features
in each project.

Change-Id: Ia375a914a1f2c0adaa427f9eda834eec2db07f68
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-27 15:32:13 +00:00
Tobias Hunger
b021660c1e ProjectExplorer: Treat empty root project nodes better
Do not set up empty root project nodes and fall back to the default
project tree instead. A project can not ever be empty: It should at
least include the project file itself so that the user can fix
breakages when project parsing fails.

Change-Id: I692e299f56727305120777cdc532607d5b0be99e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-24 11:16:19 +00:00
Tobias Hunger
00a02dc1f8 ProjectExplorer: Fix crash when setting root project node
Change-Id: I13954bffd06bee2aaf248d26cf358a0cc674d139
Reviewed-by: hjk <hjk@qt.io>
2017-03-21 14:05:45 +00:00
hjk
ebae6426f8 ProjectManager: Remove SessionNode
Instead, get root project nodes directly from the project.

Change-Id: I5cf95a7dce1fa29c1adc26013ad03cc017f38a6d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-21 12:48:41 +00:00
Tobias Hunger
2ff0d30829 ProjectExplorer: Move code to set up default project structure
Move the code used to set up the default project structure from the
Project into the sessionmanager. Now that the models are no longer
connected to the project this is the safer way as less change to the
projects logic is required.

Change-Id: Ib6b897f990a24d2dcce96a9821f090551fe45f13
Reviewed-by: hjk <hjk@qt.io>
2017-03-17 16:33:12 +00:00
Christian Stenger
b814bea0ab ProjectExplorer: Fix crash on reloading projects
Partially reverts 6e91fe50.

Change-Id: I91f2460fcee79deeeb55cc4955fca4726b5276bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-16 09:48:29 +00:00
Tobias Hunger
6e91fe5046 CMake: Use a CMakeProjectNode as top level cmake node
Change-Id: I6e68b971cf490b9b064a2866bd99865a7f4a7bd9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-15 10:23:09 +00:00
Tobias Hunger
c63805668f ProjectTree: Add a way to register managers for subtrees
Change-Id: I4694bb7dbe75b67946cdb5d8ca8b5a3ff1e40659
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 16:44:07 +00:00
Tobias Hunger
49fef0ae24 ProjectExplorer: Create initial project tree
Create an initial project tree with a ProjectNode and a FileNode for
the project file itself.

Fix the Projects to not implement their own tree before they have
better data.

Change-Id: I147ccd5603d22d1d60880a97f30fd8c271eac88c
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 16:22:31 +00:00
Tobias Hunger
71a5aee36f Session: Update SessionNode when Project tree changes
This moves ownership of the project's root node from the
project into the project tree!

Change-Id: I84eba884bd63b44e56c75023d8bf12caf5cc2833
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 16:22:21 +00:00
Tobias Hunger
b6234d12e6 ProjectExplorer: Emit signal when root ProjectNode changes
Change-Id: I2bbf2577b1dfbf70e21e05564b4f49c9fb820a8b
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 15:38:22 +00:00
hjk
be204a125e ProjectManager: Cut ties between Project and IProjectManager
Not needed, less code.

Change-Id: Ie0d5c3a60f0392f30ed2ee9d2c5a32156b4e67e1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-01 17:07:05 +00:00
Eike Ziller
b1e2d5b693 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ib3073a0a3d80c99cf97b9839480dbf9583fa10de
2017-01-23 13:13:14 +01:00
hjk
ec5a669b39 ProjectExplorer: Disable copying steps to inactive kits
This fixes a hard crash due to a Target nullptr.

Change-Id: I3065ac61bc950413d8958bcad5420f5868afd35c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-19 09:52:39 +00:00