Handle root directory properly (a empty filePath in the base node) when
creating folder nodes in the project tree.
Change-Id: Iad761b94ee210406ed5ab9ceb2d00ce25db90046
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Add some methods to look up different kinds of nodes in the
project tree.
Change-Id: Ia91844b45c2a124dc01771297e1f5c414d84e7cb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Never delete the base folder node when using buildTree to set up
a tree of files in the project tree. This makes sure the node stays
around, even when it turns empty. This matches how buildTree is used
in our code.
Change-Id: Id2a589985d9ac704316db5f210232532dcdb5d58
Reviewed-by: Tim Jenssen <tim.jenssen@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 is useful for several project types, so do this properly in
ProjectExplorer.
Change-Id: Ic659ff6824daffaeb441e11f5072d496194d48fe
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Add helper code to FolderNode that enables the creation of a tree
of File- and FolderNodes from a FolderNode and a list of FileNodes.
Change-Id: Iba4b6a768fc3d0501851f141372e7e34913ba518
Reviewed-by: hjk <hjk@qt.io>
Allow foldernodes to specify which files they care for when doing
"Add Existing Directory". Before we used a fixed list with C++ header
and source files, which does make no sense for e.g. adding to resources.
Task-number: QTCREATORBUG-15278
Change-Id: I15dad133391485c2bcebd2d864623304b31b5f8f
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
before renaming the file.
This adds a new api:
FolderNode::canRename(oldFileName, newFileName) that asks the
project manager if a specific file renaming could be applied to
the project file.
Change-Id: I77bae56db06d81fd03e590285d6079abea2c514b
Task-number: QTCREATORBUG-14521
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Since a lot of derived classes can make use of those.
Change-Id: I051542e8d318476348d753de4d4c0a30b3a9ed62
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
We should use the actual display name of the node there, not some
hardcoded value.
Task-number: QTCREATORBUG-14240
Change-Id: Idf0fc4cdaab52d7f838d3d48d834a89b55ee593f
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
It appears to take 7% of project loading...
Change-Id: I2d20d919cc861a6ee95af359a584fb27a915cf80
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
The OS X linker makes using dynamic_casts across shared object
boundaries fail, so do all casting in the projectexplorer library
and provide functions to do it.
Task-number: QTCREATORBUG-13864
Change-Id: I0e13c0986f8342d83c3b838ffdd2dd7b8312b13c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
The only two cases where it is used, the type can easily be passed to
the constructor. So do that.
Change-Id: I1658a377aac56b5332992c445fba39b00620a74b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.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>
The code that invalidates m_currentNode folder nodes on removing wasn't
run due to a typo.
Change-Id: Ib7d545da4078275b2875c9a4c6246909234c8073
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
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>
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>
Root cause is trying to set the display name on a FolderNode that
is not in the tree yet.
Allow setting the displayname in the constructor and use that new
constructor where it makes sense.
Task-number: QTCREATORBUG-12897
Change-Id: I907e48cac837966e38524bfe88a87ef17d93f0b2
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
The only project manager that actually sometimes changes the displayname
is the cmake project manager. And that one failed to emit the right
signal. And since the signal was never emitted a few places handled the
signal wrongly.
Change-Id: I4aa75dc3032efe49263143dbadb7585a378b9be9
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Actually return the value of the m_line member varibale instead of -1.
Change-Id: I23ee47638e9b35cafcedca827790b4c2e0a02462
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Rename to runConfigurations() and remove the node argument which is
available as 'this'. Adjust const-ness of node argument in
RunConfigurationFactory::runConfigurationsForNode
Change-Id: Icb63e96a305152f90135a2656536de2581faafaf
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
So that the resource node can override it.
Task-number: QTCREATORBUG-11678
Change-Id: Id30d1b99ee23cc18fc29fc99cf0ad7ca919ed527
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
So that the resourcenode can steal from it's parent
Change-Id: I97a21d94c0ddb0d217c48fd69dc808446763837b
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
There may be more than one matching node, so these methods provided
a false sense of reliability.
Change-Id: I6471b74a1d2dd4e8afc7e836fec45355696a0741
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
The ResoureceNode will be a folder node, this enables that to work for
add new file.
Change-Id: Ifb4827d0900ce550be164c44979c5b72ab947c42
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
The reason they were on ProjectNode is that the signals are emitted
on the projectnode, but since I moved addFiles and others to FolderNode,
this makes more sense.
Change-Id: I918ca4d93dab78c8bb93dff03f53d1a6fbe21340
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
By default this simply calls the parent's supportedActions.
Most changes are due to the enum moving.
Change-Id: I25bf21b712cca48450014dbb0f748ac0c461e029
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Changing it must emit the same signals as does setting path, since the
sorting might change.
Change-Id: Iaf29c0775387d623d2e611e202b63ab52e812140
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>