This uses the same approach as in the previous patches: Have some
generic interface in the base classes (here ProjectNode::targetData()
setTargetData()) and implement on the qmake project side.
Implementation for Cmake/QBS is architecture-wise possible, but
not used right now, and left for later.
Change-Id: I3bbf66170020cf9027a894cd66db15ec7ffbf499
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
It makes sense to add all matching child nodes for the folder
instead of the only one which can even be nullptr.
Change-Id: I134a8073cfae557db2cb44c313239f18b97bda97
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Retrieving the list is cheap, there's no reason to store it and pass
it through all these functions.
Change-Id: I394b512c113af92f60cfb8c2f6561d1617d9cd36
Reviewed-by: hjk <hjk@qt.io>
Ensure to keep node alive as long as needed.
Task-number: QTCREATORBUG-20616
Change-Id: I57a720d3e31e14bcb8388de5fef68f70db370c90
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Remove FolderNode::addNestedNodes that take raw pointers now that the
last user is gone.
Change-Id: If2ca3864934d9239ac136e65c0b7dbcea7caf220
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Do not double-free oldNode.
Change-Id: Icce2d13b6afd24f2e37c5ca7e2b572a6784e69e1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Using QFlags here increases the size of a Node by extending the
m_flags from 16bit to 32bit and adds needless padding.
Change-Id: I9169585a7f91da5b85433fcd6f4d1bb7d39e65c1
Reviewed-by: hjk <hjk@qt.io>
This feature in question is the availability of the "Run" button in the
context menu of certain project nodes in the project tree to run
something presumably related to/build from that (sub)project.
Previously, the decision was made for certain qmake based projects
(those targeting Desktop, iOS and VxWorks) by some indirection
through the corresponding RunConfigurationFactories.
The patch lets the RunConfigurations decide themselves directly
and removes the indirection, potentially opening the feature for
other qmake based RCs, as well as other combinations (e.g.
PythonRunConfiguration could be associated with its .py file,
without the need to have a dummy project)
Change-Id: Ic489bd1dfa25fcd9102ffa4fa30125565dd2e40e
Reviewed-by: Tobias Hunger <tobias.hunger@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>
Right now, the qmake project manager offers a "Build" context menu entry
for .ui.qml files and various other things are off because the mime
types are different.
Change-Id: Icc966e56513b9c5aed05f929dc8cb728ed408723
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Fix soft assert when accessing the lone project file node in a project
that failed to parse.
Change-Id: I73d9b0012292dd5516a0a9c81cdc4003eebf2a92
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
That should save some memory per node, and since creator has a lot of nodes
(e.g. opening the LLVM project adds about 1 000 000 nodes) this should be
noticeable:-)
Calling update inside ProjectTree::currentNode() and rename it to
findCurrentNode() to make sure it is an still existing pointer.
Also, try to reduce the somehow more expensive currentNode() calls
and sprinkle some const around that usage.
Change-Id: I6a7c5db01a71d53d39544d3013cad557d5b96cdc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This is useful for buildsystems to provide quick access to interesting locations,
e.g. related to the targets they define.
Change-Id: Ia23534ccaf15ae63b38354c563907c594ad6879c
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Do not use VcsManager's cache of version control systems from different
threads.
Iterate over all IVersionControls instead of getting the specific version
control for a directory. This is less exact, but will probably not hurt users.
Task-number: QTCREATORBUG-18258
Change-Id: Iae2be5735a0d7ecc8d774904f6681963fca1d114
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
We have complex nodes like the ResourceTopLevelNode which can be generated.
Change-Id: Ifdbe72323b668961c50252f597a0bf67ec41f30b
Reviewed-by: hjk <hjk@qt.io>
Nodes are QObjects (still), so they should not have a copy constructor.
Change-Id: I1b20663ee0ec121cda4d39ced7a9f204fb4621a1
Reviewed-by: hjk <hjk@qt.io>
Iterate over all nodes in the whole tree, not just the FileNodes
of the children of the current node.
Change-Id: Ib8bf0eaecb2b13bd01dbc61417b83d0873ab6527
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
If some ProjectNode doesn't override supportsAction (like CMake), then the
fallback is FolderNode, which calls the root project node again...
Change-Id: Ie7a469d6aaaae38c8c2ff56e33fed27cf1477b49
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Getting the full list for a node can get quite expensive e.g. in
cases of recursive calls of QMakeProjectManager::findPriFile.
However, the FlatModel needs to decide quickly on whether an item
is editable to potentially allow renaming.
So split up QList<Actions> supportedActions() into individual
bool supportsAction(action) calls and make sure Rename is not
on the critical path.
Task-number: QTCREATORBUG-17953
Change-Id: I31841847f8aa7d7b94c63d76ce71efb1c930fa69
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
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>
Enable adding nested nodes not a child of the top level node.
Change-Id: Ia6bb4ed6e3e6649a98151c88133ff5ec7197573d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Do not compress foldernodes that differ on their type. This makes it
possible to use FolderNode::compress() in one more place in CMake.
Change-Id: I4721d5d12e3032ee70a1c3d9e87df49d59751f04
Reviewed-by: hjk <hjk@qt.io>
Instead, get root project nodes directly from the project.
Change-Id: I5cf95a7dce1fa29c1adc26013ad03cc017f38a6d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Report VCS topics when the top level project node is a file or
a directory.
Task-number: QTCREATORBUG-17498
Change-Id: Ie20109b228afc79bfc2ac21505a8798d9fd5efd6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>