... to the only remaining user, and rename it there.
Change-Id: I0bdb3179282e323f5ad7b41d034bb5f3db8f6ffc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
They were identifying the same set of nodes.
Change-Id: I3316cbc434ff740547bcf0baf9e5f1544f6e3f56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
Show which projects are currently parsing in the project tree.
Change-Id: Ie69907a73ec7c3cf2ef40c37db620a0144178f95
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Instead, get root project nodes directly from the project.
Change-Id: I5cf95a7dce1fa29c1adc26013ad03cc017f38a6d
Reviewed-by: Tobias Hunger <tobias.hunger@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>
Better encapsulation and potentially more than one view on the model.
Change-Id: I45657484a68eba61b3987d324cf1542704ffd61c
Reviewed-by: Christian Stenger <christian.stenger@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>
Use a class enum with a type quint16 for the NodeType. Frees 2 bytes
per node that can be used for better things now.
Change-Id: Ib84bf8629e9f4a5fb0793355eff0f0d6302167dd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This way we can use them from libraries, not only from plugins.
Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
It is unused. Also remove singleProjectAdded signal, and replace
the only use with the projectAdded signal.
The singleProjectAdded signal was emitted for each project that was
ever added, simply because nobody ever used addProjects(...) with
more than one project.
Change-Id: I5aee315c64a2cfb721471d580989a6a02d44fefc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Instead of describing icons via file name or in the themed icons case
via
a string that is a list of mask/color pairs, we have now a class for it.
Icons are now listed in per-plugin *icons.h headers.
RunControl::m_icon was The only place left where an icon property was in
fact a string. This patch changes that member to be a Utils::Icon.
Change-Id: Ibcfa8bb25e6d2e330c567ee7ccc0b97ead603177
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
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>
On each resize event the treeview iterated over all rows to get the
maximum width of them. That involves text layout and is very slow
with bigger trees.
So cache the size hint for the column and connect to all signals
that can potentially change the size hint.
Change-Id: I83a13982848df56515fed8225ced336096370546
Task-number: QTCREATORBUG-8075
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
So far the code only saved the path of the expanded nodes, which always
created problems for nodes that had the same path. This broke for the
virtual folders SOURCES, FORMS, HEADERS recently because they have
nowadys the same path. They used to have different paths.
This new code saves both the path and the displayname and compares that,
this fixes the expanding for those folders.
Obviously there is no sure way to indetify the right nodes to expand,
and this isn't backwards compatible.
Change-Id: I9854f90ca942f92420970765b0cc19138ad5d63d
Task-number: QTCREATORBUG-14304
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
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>
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I1d05d48b23f44e3d589cc2a790803714786b57d2
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>