aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/projecttree.h
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Rename FileName to FilePathhjk2019-05-281-3/+3
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Rename ProjectTree::findCurrentNode to currentNodehjk2019-04-301-1/+1
| | | | | | | | For consistency, it's straight forwards access, similar to currentProject, not much to search and find. Change-Id: I7ce696bdc24b6a8713d6f11e02443a6f94c605f6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CompilationDatabase: Ask for the root path and scan for headersIvan Donchevskii2019-04-051-0/+2
| | | | | | | | | | | | | | | Let's use the same approach we have for CMake projects by using the same TreeScanner class. Compilation database does not have a concept of the root directory so let's show a file dialog and ask for it the first time the project is loaded. Next times we open it we take this path from settings. This root path can later be changed from the project tree context menu. Fixes: QTCREATORBUG-22031 Change-Id: I151aed8d0504b2e8aa14aa774cad25f8c86d5c17 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Allow users to quickly expand the project treeChristian Kandeler2019-01-161-0/+1
| | | | | | | | | ... by adding an "Expand All" action to accompany the existing "Collapse All" one. Fixes: QTCREATORBUG-17243 Change-Id: I84e185562ee4c62ede7d0dc40f0d296020c4f0ea Reviewed-by: hjk <hjk@qt.io>
* ProjectTree: Take const Node* to look up project based on nodeTobias Hunger2018-08-301-1/+1
| | | | | Change-Id: I79e6008c93f7adcf295031767ba6f6d931cb8ae0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ProjectExplorer: Use override consistentlyTobias Hunger2018-05-071-1/+1
| | | | | | | clang-tidy fixes from modernize-use-override check. Change-Id: I216701aec0b4134321e220f9e599e053a8e22945 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Session: Move all functionality related to Nodes into ProjectTreeTobias Hunger2017-12-121-1/+4
| | | | | | | | Do no longer expose Nodes from the SessionManager's API. These are now exclusively handled by the ProjectTree. Change-Id: I585c2ac919462073870363436e767640775d9045 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Add "Rename" to file system viewEike Ziller2017-11-301-0/+2
| | | | | | | | | Renames the file on disk, notifies editors, and tries to change the file in all open projects that had it (and support renaming). Task-number: QTCREATORBUG-19209 Change-Id: I165e9468c7235f9f503a3820bda3eb00f3c086d0 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Project tree: Make code for diff against current file reusableEike Ziller2017-11-131-0/+3
| | | | | | | | The same functionality should be available in the file system view. Change-Id: Ib31cb84924e767ebe06f595bf638a5e674d4f8b5 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* ProjectTree: Clean up connectsTobias Hunger2017-10-191-0/+1
| | | | | Change-Id: Ib9adb893b804db868625331ecae71b6188cc9d25 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.4'Eike Ziller2017-09-041-0/+5
|\ | | | | | | | | | | | | Conflicts: src/plugins/projectexplorer/projectexplorer.cpp Change-Id: I7881fc51021c49b792a384ad9f8a4f71fc457ce2
| * Wizards: Do not crash when adding files to existing projectv4.4.0Tobias Hunger2017-09-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not crash when adding a file to an existing project that finishes parsing while the wizard is still open. Make sure the Node that is passed into the wizard is still valid after parsing. Provide more information to the wizard so that this can be checked -- and to find the similar node in the new project tree. Also avoid a crash when adding existing files. Do not crash when project parsing finishes while the wizard summary page is open. Do not crash when the project gets closed while the summary page is open. Do not have the ProjectTree send signals about subTreeChanges if the node that changed is not part of the ProjectTree. This avoids an infinite loop when updating the combobox on the summary page. Add a treeChanged signal to ProjectTree. Task-number: QTCREATORBUG-18651 Change-Id: Iaed3d0d1f079c09e54389821a11bda596139f35c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | ProjectNodes: Do not derive Project Nodes from QObjectTobias Hunger2017-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ProjectTree: remove indirections and rename methodsTim Jenssen2017-07-311-3/+2
| | | | | | | | | | Change-Id: Ia529bd7c199af2943f6c3da7d25352619da5a7f8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | ProjectTree: remove not used invalidCurrentNode argumentTim Jenssen2017-07-311-2/+2
|/ | | | | Change-Id: I31f5c5e8218620b469e568d22a9fa00c49f151ad Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectManager: Remove SessionNodehjk2017-03-211-3/+3
| | | | | | | Instead, get root project nodes directly from the project. Change-Id: I5cf95a7dce1fa29c1adc26013ad03cc017f38a6d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectTree: Add a way to register managers for subtreesTobias Hunger2017-03-101-1/+7
| | | | | Change-Id: I4694bb7dbe75b67946cdb5d8ca8b5a3ff1e40659 Reviewed-by: hjk <hjk@qt.io>
* ProjectTree: Make requirements for subtreeChanged more strictTobias Hunger2017-03-101-2/+2
| | | | | | | Only accept FolderNodes, those are the only ones that trigger this. Change-Id: Ia7aefdcb5aa04868458cc4dd4d9b7c28512c711f Reviewed-by: hjk <hjk@qt.io>
* ProjectNodes: Remove no longer necessary signalingTobias Hunger2017-03-101-5/+2
| | | | | | | | 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>
* ProjectNodes: Introduce FolderNode::replaceSubtreeTobias Hunger2017-03-101-0/+2
| | | | | | | Introduce FolderNode::replaceSubtree incl. necessary signalling Change-Id: I57762cd24a2986d3a04d0de6b794c1f6c772dbe6 Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Remove arguments from node change signalshjk2017-02-241-1/+1
| | | | | | | | This discourages storing the pointers needlessly. The items are still easy accessible by the static ProjectTree::currentNode() Change-Id: I3c0cd019e9fdc382afacbc9d9de3b97d5f58ae1e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Make the FlatModel a Utils::TreeModelhjk2017-01-251-57/+5
| | | | | | | | | | | | | | 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>
* ProjectTree: De-duplicate functionalityTobias Hunger2016-12-211-1/+0
| | | | | Change-Id: I465e07c0764ca3dcbf6a6082670b140eb2b01374 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* ProjectExplorer: Delete all the widgets when deleting the project treeUlf Hermann2016-05-301-0/+1
| | | | | | | | Leaving them around is dangerous as they rely on the tree to be valid. When unloading the plugin the ProjectTree instance is deleted. Change-Id: Iea6524b0c57c469045cb35f3cd2f376e579b8a57 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Projectexplorer: Modernize codebaseTobias Hunger2016-04-151-7/+7
| | | | | | Change-Id: I4793b58aa77bcd46af99f8b843c0f7439cdc9269 Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com> Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
* ProjectExplorer: ModernizeTobias Hunger2016-02-031-4/+2
| | | | | | | | | * Use override where appropriate * Use pragma once * Make more constructors explicit Change-Id: I2865fe10f288e3de570826058e43b70a0cb4ee37 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Open Project: Don't show a error dialog for duplicated projectsDaniel Teske2015-08-241-0/+2
| | | | | | | | | | | | Instead, switch to edit mode, show sidebar, scroll to project, and show a tooltip next to the project. The tooltip is somewhat easy to miss, but this is a clear improvement in most cases. Change-Id: Icd27f76e7d434f33e731b6fd56473ff913986a89 Task-number: QTCREATORBUG-8422 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* ProjectTree::currentProject: Introduce a fall back to startupProjectDaniel Teske2015-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | If no node is selected, e.g. no document is open, the ProjectTree currently claims that there is no current project. This adds a fallback to startup project in that case. This especially fixes the case where only one project is open and as such it is clear from context which project the user expects to be current. Revert a few places where I implemented this fallback manually. I do not like this. If multiple projects are open, this fallback can be surprising and not what the user wants. Everything works fine in the simple case with one project open but breaks with multiple projects open, this actively hides bugs. Change-Id: I6259834ca2220dd83bdffb16c3a0eac8f98e504b Task-number: QTCREATORBUG-14394 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Optimize ProjectTree for adding folders/filesDaniel Teske2015-03-091-0/+3
| | | | | | | | Instead of searching the whole tree for the current node, only check the newly added files/folders. Change-Id: I015a955815223767367c4cad476d0620f69abd71 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Fix default wrong directory if no files are open in the editorDaniel Teske2015-01-191-0/+1
| | | | | | Task-number: QTCREATORBUG-13831 Change-Id: Iaeb11014ed16bc9f08d7c12d81c1b7b8a4163d21 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* ProjectTree: Fix context menu actionsDaniel Teske2015-01-151-0/+9
| | | | | | | | | | | | | Opening the context menu would move the focus, which then would reset the current node/project to come from the DocumentManager. So move the context menu handling code to the ProjectTree class and ensure that while it is open, the corresponding ProjectTree is considered the focused widget. Task-number: QTCREATORBUG-13684 Change-Id: I8b3dc410f5f5bc5e9a2dd663421b22cf3f147190 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* ProjectTree: Fix signal emissions for nodes that are not yet mappedDaniel Teske2015-01-151-5/+7
| | | | | | | | | | | | | | | | | The Generic Project Manager builds the tree from the bottom to the top. Previously no signals were emitted while doing that since the watchers were added on adding the top level node at the end. With the new ProjectTree that leads to lots of signals, and leaves the FlatModel confussed, as that expects the nodes to be already in the hierarchy and crashes otherwise. Restore this behavior by checking if the affected nodes are in the hierarchy. Change-Id: I832b348867a8abad2afef11297b44f058592cb1d Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
* Refactor ProjectExplorer::Node and remove NodesWatcherDaniel Teske2015-01-141-20/+57
| | | | | | | | | | | | | | | | | | | | | | | The idea behind NodesWatcher was that it was the central place to catch node related signals, so that users didn't need to connect to each individual node and the nodes didn't need to be QObjects. Somehow Nodes ended up being QObjects anyway. Both the recently added ProjectTree and the FlatModels consume the signals the NodesWatcher sends. Unfortunately there's a ordering dependency between the ProjectTree and the FlatModels. This patch removes all NodesWatcher and instead makes the ProjectTree singleton the emitter of various project tree related signals. The ProjectTree also ensures that the ordering between the FlatModel and itself is taken into account. And it makes Node not derive from QObject, saving some memory in that process. Task-number: QTCREATORBUG-13756 Change-Id: I8b0d357863f1dc1d2d440ce8172502594138b9fb Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* ProjectExplorer: Fix compile for Qt version less than 5.4Christian Stenger2014-12-181-0/+6
| | | | | Change-Id: Ic2500d009d2195d19651ac691c42d55a612fde04 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* ProjectExplorer: Hotfix for crash on session switch.Christian Kandeler2014-12-181-1/+3
| | | | | | | | | | | | In ProjectTree::update() as well as in CurrentProjectFilter::currentProjectChanged(), there are crashes due to accesses to a pointer to a deleted project. Wrap the pointer in a QPointer to prevent this. May or may not be the correct long-term solution, but does fix the crash. Change-Id: I4182a4753578cc4765b9120a36cd8701d07c94c1 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Fix crash in ProjectTree on restoring a sessionDaniel Teske2014-12-171-1/+4
| | | | | | | | | | | On adding nodes to the node structure, both the FlatModel::nodesAdded and ProjectTree::nodesAdded code is run. We need to ensure that FlatModel::nodesAdded is run first though, as we need that information in the ProjectTree. Task-number: QTCREATORBUG-13667 Change-Id: I0b4b41ed6036cfdef668c16689d25611633ab0c9 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Clean up ProjectTreeNikita Baryshnikov2014-12-151-12/+7
| | | | | | | | | Denoise namespaces, remove redudant QObject include access to static instance in nonstatic method Change-Id: Ic54cd0da90e72a981394996fccd74053a11352e0 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Fix before exit crash in ProjectTreeDaniel Teske2014-12-101-1/+0
| | | | | | | | | When there are 2 top level projects in session, crash happens in foldersAboutToBeRemoved as currentNode() not properly updated and it points to previously unloaded dangling node. Change-Id: Ie3f88bdd03ec042ff1cce6712ed923465c902701 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
* Completely rework currentNode/currentProject handlingDaniel Teske2014-12-031-0/+107
Centralize the handling inside a new class ProjectTree. React to moving focus and remove most special handling. This properly fixes the linked task. Task-number: QTCREATORBUG-13357 Change-Id: I6b06aa32b1e4305ec8a6d432857b302585d8734b Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>