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>
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>
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>
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>
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>
This moves ownership of the project's root node from the
project into the project tree!
Change-Id: I84eba884bd63b44e56c75023d8bf12caf5cc2833
Reviewed-by: hjk <hjk@qt.io>
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>
Do not call makeEmpty() as part of buildTree(). That makes it
impossible to combine buildTree with manual tree setup.
Change-Id: If0a0d9432fe39870917a6ba31594e8dcd6d31868
Reviewed-by: hjk <hjk@qt.io>
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>
Similar to what is used in Utils::TreeModel: Use lambdas
as "visitor".
Change-Id: Ia6e1a7ec022b61f94b01e1e8476bb932d22fd161
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Add a method to FolderNode that compresses a tree of folders like
A/B/C/file.txt into one FolderNode (A/B/C) and a FileNode (file.txt)
Change-Id: I5efa038c33b91ea01017269daa048ba101085d01
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Treat absolute paths more intelligently in FolderNode::buildTree: Add
them with their absolute paths instead of endless sequences of ..
Change-Id: I9d644588f91f1792f997dedfb20e68d210b9cf73
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This fixes the second regression introduced by 04a525877b.
Change-Id: I5c5c72a036f139fa564c40e95ebf6acafc99792c
Reviewed-by: Mathias Hasselmann <mathias.hasselmann@kdab.com>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
One step closer to direct use of Utils::TreeNode.
Change-Id: Icd0dfd2fa4d12c2572a68f61ae43c5e906956a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Only one line saved, but potentially less hassle should FolderNode::makeEmpty
ever change.
Change-Id: I4dd01179a8dce9735744991c3de080739ab693ae
Reviewed-by: hjk <hjk@qt.io>
... and remove ProjectNode::removeProjectNode, as this was the
only remaining user.
Change-Id: I2c53392a8e9dacf956270d652525b62ba4c9e0a4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Drop the list sorting and difference generation which is not
needed in the "build from scratch" setup.
This also removes some of the intermediately introduced
convienience functions and fixes a regression that led to
missing project files.
Change-Id: I39d1966324917f466fb347da3a52552393ca4a01
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... instead of having to remove/add. Use it in some places
in QmakeProjectManager and the ResourceEditor where the
(sub)tree is rebuild anyway.
Change-Id: I46b3c078c576b72dba6e87432570d030b7572026
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>