Commit Graph

206 Commits

Author SHA1 Message Date
hjk
93257a56a0 QmakeAndroid: Replace remaining AndroidQtSupport
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>
2018-12-20 13:13:51 +00:00
hjk
f2bade30cf ProjectExplorer: Introduce a FolderNode::findProjectNode()
And use it.

Change-Id: Iaf13c4661e397bdb4d756c352683b696e337c8af
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-18 14:59:40 +00:00
hjk
ee564b2249 ProjectExplorer: Add a convenience function to walk project nodes
... recursively.

Change-Id: I44a7e29867c26e2586d04fd8d6c16990ce047c6d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-28 12:36:40 +00:00
Ivan Donchevskii
1442a1186d ProjectExplorer: Fix typo in findNodes
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>
2018-11-01 09:13:21 +00:00
Orgad Shaneh
2f6c6b632c ProjectExplorer: Remove versionControls argument from scanForFiles
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>
2018-10-02 06:59:56 +00:00
Christian Stenger
ce12c239ff ProjectExplorer: Fix replaceSubtree for project nodes
Ensure to keep node alive as long as needed.

Task-number: QTCREATORBUG-20616
Change-Id: I57a720d3e31e14bcb8388de5fef68f70db370c90
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-27 13:09:00 +00:00
Tobias Hunger
2df36926f5 CMake: Use FolderNode::addNestedNodes for unique_ptr in server-mode
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>
2018-05-04 09:03:15 +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
b57ce2d7a6 ProjectExplorer: Fix crash on replaceSubtree
Do not double-free oldNode.

Change-Id: Icce2d13b6afd24f2e37c5ca7e2b572a6784e69e1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-03 09:02:48 +00:00
Tobias Hunger
6fbf0255eb ProjectExplorer: Remove FolderNode::addNode taking a raw pointer
Change-Id: I53b765d2c3e71889386c76425662bfcc47bdf582
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:29 +00:00
Tobias Hunger
8bbe795c39 ProjectExplorer: Make FolderNode::replaceSubtree take a unique_ptr
Change-Id: I8e853c00ec24838bdca342e3f1a1b1213f32ef93
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:21 +00:00
Tobias Hunger
d332954567 ProjectExplorer: Add and use addNestedNode(...) that takes unique_ptr
Change-Id: Ieb26721d053111fb350494e31d1f6da3fe642420
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:15 +00:00
Tobias Hunger
147e6078ad ProjectExplorer: Make FolderNodeFactory return an unique_ptr
Change-Id: I9b611c4a3ff0928b2078dc30a44eb39df67c8d89
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:47 +00:00
Tobias Hunger
04057106ba ProjectExplorer: Remove FolderNode::removeNode
Use takeNode instead.

Change-Id: I7e05c4ba7c18aaabcdad5160f91a2c2ad754b758
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:40 +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
ad8a6cc0e6 ProjectExplorer: Do not use QFlags
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>
2018-04-26 12:42:38 +00:00
hjk
e20d620043 ProjectExplorer: Let RunConfiguration declare what nodes it belongs to
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>
2018-03-16 09:55:03 +00:00
Tobias Hunger
f044e69f67 ProjectExplorer: Remove obsolete functionality
Change-Id: Iea9b50c0bf9d855fb039a30062e26f8d6f3bc321
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-15 14:04:16 +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
Ulf Hermann
e902980dde Treat .ui.qml mime type the same as .qml
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>
2017-10-18 08:11:42 +00:00
Tobias Hunger
95bd5b0d68 ProjectTree: Fix soft assert
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>
2017-10-17 08:17:02 +00:00
Eike Ziller
ddd9e96afa Merge remote-tracking branch 'origin/4.4'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/libs/utils/utils-lib.pri
	src/plugins/clangcodemodel/clangbackendipcintegration.h
	src/shared/qbs

Change-Id: I240e89afc76d8f40ce69d66683014b603f714707
2017-08-23 12:12:41 +02:00
Robert Loehning
b9167a192f ProjectExplorer: Don't hide empty resource files like empty directories
Task-number: QTCREATORBUG-18748
Change-Id: I4de59743c42b99ce0b402f814b4cd0ba5d299338
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-08-18 12:28:45 +00:00
Eike Ziller
d8fd5292f1 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/tools/clangbackend/ipcsource/clangiasyncjob.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.h

Change-Id: Ib8602530663813ade418f995dfd2a736908cfe75
2017-08-15 10:07:51 +02:00
Tobias Hunger
68768d8e61 CMake: Get rid of <Source Directory> in server-mode
Change-Id: Ifa4f813d577ab64351d25eb4be1dc7981687da23
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 13:33:56 +00:00
Tobias Hunger
45046f7071 ProjectNodes: Do not derive Project Nodes from QObject
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>
2017-08-01 11:24:53 +00:00
Tobias Hunger
7afae6b4fd ProjectNodes: Allow to specify a list of extra locations for FolderNodes
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>
2017-07-21 12:49:07 +00:00
Tobias Hunger
bc22de5f0a ProjectExplorer: Do not use version manager cache in threads
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>
2017-06-20 14:24:02 +00:00
Orgad Shaneh
7a3eb71cf7 ProjectExplorer: Minor cleanup
Change-Id: I9388053eafae661bb16c75917ca8cc738df8b3c1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-05-22 10:29:14 +00:00
Tobias Hunger
6dc6eb9ad0 ProjectNodes: Make FolderNode::replaceSubtree safer
Make it safe for an existing note to replace itself.

Change-Id: I8ce04ea45cb851c814b9efbc7d8490c5fb44150e
Reviewed-by: hjk <hjk@qt.io>
2017-05-18 09:19:11 +00:00
Orgad Shaneh
3fe9765073 ProjectExplorer: List sub-project (like pri) files in the locator
Change-Id: Ic501ba0af8bba4589cba62d78f0ef62cd5f5d46f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-05-09 11:43:00 +00:00
Tobias Hunger
d056df2c15 ProjectNodes: Fix crash in FolderNode::addFileFilter()
Task-number: QTCREATORBUG-18160
Change-Id: I1b8fe9f949ca9aa04858321317ebb13eb01236ab
Reviewed-by: hjk <hjk@qt.io>
2017-05-08 12:54:12 +00:00
Christian Stenger
face7b13cd ProjectExplorer: Fix compile for Qt5.6
Change-Id: I259dd516a9b28e34a256321e8ac754f4215205a7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-05-04 12:26:19 +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
4593092649 ProjectNodes: Move isGenerated from FileNode to Node
We have complex nodes like the ResourceTopLevelNode which can be generated.

Change-Id: Ifdbe72323b668961c50252f597a0bf67ec41f30b
Reviewed-by: hjk <hjk@qt.io>
2017-05-04 09:16:42 +00:00
Tobias Hunger
cea68a3fe3 ProjectNodes: Use a set of flags for bools in Node
This has the potential to save some space per node.

Change-Id: I2b8b65c13b355e680965bb7307f9e8d8714dae64
Reviewed-by: hjk <hjk@qt.io>
2017-05-04 09:16:36 +00:00
Tobias Hunger
175643fd7e ProjectNodes: Do not define a copy constructor for FileNode
Nodes are QObjects (still), so they should not have a copy constructor.

Change-Id: I1b20663ee0ec121cda4d39ced7a9f204fb4621a1
Reviewed-by: hjk <hjk@qt.io>
2017-05-04 09:16:27 +00:00
Tobias Hunger
1d160fb7d9 ProjectNodes: Fix forEachGenericNode
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>
2017-05-04 09:15:55 +00:00
Orgad Shaneh
b1180280d0 ProjectExplorer: Fix infinite recursion
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>
2017-04-07 08:44:34 +00:00
hjk
bd5e2faa75 ProjectNodes: Handle supported actions one-by-one
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>
2017-04-05 12:47:03 +00:00
Tobias Hunger
5afc149b69 ProjectExlorer: Match filenames only to find filetypes
Do look at filenames only to decide which filetype a file is.

Change-Id: Ie64ad0a91df1ddd22c1cec4089f2611030560f3e
Reviewed-by: hjk <hjk@qt.io>
2017-03-30 11:36:57 +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
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
54be52a4fa ProjectNodes: Enable nested nodes outside of the top level node
Enable adding nested nodes not a child of the top level node.

Change-Id: Ia6bb4ed6e3e6649a98151c88133ff5ec7197573d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-27 11:53:29 +00:00
Tobias Hunger
e8498acde0 ProjectNodes: Be less enthusiastic about compression opportunities
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>
2017-03-24 17:41:07 +00:00
Tobias Hunger
b302eb2d0f ProjectNodes: Avoid QFileInfo
Avoid creating an unnecessary QFileInfo object.

Change-Id: Ibd85ccdf948872c2505085aa04cc5525d25c4d29
Reviewed-by: hjk <hjk@qt.io>
2017-03-24 17:40:58 +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
hjk
8b8ba51ef3 ProjectNode: Let add/removeSubprojects operate on single files
That's the only way that is used.

Change-Id: I57e7942f9dccf74ff7588c3bca0ccf05f528a3df
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-20 10:56:34 +00:00
Tobias Hunger
a8f64bd1b9 ProjectNodes: Do not crash when adding a nullptr as a node
Change-Id: Ic75ddbf3bd6b72779342e53ea73f7622f6ce2823
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-03-16 14:26:01 +00:00
Tobias Hunger
831864c56c ProjectExplorer: Report VCS topics in all cases
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>
2017-03-15 10:28:23 +00:00