Commit Graph

266 Commits

Author SHA1 Message Date
Orgad Shaneh
cbfc6e522d Merge remote-tracking branch 'origin/4.9'
Change-Id: I801042a53ae4d02d1891ea582ca9ea89b00d3181
2019-03-01 13:06:57 +02: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
hjk
ab27d0ea7e ProjectExplorer: Remove HasSubProjectRunConfigurations enum value
Change-Id: I93cfecdcc898a80b3c75744d039b9eae19610514
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 08:20:21 +00:00
Christian Kandeler
434c960243 ProjectExplorer: Fix "Remove subproject" functionality
This was completely broken: Both The qmake-specific logic for enabling
the menu item and the generic code executing the action operated on the
wrong nodes.

Change-Id: Ic6af6f87999dfd3b939f185312be944750b21fa9
Reviewed-by: hjk <hjk@qt.io>
2019-02-20 17:01:14 +00:00
Christian Kandeler
11f989bb93 ProjectExplorer: Allow to add existing project as sub-project
Implemented only for qmake as of now.

Fixes: QTCREATORBUG-5837
Change-Id: I78f6ce55d6a149a75ae595f7a86d39dc55496819
Reviewed-by: hjk <hjk@qt.io>
2019-02-20 16:15:13 +00:00
Christian Kandeler
749bc50e1b QmakeProjectManager: Prevent adding files to the project a second time
We check the child nodes of the current project and only add the new
file if it doesn't occur there already.

Fixes: QTCREATORBUG-19546
Change-Id: Ic784a117515eb7e433ebf1d08db1708da6cf5440
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-11 13:18:48 +00:00
hjk
5d1114fe52 ProjectExplorer: Drop the target argument
... from ProjectNode::targetData and setTargetData, and rename them
to data and setData.

It was only used in the implementation to retrieve the right node,
instead move the responsibility to find the right node to the caller.

Current assumption is that the functions were always called on
the right node already.

Change-Id: I9ae7e8a7ed5c79b924b99fd9a6a652bad56d114a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-20 16:18:37 +00:00
hjk
93257a56a0 QmakeAndroid: Replace remaining AndroidQtSupport
This uses the same approach as in the previous patches: Have some
generic interface in the base classes (here ProjectNode::targetData()
setTargetData()) and implement on the qmake project side.

Implementation for Cmake/QBS is architecture-wise possible, but
not used right now, and left for later.

Change-Id: I3bbf66170020cf9027a894cd66db15ec7ffbf499
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-20 13:13:51 +00:00
hjk
42f5c8516a QmakeAndroidSupport: Access parseInProgress and validParse
... via base project node functionality.

Change-Id: Ifd9c5b149e11c1d104abed200881fdfe93749144
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-18 12:22:23 +00:00
hjk
a9ce1a66a0 QmakeAndroid: Fill application combobox
... using a new base ProjectNode::targetApplications() function.

Change-Id: Id210683dce6bfa7ffbc89973423d326d76ac9309
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-17 14:02:06 +00:00
hjk
5b4205d159 QmakeAndroid: Reduce coupling between Qmake and QmakeAndroid
This moves most of the QmakeProject::applicationProFiles code
to its only user, the android side, and only uses the new
 bool includedInExactParse() const hook on the qmake side.

Change-Id: Ica11127c4895be22cafe56757f4cecafa02583ef
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-17 13:21:19 +00:00
hjk
c58da42bab QmakeProjectManager et al: Reduce use of qmake specific logic
Change-Id: I8f7e5d822ccb27e3ec241b814ec67aed7fe7539f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-12-14 12:08:39 +00:00
hjk
18669c8215 ProjectExplorer: Reduce qmake specific logic
- add a QString FileNode::buildKey(), returning the build key
  for a build represented by that node, if any.

     * for QmakeProFileNodes the build key is traditionally equal
       to the file name, so use that.

     * for QbsProductNode use the uniqueProductName()

- add a Project::findNodeForBuildKey(QString buildKey) convenience
  function searching a Project(!)Node matching that build key.
  That's the only use case there is right now, and I see no reason
  yet to travers all files (yet).

Change-Id: I388c0e06c03111e12d630899d762448e974a5737
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-12-04 08:53:34 +00:00
hjk
ccd5955843 QmakeProjectManager: Make target search operate on project nodes
This makes the using code a bit less dependent on qmake specifics
(qmake related ProjectNode specialization vs qmake-only class)

Change-Id: Ied6ced70694b3ac0665d88ec86c4a66577f3a672
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-28 12:25:23 +00:00
hjk
54efabd6e9 Qmake: Move some data accessors from QmakeProFile to QmakeProFileNode
These are not used during parsing but when operating on the items
in the project tree.

This loosens the ties between the qmake related parser and project
nodes.

Change-Id: I077356fcde240df56b466c71c902c821c4885f6d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-14 10:04:25 +00:00
Alessandro Portale
cd5066d86b QmakeProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default

Change-Id: I7642992eee6838bb2566921de87390c1771ebcbe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-13 09:25:21 +00:00
hjk
96b5fa208f Qmake: Remove QmakeProject::runConfigurationCreators
Not used anymore.

Change-Id: Idba6fd4a8d6f4c7e251a78568b1da0debd93bf5f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-05 12:21:26 +00:00
hjk
e20d620043 ProjectExplorer: Let RunConfiguration declare what nodes it belongs to
This feature in question is the availability of the "Run" button in the
context menu of certain project nodes in the project tree to run
something presumably related to/build from that (sub)project.

Previously, the decision was made for certain qmake based projects
(those targeting Desktop, iOS and VxWorks) by some indirection
through the corresponding RunConfigurationFactories.

The patch lets the RunConfigurations decide themselves directly
and removes the indirection, potentially opening the feature for
other qmake based RCs, as well as other combinations (e.g.
PythonRunConfiguration could be associated with its .py file,
without the need to have a dummy project)

Change-Id: Ic489bd1dfa25fcd9102ffa4fa30125565dd2e40e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 09:55:03 +00:00
hjk
8b92da254e Rename IRunConfigurationFactory to RunConfigurationFactory
It's not an *I*nterface anymore

Also, remove the in-all-but-one case unused QObject parent and the
object name that was only there for debugging purposes. The class
type serves the same purpose in the debugger.

Change-Id: I0dafb01e6b4fd7c7df04a63aaa3ef3e4bd693f6f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-07 16:07:42 +00:00
Tobias Hunger
e9ff7ab90b Qmake: Quieten soft-assert
Change-Id: If8c62a7aa17ac46d8e09cf990a57fa9eb1526598
Reviewed-by: hjk <hjk@qt.io>
2018-02-19 13:22:28 +00:00
hjk
4b7c82b131 QmakeProject: Centralize some code for subproject runconfig handling
Change-Id: Iecd8c326fc7fd1b1e7e5406fd899befc9fdd3c5b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-11 10:49:27 +00:00
Tobias Hunger
115615fc7c Qmake: Do not crash when accessing PriFiles from project tree
The project tree is static nowadays, and the QmakePriFileNodes hold
pointers to their corresponding PriFiles. This is fast, but not
entirely safe: The PriFiles are constantly updating as the project
is parsed.

So make sure not to rely on the stored pointer while the project
is parsing and go through Project::rootProFile() in that case.

Once the parsing is done, the project tree has been updated with
new data, that reflects the current QmakePriFile tree.

Task-number: QTCREATORBUG-19428
Change-Id: Ifaa3432cad7774142d562648d93104629736d478
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 10:32:35 +00:00
Tobias Hunger
0b5765d1cb Qmake: Make finding pro-files fast, second attempt
Finding the right pro-file was surprisingly slow. Make that fast again by
storing a pointer in QmakePriFileNode back to the QmakePriFile that created
it. This is save since the Nodes in the ProjectTree get nuked whenever the
tree of QmakePriFiles changes.

Task-number: QTCREATORBUG-19131
Change-Id: I4b5a8887cb13c36273a553f935a00d87cee4a7b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-03 10:12:34 +00:00
Christian Stenger
aab634ff15 Revert "Qmake: Make finding pro-files fast"
The patch broke defining the correct executable for qmake based
projects. Loading more complex projects (like QC itself) did
end up failing to run any executable out of the box as the
executable name was always wrong.
This reverts commit 21b0e7c37e.

Change-Id: I471c9963bd739b74e48286e1bde00f7222b90c8b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-02 09:45:25 +00:00
Tobias Hunger
21b0e7c37e Qmake: Make finding pro-files fast
Finding the right pro-file was surprisingly slow. Make that fast again.

Task-number: QTCREATORBUG-19131
Change-Id: I4b5a8887cb13c36273a553f935a00d87cee4a7b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-11-01 12:54:25 +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
18537a5594 ProjectNodes: Sprinkle QTC_ASSERT over code looking at parentFolderNode
Not checking the parentFolderNode triggered a crash elsewhere already, so
double check other uses of parentFolderNode and use QTC_ASSERT to make sure
no nullptr is going to be accessed.

This is necessary now that we have a forest of project trees and no longer
have a sessionnode anymore.

Change-Id: Ibc380c2ec9b12b983e709d2eeb03a8b741fe1058
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-12 10:33:15 +00:00
hjk
bd5e2faa75 ProjectNodes: Handle supported actions one-by-one
Getting the full list for a node can get quite expensive e.g. in
cases of recursive calls of QMakeProjectManager::findPriFile.

However, the FlatModel needs to decide quickly on whether an item
is editable to potentially allow renaming.

So split up QList<Actions> supportedActions() into individual
bool supportsAction(action) calls and make sure Rename is not
on the critical path.

Task-number: QTCREATORBUG-17953
Change-Id: I31841847f8aa7d7b94c63d76ce71efb1c930fa69
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 12:47:03 +00:00
hjk
8b8ba51ef3 ProjectNode: Let add/removeSubprojects operate on single files
That's the only way that is used.

Change-Id: I57e7942f9dccf74ff7588c3bca0ccf05f528a3df
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-20 10:56:34 +00:00
hjk
1328b04e7b qmake: Simplify QmakeProFileNode::buildDir()
The optional BuildConfiguration parameter is never used.

Change-Id: Ic5773616920702134848507ef2801a7723e8b65c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 11:59:46 +00:00
hjk
4f47a8d745 ProjectExplorer: Remove FolderNode::projectNodes()
Merged into the using code now.

Change-Id: I4b39998799dde530ab48c504ac2a389d72705c4f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-23 15:21:11 +00:00
Tobias Hunger
f9eab73dad qmake: move over from QmakeProjectNodes to QmakeParserNodes
Change-Id: Iab87e0c248b0f651a1774336c3bddf83baa9d057
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 16:00:49 +00:00
Tobias Hunger
8f0697e33d qmake: Unify TargetInformation and TargetParserInformation again
Change-Id: I00fc6e99e55684e67e5240c539002b13f4541286
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:19:20 +00:00
Tobias Hunger
ea23967630 qmake: Simplify QmakeProFileNode::buildDir
Change-Id: Ibca12d7c88e2dbdd3d9097a0c199d8ef039a56f4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:10:31 +00:00
Tobias Hunger
5103d4e53b qmake: Use nullptr in Qmake*FileNodes
Change-Id: I64605a59056cdee660cb1d8b2d447a79d0db94b4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:08:08 +00:00
Tobias Hunger
69684d9f9c qmake: Rename QmakeParser*FileNode to Qmake*File
Change-Id: I7598ccf93ed21a6d6650db76b17d745a2739b18c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 11:02:04 +00:00
Tobias Hunger
458ec1a284 qmake: rename QmakePriFile to QmakePriFileNodeDocument
... to avoid ambigularities later

Change-Id: I81a062750b03f1b49a306b1694bc137b70b04606
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 10:11:58 +00:00
Tobias Hunger
528b5f2298 qmake: Use enums from Qmake*File over those in Qmake*FileNode
Use QmakeParserProFileNode::AsyncUpdateDelay instead of
QmakeParserProFileNode::AsyncUpdateDelay.

Change-Id: I6628e566ce0f289778d61d146df58ca31345cdd7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 09:02:52 +00:00
Tobias Hunger
b697fd0db4 qmake: Use Variable enum consistently
Change-Id: I89588f12600f0698de764c05c1930b13b53a2588
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:40:16 +00:00
Tobias Hunger
086733a2c9 qmake: Use ProjectType enum consistently
Change-Id: I633a7150202fcbf420a33b4173d2b4451f46eb11
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:40:11 +00:00
Tobias Hunger
1878ff40ac qmake: Fix WS
Change-Id: I15f64b8c773446e7d1d3a980c9215f710b095ad9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:40:04 +00:00
hjk
54248a92e7 QmakeProjectManager: Add .pro files to tree unconditionally
This fixes a regression introduced by 04a525877b.

Change-Id: I19467bf802b020fedd48df85051aa3944fd9a329
Reviewed-by: Mathias Hasselmann <mathias.hasselmann@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-10 11:24:46 +00:00
hjk
04a525877b ProjectExplorer: Merge FolderNode's m_{file,folder}Node fields
One step closer to direct use of Utils::TreeNode.

Change-Id: Icd0dfd2fa4d12c2572a68f61ae43c5e906956a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-09 12:15:23 +00:00
hjk
95e2d7f545 ProjectExplorer: Remove ProjectNode::m_projectNodes
They are duplicated in m_folderNodes, use them.

Change-Id: I4571720f1ef3daf098870a3cf05fa28a1002bb3f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-08 11:15:55 +00:00
hjk
f8f7931b43 QMakeProjectManager: Shorten ProVirtualFolderNode constructor
It's only used in one code path, and the InternalNode contains
everything it needs.

Change-Id: I6bd4e2e3555b9a321bf0b93c56d5459f141be494
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-03 13:38:12 +00:00
hjk
31d6c3cd05 QMakeProject: Clean up qmakenodes.h
Remove unneeded things, move one-time uses to .cpp.

Change-Id: I9836a78ff697c965295d58be67530ce08c04e9d8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-03 13:38:07 +00:00
hjk
39a8442f80 QMake/ProjectManager: Simplify QmakeProFileNode::applyEvaluate
... and remove ProjectNode::removeProjectNode, as this was the
only remaining user.

Change-Id: I2c53392a8e9dacf956270d652525b62ba4c9e0a4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-03 10:09:38 +00:00
hjk
cbfedd4328 ProjectExplorer: Fix display of .qrc contents
Change-Id: I2779e12daa8a7972380f51b72a56de3466d453a5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 13:43:31 +00:00
hjk
30bf801629 ProjectExplorer: Further tree node related simplification
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>
2017-01-30 07:56:05 +00:00