Commit Graph

229 Commits

Author SHA1 Message Date
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
Tobias Hunger
25fbcca96b KitManager: Get rid of KitMatcher class
Use std::function instead. Clean up API while at it.

Change-Id: I6e401ab57f5375e36710c30508c596af3f4b3385
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-18 10:39:16 +00:00
hjk
33c732c60c ProjectWindow: Fix crash in TargetSetupPage
Move ownership of the ProjectImporter to the Project.

Task-number: QTCREATORBUG-16744
Change-Id: I7fc217ce8058287c5435b259bdc5300a926f8098
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-05 16:14:42 +00:00
hjk
2459652234 ProjectExplorer: Rework mode main window
The existing solution with the special-style horizontal
kit selector comes from a time when there was typically
one, at most four targets. Today's setup can easily
reach half a dozen targets with several toolchain versions
each and can't be sensibly handled with the overflowing
horizontal bar.

This here replaces the horizontal kit selector bar as
well as the top level project "tab bar" with a normal
tree view. All targets are visible (but possibly disabled)
at once, and can be enabled/disabled using the context
menu on the tree items.

Change-Id: I1ce7401ca96109bf34bc8c0ae19d265e5845aa88
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-07-26 10:00:09 +00:00
Tobias Hunger
95ac4edfd4 Projectexplorer: Modernize codebase
Change-Id: I4793b58aa77bcd46af99f8b843c0f7439cdc9269
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
2016-04-15 09:40:53 +00:00
Tobias Hunger
c018530587 ProjectExplorer: Handle imperfect build systems
Handle buildsystems with imperfect knowledge about what they
build more gracefully.

Leave RunConfigurations around if the build system can not tell
whether or not the relevant target was configured out of the
current build or completely removed from the build system.

This patch should not change the observable behavior of the code.

Change-Id: I0ddb4bd3966d184a4b5c9818e68adb107047ed1f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-07 09:57:10 +00:00
Orgad Shaneh
2383a6b452 QbsPM: Do not delay initial parsing
When a project is opened, delayParsing() is called several times:
* activeTargetChanged -> buildConfigurationChanged
* environmentChanged
* startupProjectChanged -> ... -> buildDirectoryChanged

delayParsing starts a 1s timer for aggregating all the relevant changes
before starting the actual parse.

This makes sense also when the user makes changes (like switching build
configurations fast, or editing the build directory).

When the project is opened initially, there's no reason to wait before
parsing.

Change-Id: I4eb0c7d3419465bc01e8f9febc9ee808684adb6e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-02 11:06:06 +00:00
Niels Weber
15878d7f15 Minor doc improvement
Change-Id: I4899d4ed34bf1132f688390010640f226ace1264
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2016-02-24 12:14:51 +00:00
Ulf Hermann
2e3e060520 Generalize support for extra compilers
Allow for different extra compilers which may get called to generate
additional code for the code model. The build system is expected to
know what files are generated from which source file and the extra
compilers know how to generate the content of those files, without
touching the build directory. the uic adapter is refactored to be
the first such extra compiler.

The extra compiler is run when an editor for its source document
loses focus, or after a timeout of 1s when the source document has
been changed.

Change-Id: I13c110c61120c812f02639a3684144daf8979b37
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-16 12:53:05 +00:00
Tobias Hunger
412dd23e0f ProjectExplorer: Simplify code a little bit
Use an QTC_ASSERT in favor of an if. This may not happen.

Change-Id: I4e8d58210f9caff9b8ae7d0fccf764d8ceeace9e
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-02-02 14:46:47 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
d144ea58e0 Project: Add setRootProjectNode method
Add setRootProjectNode method and a default implementation of
rootProjectNode to Project. Use that in all derived classes.

Change-Id: Id28cde04457a20a8963d43020785ef9d77fea57c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-11 15:33:26 +00:00
Tobias Hunger
21d204ad5c Project: Add setProjectManager method
Implement default projectManager method in Project and use
these two everywhere.

Change-Id: I27e011e6fdc17b36aff1b8b931527307320e347c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-01-11 15:31:04 +00:00
Tobias Hunger
b386dd0e99 Project: Add setDocument method
Add setDocument method, implement document method, use this in all
projects.

Change-Id: I5018bf7c2739665c13eee340184ce7c41fd319bb
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-01-11 12:18:11 +00:00
Tobias Hunger
3120692092 ProjectExplorer: Use Qt5-style connects and clean up
Clean up code a bit: Remove private slots, etc.

Change-Id: I745925c76ed4e0be69a11ca911741309fc4286e7
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-07 17:29:06 +00:00
Tobias Hunger
71b4ce6673 Qt: Remove platformName and platformDisplayName methods
Fix fallout of this in KitInformation/Kit/KitManager and the wizards.

Change-Id: I5cb88cc381dc04409401909b810940ab6dccf86a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2015-12-02 14:49:29 +00:00
Tobias Hunger
4a5ed881fa Target: Move clone code from TargetSetupWidget to Project
Change-Id: If30e5c18be48c647d490c054796d9ff7844bb1d6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-11-23 10:26:10 +00:00
Daniel Teske
8395157426 Project: Add a option to synchronize kits and build/deploy across projects
This is far from perfect but seems to work. Further work could add more
fine grained control over which projects are affected by the automatic
synchronize. Also there might be a few cases where the switching is
over zealous or missing.

Change-Id: I26ad3d59431251564917e4b408c66695dc454823
Task-number: QTCREATORBUG-5823
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-15 10:45:53 +00:00