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>
Simplifies the implementation and is the only way used.
Change-Id: Ie3ac1cb66ae7fb85e3d6358a01975ba2e857ab6c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The FlatModel is essentially a proxy model keeping expansion and
filter state per ProjectTree(View). Using a Utils::TreeModel makes
it fast enough to allow recreation of the proxy structure on
structural changes simplifying the parent/child logic significantly.
The {Session,Project,Folder,File}Node hierarchy still is still primary
information and shared by all views.
Change-Id: Ic08180a19bda37908280ff30e0737d188ed93e92
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This makes sure they need to copy whatever they need.
Change-Id: I767ac0c5f54ca1f9f46acdefe4bd7fea35657312
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Make priority available on all FolderNodes. Make the sort order
of all kinds of FolderNodes check the priority.
This allows no reorder e.g. ProjectNodes as needed.
Change-Id: I369edd28807ab9f89fb646b0001e1b3eb1a19d7e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
That information is used rarely, and is not too expensive to regenerate,
so there is no need to store and manage it for every node.
Change-Id: I2261853431cd4328ec447031de3b9f5d5347e796
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>