Amends c58da42bab.
This operates also on not-fully loaded projects now, which was
previously causing a crash on android projects.
Change-Id: I44eeb7af8ed53a47ef39e7f1bafb07b871879ce5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
For freshly created projects using the json wizard, this
expands the outermost level of that project's entry in
the project tree.
This intentionally does not trigger when reloading from existing
sessions do honor a user's choice after collapsing that
item manually.
Fixes: QTCREATORBUG-17800
Change-Id: I101efaea84e68a4e769c803918652a1447805b2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
- add a QString FileNode::buildKey(), returning the build key
for a build represented by that node, if any.
* for QmakeProFileNodes the build key is traditionally equal
to the file name, so use that.
* for QbsProductNode use the uniqueProductName()
- add a Project::findNodeForBuildKey(QString buildKey) convenience
function searching a Project(!)Node matching that build key.
That's the only use case there is right now, and I see no reason
yet to travers all files (yet).
Change-Id: I388c0e06c03111e12d630899d762448e974a5737
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Always report the main project file in Project::isKnownFile(...) and
Project::files(...).
Change-Id: If9b9cc205e3419a457b05b368cb524c982cbc18c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Warn and ignore attempts to change the id() of a project.
Change-Id: I26c7c585e87d8be7b9fb8da3b3685b252e05f070
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
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>
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>
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>
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>
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>
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>
Add ProjectConfiguration * to activeProjectConfigurationChanged signal on
Projects and Targets.
Change-Id: I56f71e034eacaaa043b19c7fd5d82e6c5ea58517
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Get rid of duplicated code to do such signaling in derived Project types.
Change-Id: I26914a1d751d72ee65c15a7943e0e7f34978f042
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>