aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/projectnodes.h
Commit message (Collapse)AuthorAgeFilesLines
...
* ProjectExplorer: Add and use addNestedNode(...) that takes unique_ptrTobias Hunger2018-05-021-8/+8
| | | | | Change-Id: Ieb26721d053111fb350494e31d1f6da3fe642420 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Fix build for MSVCAlessandro Portale2018-05-021-0/+1
| | | | | | | (Done by Tobias) Change-Id: If85f64681986cf56f493fa448977a2da248e167d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Make FolderNodeFactory return an unique_ptrTobias Hunger2018-05-021-3/+7
| | | | | Change-Id: I9b611c4a3ff0928b2078dc30a44eb39df67c8d89 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Remove FolderNode::removeNodeTobias Hunger2018-05-021-1/+0
| | | | | | | Use takeNode instead. Change-Id: I7e05c4ba7c18aaabcdad5160f91a2c2ad754b758 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Use unique_ptr to hold ProjectNodesTobias Hunger2018-05-021-3/+4
| | | | | Change-Id: Iaa5bea221686564de24138a99b5fe0d09521c118 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Fix warning about nullptrTobias Hunger2018-04-261-2/+2
| | | | | Change-Id: Iaf1c30560d3ebe12430716808319d059431be30d Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Do not use QFlagsTobias Hunger2018-04-261-2/+1
| | | | | | | | 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>
* ProjectExplorer: Let RunConfiguration declare what nodes it belongs tohjk2018-03-161-3/+0
| | | | | | | | | | | | | | | | | | | 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>
* ProjectExplorer: Remove obsolete functionalityTobias Hunger2018-03-151-5/+0
| | | | | Change-Id: Iea9b50c0bf9d855fb039a30062e26f8d6f3bc321 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Implement support for project file open after AddFile actionPawel Rutka2018-02-231-1/+4
| | | | | Change-Id: I5f5372498a34760976cea5b7d6f5f49dd04558db Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectTree: Fix crash working with resourcesTobias Hunger2018-01-221-0/+4
| | | | | | | | | | | | 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>
* ProjectTree: Fix soft assertTobias Hunger2017-10-171-0/+2
| | | | | | | | 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>
* ProjectNodes: Remove unused memberTobias Hunger2017-10-171-1/+0
| | | | | | Change-Id: Iaeca64c025a870ce83f9d806fdd3e086599046d5 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Merge remote-tracking branch 'origin/4.4'Eike Ziller2017-08-231-0/+2
|\ | | | | | | | | | | | | | | | | | | | | 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
| * ProjectExplorer: Don't hide empty resource files like empty directoriesRobert Loehning2017-08-181-0/+2
| | | | | | | | | | | | Task-number: QTCREATORBUG-18748 Change-Id: I4de59743c42b99ce0b402f814b4cd0ba5d299338 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Merge remote-tracking branch 'origin/4.4'Eike Ziller2017-08-151-5/+10
|\| | | | | | | | | | | | | | | | | Conflicts: src/tools/clangbackend/ipcsource/clangiasyncjob.cpp src/tools/clangbackend/ipcsource/clangjobrequest.cpp src/tools/clangbackend/ipcsource/clangjobrequest.h Change-Id: Ib8602530663813ade418f995dfd2a736908cfe75
| * CMake: Get rid of <Source Directory> in server-modeTobias Hunger2017-08-041-5/+10
| | | | | | | | | | Change-Id: Ifa4f813d577ab64351d25eb4be1dc7981687da23 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | ProjectNodes: Do not derive Project Nodes from QObjectTobias Hunger2017-08-011-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ProjectNodes: Allow to specify a list of extra locations for FolderNodesTobias Hunger2017-07-211-0/+13
|/ | | | | | | | | 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>
* ProjectExplorer: Do not use version manager cache in threadsTobias Hunger2017-06-201-0/+8
| | | | | | | | | | | | 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>
* QbsProjectManager: Fix object files appearing in locatorChristian Kandeler2017-05-081-1/+2
| | | | | | | | This bug got re-introduced by commit fc5ce1e710. Task-number: QTCREATORBUG-17382 Change-Id: I6114ca8f4305b3c0e356f4849094ecb1ccca7601 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectNodes: add listInProject() to NodeTobias Hunger2017-05-041-0/+3
| | | | | | | | | 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>
* ProjectNodes: Move isGenerated from FileNode to NodeTobias Hunger2017-05-041-2/+3
| | | | | | | We have complex nodes like the ResourceTopLevelNode which can be generated. Change-Id: Ifdbe72323b668961c50252f597a0bf67ec41f30b Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Use a set of flags for bools in NodeTobias Hunger2017-05-041-1/+6
| | | | | | | This has the potential to save some space per node. Change-Id: I2b8b65c13b355e680965bb7307f9e8d8714dae64 Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Do not define a copy constructor for FileNodeTobias Hunger2017-05-041-1/+2
| | | | | | | Nodes are QObjects (still), so they should not have a copy constructor. Change-Id: I1b20663ee0ec121cda4d39ced7a9f204fb4621a1 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Fix infinite recursionOrgad Shaneh2017-04-071-0/+1
| | | | | | | | | 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>
* ProjectExplorer: Don't rebuild all projects' tree when one is closedhjk2017-04-051-0/+1
| | | | | | | | Removes some quadratic-in-number-of-projects behavior on session close/switch. Change-Id: If93bb9a67b0bebddda5319a7594a99ae66f50f5a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectNodes: Handle supported actions one-by-onehjk2017-04-051-2/+5
| | | | | | | | | | | | | | | | 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>
* ProjectExplorer: Fix enabling state of main project nodeshjk2017-03-281-2/+26
| | | | | | | | | | 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>
* ProjectManager: Remove SessionNodehjk2017-03-211-22/+1
| | | | | | | Instead, get root project nodes directly from the project. Change-Id: I5cf95a7dce1fa29c1adc26013ad03cc017f38a6d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectNode: Let add/removeSubprojects operate on single fileshjk2017-03-201-2/+2
| | | | | | | That's the only way that is used. Change-Id: I57e7942f9dccf74ff7588c3bca0ccf05f528a3df Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Move code to set up default project structureTobias Hunger2017-03-171-2/+2
| | | | | | | | | | 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>
* CMake: Fix some more SOFT-ASSERTS in CMake server-modeTobias Hunger2017-03-151-0/+3
| | | | | | | | | | | Fix two more SOFT-ASSERTs in CMake server-mode that could be triggered by complex projects. Move and simplify search functionality into FolderNode and use that instead of hand-crafting a custom tree search in CMake. Change-Id: If4bde5c4a7ff84c7d5dba4f595e99b39f54ac8aa Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* CMake: Fix projects with complex CMakeLists.txt layoutsTobias Hunger2017-03-151-2/+5
| | | | | | | This fixes soft assserts in e.g. Musescore. Change-Id: I860c8c184161e53918fb901d66b89cffb0c09e23 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* ProjectExplorer: Inline FolderNode::recursiveFileNodes()hjk2017-03-141-1/+0
| | | | | | | ... into its only remaining user. Change-Id: I5efa716ce34ba6a237dfcbcfebb257c863fdd21d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Add a FolderNode::addNestedNode() functionhjk2017-03-141-1/+2
| | | | | | | | | | | Also, rename buildTree() to addNestedNodes(), it's really adding things, not recompletely (re-)building the subtree. Use it whenever possible to avoid intermediate lists of items to insert. Change-Id: I5fde41e5b164a8a292410bd381a85f5efadf3471 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectNodes: Add method to query FileTypeTobias Hunger2017-03-101-0/+5
| | | | | | | | | Add methods to get the FileType based on filepath or mimetype. Use that method in treescanner. Change-Id: I3de50d7afd8262cc86ae722e7de4ca53921153d2 Reviewed-by: hjk <hjk@qt.io>
* FolderNode: Remove makeEmpty() againTobias Hunger2017-03-101-1/+0
| | | | | | | It is no longer necessary. Change-Id: Id044ace6f0861bc0fc659fb6d6823da1f0082bc9 Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Remove no longer necessary signalingTobias Hunger2017-03-101-3/+0
| | | | | | | | The project tree is updated in one go now, so there is no need to signal each and every change. Change-Id: I7d5829d688b406ee2e701a2aa004b9e8bb5870a9 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Create initial project treeTobias Hunger2017-03-101-0/+3
| | | | | | | | | | | 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>
* FolderNode: Add isAncesterOf(Node *)Tobias Hunger2017-03-101-0/+2
| | | | | Change-Id: I716593e7fd25f4acc31933e2f28273ced4674b73 Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Introduce FolderNode::replaceSubtreeTobias Hunger2017-03-101-0/+4
| | | | | | | Introduce FolderNode::replaceSubtree incl. necessary signalling Change-Id: I57762cd24a2986d3a04d0de6b794c1f6c772dbe6 Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Remove recursiveFileNodeTobias Hunger2017-03-101-1/+0
| | | | | Change-Id: Ibde61428517b187c84eca9293b17f8f665fb38ae Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Make folderNode(FileName) method inaccessibleTobias Hunger2017-03-091-1/+0
| | | | | Change-Id: Ie355ea8fd5e909e9c3e6e2630faabe366d02051a Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Make recursiveFindOrCreateFolderNode privateTobias Hunger2017-03-091-2/+0
| | | | | Change-Id: I43315f19d931bec0ad7b81d3c72a4e7486f70445 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Use visitor-by-lambda for project treehjk2017-03-081-4/+0
| | | | | | | | And inline it into user code. Less code in total and no intermediate node lists. Change-Id: I3724883408bfaa868266110aee27bbffd4d96bd8 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* ProjectExplorer: Remove some unneeded declarationshjk2017-03-011-6/+0
| | | | | Change-Id: Ie5bab9205692748f7913c58b5478b2e6d072df4b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* ProjectExplorer: Remove Node::asSessionNode()hjk2017-02-231-5/+0
| | | | | | | | The only remaining uses could be removed or replaced by a check for no parent node. Change-Id: I13eba8ae418cf3d404bb3df7d389d72091af38d7 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Remove FolderNode::projectNodes()hjk2017-02-231-3/+0
| | | | | | | Merged into the using code now. Change-Id: I4b39998799dde530ab48c504ac2a389d72705c4f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectNodes: Add setter for addFileFilters to VirtualFolderNodesTobias Hunger2017-02-171-0/+6
| | | | | Change-Id: I8a52798546b75f001c5ee447eee6024b06b0d287 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>