Commit Graph

191 Commits

Author SHA1 Message Date
Wojciech Smigaj
194569b471 ProjectTree: Add an option to hide Source and Headers file groups
A new checkbox "Show Source and Header Groups" is added to
the filter menu in the project tree. It is checked by default.

Unchecking it removes the extra level of virtual folders containing
sources and headers.

Change-Id: I25f4514e7f1f6cdfcb531a911e54cc6e7e42a3e2
Fixes: QTCREATORBUG-25313
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-24 05:24:26 +00:00
hjk
76db1e3746 Core: Add FilePath based overloads to EditorManager::openEditor{,at}
Part of the overall FilePath migration. Keep the original version for
a while to allow using code to catch up.

Change-Id: Ia7c5ea14416a06e679e8661c0e4045981db87b9b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 09:55:50 +00:00
hjk
11f574fef9 Core: Unify INavigationWidget creation a bit
Move toolbutton creation/listing closer to the widget.

Change-Id: I0e1342ede40fada1c5c9fb0b11d77852b78cc053
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 08:35:28 +00:00
Eike Ziller
16d25a3cc8 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/qmldesigner/assetexporterplugin/componentexporter.cpp

Change-Id: If742bcd843cf75cf55e07b489ecb7211f0cd9058
2021-01-18 11:50:32 +01:00
Eike Ziller
b83c829e21 Fix project tree's "synchronize with editor"
When for example closing all editors, the selection in the project tree
is removed, but after re-opening the previously selected file, the
selection was still missing.

Qt item views differentiate between "current" item and "selection". The
code uses the "current" item for tracking, but when clearing the
selection in the project tree, the code did not "clear" the "current"
item.

Change-Id: I182c7b78bf8dcc51af71e860ac620310d472b7b5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-12 14:43:53 +00:00
Eike Ziller
d204065660 Fix that file from project is selected in file system node
The new file system node in CMake projects leads to funny selections in
the project tree when "Synchronize with Editor" is turned on.
Since the file system items are less deep in the tree than the files in
the "regular" CMake project tree, they were selected instead of the
regular project nodes.

Reduce the selection priority for the nodes in the file system sub-tree.
For this remove the hard-coded priorities when selecting nodes for
"Synchronize with Editor" and use the existing node priorities.

Amends 53115259ba

Fixes: QTCREATORBUG-25208
Change-Id: I69c08c4f0e7afa305141a0c475af515d9db1363b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-12 14:43:26 +00:00
Eike Ziller
a052f1f715 ProjectTreeWidget: Use constants and get rid of QLatin1
Change-Id: Iaf155cf01ab502d411b0b5467abe4eff65c798ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-16 16:22:20 +00:00
Eike Ziller
c898047880 ProjectExplorer: Don't save defaults to settings
Writes less settings and makes it possible to change defaults in the
future.

Task-number: QTCREATORBUG-24762
Change-Id: I73873b3684827b4fe27cfa5ea2f62a76003f9750
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-16 08:40:24 +00:00
Eike Ziller
e5bb7d1ffe Remove unnecessary removeContextObject calls
They are removed on deletion now.

Change-Id: I08461ea4938e24ab450df013a0f8f820032381da
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 08:42:00 +00:00
Christian Kandeler
5451b78367 Project Tree: Add functionality to expand a single node recursively
From time to time, I find myself wanting to fully expand
a specific sub-tree.

Change-Id: Ie49b76a7a7a6fae3684bbdfb5735638bbc41b301
Reviewed-by: hjk <hjk@qt.io>
2020-02-20 09:56:31 +00:00
Orgad Shaneh
0737291d54 Merge remote-tracking branch 'origin/4.11'
Change-Id: I65ce6aa917219a8f8b91b48c7077f8097248375c
2020-02-06 12:50:22 +02:00
Orgad Shaneh
d2dff64cba ProjectExplorer: Fix endless waiting when switching to Git editors
Show, Diff etc.

Change-Id: Ibdd6e61c72a9a8fd797a02d15dae7b8be08b405c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-02-05 10:35:09 +00:00
Christian Kandeler
2c295905a9 Fix various leaks relating to use of Core::NavigationView
Change-Id: I8ba508b279376047bcf7ae17dbdadba70ec13582
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-27 09:12:52 +00:00
Christian Kandeler
20a5aa889f Revert "ProjectTree: Add per-node "Expand" and "Collapse" actions"
This reverts commit a5785e678e.
These actions are already available from the standard tree view UI...

Change-Id: If8dfe755ee450a89588ec944ae6ff7601250cdde
Reviewed-by: hjk <hjk@qt.io>
2019-12-20 13:09:19 +00:00
Christian Kandeler
a5785e678e ProjectTree: Add per-node "Expand" and "Collapse" actions
Change-Id: Ic722598f7bb2665ac7a09c24b7eefa9dc6787808
Reviewed-by: hjk <hjk@qt.io>
2019-12-20 09:37:57 +00:00
Eike Ziller
04bd6e39c8 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quick3dnodeinstance.cpp

Change-Id: I8ea57eba526ab830608fd928c28771c5441749f8
2019-11-01 15:31:19 +01:00
Nikolai Kosjar
6c1b11dd3e ProjectExplorer: Simplify
bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: Iaaac21e96a3e9db6b9819d77fdae623ede373e59
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-01 09:31:32 +00:00
Christian Kandeler
b8657ac739 Project Tree: Allow to hide disabled files
Project manager plugins can mark files as disabled, typically meaning
they are not part of the project in the current build configuration.
Let's allow users to hide such files altogether.

Fixes: QTCREATORBUG-22821
Change-Id: Ie92d523d1f895bee8076de1d7eea1d7a739fe11f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-10-22 13:42:03 +00:00
Christian Kandeler
087396fe00 ProjectExplorer: Support bulk renamings in project tree
If a user changes the name of a file abc.cpp to def.cpp, and there is a
file abc.h in the same directory, it's likely that the user wants to
rename that file to def.h. Detect such circumstances and offer the user
to automatically rename the sibling files.

Fixes: QTCREATORBUG-21738
Change-Id: Ib3ece08698a3341ef4087066d2289048f6b0fa61
Reviewed-by: hjk <hjk@qt.io>
2019-08-16 12:28:23 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Eike Ziller
39477594da Merge remote-tracking branch 'gerrit/4.9' into 4.10
Change-Id: I033d6baa40af45ae1eb6ed82827ff51213c832f5
2019-06-13 13:53:02 +02:00
Tobias Hunger
f3ea8e34de ProjectTree: Save state of "Hide Empty Directories" filter
Change-Id: Iafd7248242e95dc0d5205649747f46d98e05873d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-13 11:48:49 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
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>
2019-05-28 12:23:26 +00:00
hjk
a5148b5363 ProjectExplorer: Rename ProjectTree::findCurrentNode to currentNode
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>
2019-04-30 17:10:39 +00:00
hjk
b0e125ac11 ProjectExplorer: Move Node::nodeType implementation
... to the only remaining user, and rename it there.

Change-Id: I0bdb3179282e323f5ad7b41d034bb5f3db8f6ffc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-04 09:25:50 +00:00
hjk
729c74379a ProjectExplorer: Merge Node::isFileNodeType and asFileNode
They were identifying the same set of nodes.

Change-Id: I3316cbc434ff740547bcf0baf9e5f1544f6e3f56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:44:22 +00:00
hjk
ad4e2562fa ProjectExplorer: Replace Node::setNodeType by virtual functions
Not the usual direction of change, but currently there are
several systems to identify or invoke node functionality.

Virtual functions are likely to stay in this context, so this
here attempts to help consolidation by reducing the influence
of the node type flags, hopefully leading to full removal
by making remaining functionality available through the
other mechanisms (virtual functions, asFooNode() 'casts',
less so the FileType flag).

Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:32:14 +00:00
Christian Kandeler
4079dd5cbc ProjectExplorer: Support Drag and Drop in the project tree
E.g. moving a file from one pri file to another is much simpler for the
user now.

[ChangeLog] Source files can now be drag-and-dropped between project
nodes in the project tree.

Fixes: QTCREATORBUG-6446
Change-Id: I8bd4a7588fc5f2830f6585dfcb54ab4a547bc6b0
Reviewed-by: hjk <hjk@qt.io>
2019-02-15 16:02:40 +00:00
Christian Kandeler
29e20e369b ProjectExplorer: Allow users to quickly expand the project tree
... 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>
2019-01-16 13:10:02 +00:00
Eike Ziller
8e05783019 Merge remote-tracking branch 'origin/4.7'
Change-Id: I4332eba9f1f66fef185359c79c4d96420d8b78ca
2018-08-30 08:31:25 +02:00
Eike Ziller
7b6ea357f6 Avoid shortcuts with "Alt" on macOS
On macOS shortcuts with "Alt" are used for entering special
characters, where "special" depends on keyboard layout and can
mean e.g. '|' or '~'.

Task-number: QTCREATORBUG-20873
Change-Id: Ifa70b95381ef48d2ba3b15a528a5dcfe43d53bfd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:52:44 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
Eike Ziller
29dd67f45e Don't select file extension when renaming resource files
Resource files would not get the handling like files do, because they
are folder nodes.
For folders, if they provide the rename functionality at all, the file
extension can have similar influence on the type of folder like it does
for files (e.g. ".app", ".framework"), so just remove that restriction.

Task-number: QTCREATORBUG-20057
Change-Id: I3802f17695da9d323d4d60c14ecef5c39aeef576
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-13 10:39:20 +00:00
Tobias Hunger
f7a0a3cd26 ProjectTree: Do not use disabled state for disabled nodes
Rendering disabled nodes using the disabled state in the painter
breaks themes as it introduces a discrepancy between the actual
state of the node and its graphical representation.

IIRC this was introduced since there was no easy way to find what
color was supposed to be used for disabled items. That is no longer
the case, so let's clean this up.

Change-Id: Ic5653cd970e07eb680cb1d28d1feefd70aded540
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-09 14:58:42 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
Alexander Akulich
48a68851fc ProjectTree: Select only (complete) file basename on rename
Change-Id: I29effc5f61fbaa214d7a1a01d92de5d5a726cec4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-09 11:52:05 +00:00
Alexander Akulich
783b310ee6 ProjectTree: Refactor editCurrentItem()
Change-Id: Id848b608e256b95e9704d61d1926d05625106ecc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-09 11:51:58 +00:00
Eike Ziller
124e4499eb Merge remote-tracking branch 'origin/4.6'
Change-Id: I421af2d62994436782dab6d37e97622bd055ed44
2018-03-05 09:28:34 +01:00
Alessandro Portale
807c7c6380 utils: Let the link icon have a LINK and a LINK_TOOLBAR version
Change-Id: I910d491f7f5ac47c55c966f687b004c0e0793c5f
Change-Id: I910d491f7f5ac47c55c966f687b004c0e0793c5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-02 10:32:47 +00:00
Tobias Hunger
31f1713c75 ProjectTree: Do not register action more than once
Change-Id: I9d9c86694cd8066ba4be2a065805a3b52bc272ff
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-07 13:42:50 +00:00
David Schulz
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +00:00
Tobias Hunger
c7e4eee345 ProjectTree: Add command to manually sync current document and project tree
Add a command to manually sync the current document and the project tree.

Task-number: QTCREATORBUG-19625
Change-Id: I2423853ca1a876c6203a004b465adde949eb6c5b
Reviewed-by: hjk <hjk@qt.io>
2018-01-26 14:35:10 +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
ea867cd49a ProjectExplorer: Add option to hide empty directories from project tree
Together with the earlier fix for hiding generated files, this change makes
for a very clean CMake server-mode project tree:-)

Change-Id: Ib70fd66699eddf5d6e602f3f8848b31fd6d85b57
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 13:34:13 +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
f5beeb4c7e ProjectTree: Show parsing state of projects
Show which projects are currently parsing in the project tree.

Change-Id: Ie69907a73ec7c3cf2ef40c37db620a0144178f95
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-28 08:33:50 +00:00
Orgad Shaneh
eebac87be5 ProjectTree: Enable Synchronize with Editor by default
Changed by 4943510b60.

Change-Id: I359c4abd77009b22bc1a7143002563f66a3b5fd0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-17 14:28:30 +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
Serhii Moroz
69da534f99 TextEditor: add right sidebar
Task-number: QTCREATORBUG-9436
Change-Id: Ic0406758a30d52c22c58433f5f35305b798cb462
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-09 08:19:54 +00:00
hjk
d6df4492d0 ProjectExplorer: Use visitor-by-lambda for project tree
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>
2017-03-08 09:05:29 +00:00