Commit Graph

265 Commits

Author SHA1 Message Date
Christian Kandeler
2485eb1a8c QmlDesigner: Do not require a qmake project for designer import paths
Let's enable all build system plugins to provide this information.

Task-number: QTCREATORBUG-20810
Change-Id: I0ef953e3c2c9a2be1fc4187e93232e9a2aeacafd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-08-20 12:44:41 +00:00
Marco Bubke
7bae47642c Add optional system include to compiler option builder
System includes suppress warnings and prevent indexing of unwanted symbols.
Using system includes for all includes outside of the project can be
quite advantageous. The rootProjectDirectory() can be extended to be set
in the project settings. An automatic generation could be possible but
could create an unwanted path which includes files outside of the
perceived project.

Change-Id: Ib9d3158f14f41efe1f6657f962d5c4437bb324b2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-14 15:03:51 +00:00
Tobias Hunger
28a1ef8bab Project: Fix setActiveTarget()
Allow setting to nullptr if no target is available.

Change-Id: Id51a176185eeaa31fef827d9ca722da9e62b9232
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-14 14:32:16 +00:00
Tobias Hunger
46f0fa8b27 ProjectExplorer: Use sessionmanager to set active target
Change-Id: I1e3abe473dc5eb68589de5b0b5d6ec8ea361febf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-06-05 08:09:13 +00:00
Tobias Hunger
bcbb6e61ef ProjectExplorer: Use unique_ptr to hold targets in projects
Change-Id: I8f793f5e552b65939d6c7c5e0eb42b89f9f45c3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-24 11:39:49 +00:00
Tobias Hunger
e8040081a6 ProjectExplorer: Don't register targets that are restored to empty state
Don't accept targets that get restored to an empty state. This un-confuses
the Projects page:-) Note that DeployConfigurations are not tested:
I see no use-case where a target with only a deploy configuration makes
any sense.

This can be triggered, e.g. by opening an existing cmake project after
making sure there are no more kits with cmake tool set up.

Change-Id: Iaf14f70e4e0d4206a88a08b47b0eccc666653f76
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-18 08:29:13 +00:00
Tobias Hunger
bdd2dd371e ProjectExplorer: Add FolderNode::addNestedNodes taking unique_ptrs
Use that in CMake's tealeafreader.

Change-Id: Id1c372b083df380d0d930668cf7eec4ee89060c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-04 09:02:56 +00:00
Tobias Hunger
0b1ed791a5 Project: Fix soft-assert triggered by Qbs projects
Soft-assert when a root project node is set again, except when
that node is nullptr.

Change-Id: Ib7c1891defc79d464a692c0e982b668be9a40cf9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-03 11:24:14 +00:00
Tobias Hunger
5754d5accf ProjectExplorer: Use unique_ptr for Project::setRootProjectNode
Change-Id: If63a49d0eecfb93adcc6076fcb3208c87603af10
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:35 +00:00
Tobias Hunger
1f55ba9012 ProjectExplorer: Use unique_ptr to hold ProjectNodes
Change-Id: Iaa5bea221686564de24138a99b5fe0d09521c118
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:29 +00:00
Tobias Hunger
2a34f2177c ProjectExplorer: Hide build page for projects that do not build
Change-Id: I56feaab67690b5ece7379a9c1f676392230de107
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:52 +00:00
Tobias Hunger
460fdc02e0 ProjectExplorer: Report project-specific kit errors/warnings
Report project-specific warnings about the kit used in Project Mode.
E.g. a python project should not complain about missing toolchains,
while a qmake project should.

Change-Id: I5ce6742683cdeffc7ff3f1a3e8f0b89aee9aa0b4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:45 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Tobias Hunger
63a4654a8e ProjectExplorer: List foldernodes in project as well
List folder nodes (e.g. used for QRC files) in Project::files(...).

Task-number: QTCREATORBUG-20220
Change-Id: I9879d79530fd78a6b0976fe7fdb45a23d2d9c553
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-11 13:23:22 +00:00
Eike Ziller
ab7960f6cf Move Project::makeUnique to Utils
This is more generic than projects

Change-Id: Ifdbc57ff48f9fd4a40e6149ba636e0a55cbac502
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-11 06:42:27 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
hjk
66d18ce07f ProjectExplorer: Simplify IBuildConfigurationFactory interface
Following the RunConfigurationFactory lead this replaces
f = Foo::find(); f->do() by static Foo::do() stanzas.

Also de-virtualize/private-ize IBuildConfigurationFactory::canCreate()
as it is only a local helper nowadays.

Change-Id: Id36ba514f426ebd054592189aa29c170ba00d92f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-04 10:14:22 +00:00
Tobias Hunger
530fc225fa Project: Use std::unique_ptr for root project node
Change-Id: Ice101fa57c5ee09a58dc6c99f6716fa4919ade59
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-28 13:11:32 +00:00
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
Tobias Hunger
8ae505f30e QmlProject: Unify selection of supported kits
Change-Id: Ic33e9688d823bd09664e5dc74fe5253cb5fcbc58
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-09 10:56:17 +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