Commit Graph

266 Commits

Author SHA1 Message Date
hjk
87304b3ce0 ProjectExplorer: Introduce some FolderNode convenience functions
... and use them.

Change-Id: I9f5237e5eac30715c2effbd3301dd2a70516d2a9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-27 08:40:20 +00:00
Oswald Buddenhagen
0909426420 fix/hack deployment of qt examples
qt assumes that it is being installed (possibly into an install root),
not deployed, and leaves the translation of host paths to device paths
to the deploying agent - which is qt creator.

Task-number: QTCREATORBUG-17466
Change-Id: If9065b1079df607732e0f81132f29dbaf18ff602
Started-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-26 16:55:36 +00:00
hjk
beaba559a5 ProjectExplorer: Slim down user side ProjectNode handling
Change-Id: If727ff6cd09cc127e031c49c47f61ffda631a80e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-26 15:24:57 +00:00
hjk
e20549d295 ProjectManager: Add function to set a list of files in folder nodes
... instead of having to remove/add. Use it in some places
in QmakeProjectManager and the ResourceEditor where the
(sub)tree is rebuild anyway.

Change-Id: I46b3c078c576b72dba6e87432570d030b7572026
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-26 10:32:22 +00:00
hjk
3c743346b0 ProjectExplorer: Make the FlatModel a Utils::TreeModel
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>
2017-01-25 13:52:51 +00:00
Eike Ziller
b1f1ccb32e Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: I3484b668f9323ed0c05de99f8dfed07c9e65ab98
2017-01-11 09:29:37 +01:00
Tobias Hunger
624339ea70 qmake: fix missing OTHER_FILES in project tree
... in subdirs projects which actually have any subdirs.

that would happen via this mechanism in QmakeProFileNode::evaluate():
first, IncludedPriFile nodes with proFile = null are created for the
subdirs. subsequently, this tree is enriched by transforming the
reader's included files. that loop iterates over all already created
nodes and tries to match them against included files. at nesting level
one, this would now run into the nodes created for the subdirs. the code
failed to skip over these nodes, and would thus create a bogus node for
the .pro file (as it has the parent null in the mapping of included
files). this node would not be included into the tree due to the loop
prevention in QmakeProFileNode::applyEvaluate() (it obviously had the
same file path as its parent), but at the same time it would catch the
files meant for the root node due to defeating the fallback in
QmakePriFileNode::extractSources().

Task-number: QTCREATORBUG-17473
Change-Id: Ice9f667345148be42297cc21ff0a73058f27cc38
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-10 14:49:07 +00:00
Eike Ziller
c175f1e62f Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/ios/iosdevice.cpp
	src/plugins/ios/iossimulator.cpp
	src/plugins/projectexplorer/projectwindow.cpp
	src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp
	src/shared/qbs

Change-Id: Ie98e2401a2259903141a13170c78388f2da467d2
2016-12-09 12:42:01 +01:00
Tobias Hunger
2ce647f885 ProjectExplorer: Fix potential nullptr access
Change-Id: If5e4a9b3ba3eb25549406be76c5f14e2479b7cf4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-05 18:11:46 +00:00
hjk
6d9afdc4ff QmakeProjectManager: Compile fix after ebf8c1eaf0
Change-Id: I4e1315dd7b1cdc11a355330dcad653667967ec8d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-05 13:18:35 +00:00
Alessandro Portale
ebf8c1eaf0 QmakeProjectManager: Use "Default encoding" for mechanized editing
When performing mechanized editing on .pro/.pri files, until now, Qt
Creator reloaded and restored the file with [from|to]Local8Bit.

That broke #comments in unicode.

This change implements that the the "Default encoding" from the text
editor options is used instead.

Task-number: QTCREATORBUG-10274
Change-Id: I783fc3a2c6a2638e4603ced2eef25c2a3998e2c1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-05 11:58:55 +00:00
Orgad Shaneh
9c09ca9e42 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
2016-11-14 11:17:13 +02:00
Tobias Hunger
737b7c94e8 ProjectExplorer: WS only change
Change-Id: Ibf883d9e5c92e9b3f5f8834aeb171e16aa057490
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 09:03:17 +00:00
Tobias Hunger
49f5d98871 ProjectExplorer: Make priorities available on more nodes
Make priority available on all FolderNodes. Make the sort order
of all kinds of FolderNodes check the priority.

This allows no reorder e.g. ProjectNodes as needed.

Change-Id: I369edd28807ab9f89fb646b0001e1b3eb1a19d7e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 09:03:10 +00:00
Tobias Hunger
ad003363b7 ProjectExplorer: Rename Node::projectNode to Node::parentProjectNode
Change-Id: I47fa794a0bd8456ae23271934a957d9667d2d7bb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:14 +00:00
Tobias Hunger
67e011ba5f ProjectExplorer: Make naming of methods on Nodes more consistent
Change-Id: I5050a020f0fc0ef4556db1d2020afeadfcd51585
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:02 +00:00
Tobias Hunger
0d79f0d5d9 Qmake: Make sure to mark new ProFileNodes as "parse in progress"
ProFileNodes start out as "no parse in progress" and need to be told
that there is a "parse in progress" when created as part of the project
parsing.

Otherwise they will not notify their associated run configuration that
they are done parsing, which in turn keeps the run buttons in the UI
inactive.

Change-Id: Ic37a9f1ccb6beecbf37f4fc54747122572e52c90
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-11-10 10:49:35 +00:00
Tobias Hunger
0f1f595a12 QmakeProjectManager: Improve signalling of parser state
Correctly signal when parsing of a qmake project starts and stops via
the build- and runconfigurations.

The buildconfigurations are in the picture since they disable the run buttons
when the user has selected to build before deploy and deploy before run.

Task-number: QTCREATORBUG-16172
Task-number: QTCREATORBUG-15583
Change-Id: I44b5f5ce8e145cb93dc0022f66e1edcc202875e4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-09 10:15:05 +00:00
Tobias Hunger
ce3e586198 ProjectExplorer: Shorten space needed to store a FileType
Use class enum to shorten the FileType to quint16. This frees up a couple
of bytes per FileNode and we can have many of those.

Change-Id: I3a9ae25059690fefa15305a4268269647d6dc1c9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-03 15:55:39 +00:00
Tobias Hunger
c9ee7ee378 ProjectExplorer: Shorten NodeType enum
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>
2016-11-03 15:55:13 +00:00
Tobias Hunger
9b0b6aad2e QmakeProjectManager: Remove dead code
Change-Id: I279fb21a8da8789b19e4319b804afafdeb6a630d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-03 09:44:35 +00:00
Oswald Buddenhagen
cd30304685 fix cumulative qmake evaluation in debug_and_release configs
don't fail to make the build pass evaluator cumulative as well.

Task-number: QTCREATORBUG-17214
Change-Id: I217578b7d29d0dcf9ef63c954ec403412812c70c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-02 13:59:52 +00:00
Oswald Buddenhagen
5f17c280ec de-duplicate INSTALLS resolution
don't resolve the source files once for deployment and once for the
project tree.

Change-Id: Ifddf8fc7883bf025d3640de0d6676b5930991088
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:37:17 +00:00
Oswald Buddenhagen
4a59a7d714 remove duplicate resolution of sources from cumulative pass
instead of resolving all sources both in the exact and the cumulative
pass and de-duplicating the joined list in the end, resolve only these
files from the cumulative pass which are unique to it to start with.

Change-Id: Ie3327799ecd94f8710f8b99bcc46998790ba2c74
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:37:06 +00:00
Oswald Buddenhagen
e19fa27601 de-duplicate resolution of exact sources
rather than resolving them once in bulk (for the code model) and once
per pri file (for the project view), resolve them only in bulk, but
"tag" them. then do a cheap filtering pass for the project view.

as a side effect, this fixes the problem that sources that are listed by
a file that is not shown in the project tree (as is the case for qrc
files synthesized by resources.prf) would not be shown at all. instead,
these sources now appear belonging directly to the pro file.

Task-number: QTCREATORBUG-3670
Change-Id: I1a1756d95bd90db4da1274eebcc4dad2a854f43d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:36:41 +00:00
Oswald Buddenhagen
0afcbaa9c8 apply a build pass to retrieve all project variables
so far, we used a build pass only to retrieve accurate target
information from the exact evaluator. however, this is insufficient for
at least two reasons:
- the recently introduced postprocessing of RESOURCES in resources.prf
  is executed only during build passes
- some relevant variables are build pass specific, for example
  INCLUDEPATH when it includes RCC_DIR

an additional upside is that using the build pass' values is consistent
with qmake's vcxproj generation mode.

on the downside, the extra cumulative build pass adds 33% of pure
project evaluation time. however, this isn't as bad, as the pro files
are already loaded and parsed, and the expensive source file resolution
moves completely to the build pass.

the alternative of defeating the build pass logic (as lupdate does) is
not feasible, as we rely on accurate target information from an actual
build pass for the run configurations.

note that this all applies only to windows (and macos when explicitly
configured with -debug-and-release).

Task-number: QTCREATORBUG-16019
Change-Id: I8a97856b3b738aa1a581d24ba24bb3e7199d8078
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:36:11 +00:00
Oswald Buddenhagen
7e86b98836 unify {,obj}c++{source,header} handling in qmake project manager
consistently with Xcode, qmake nowadays knows only one SOURCES list,
which is automatically classified by extension.
to replicate that, we actually copy the objective_c.prf file from qt
5.6.3 and use it to override whatever comes with qt, so we can treat all
qt versions uniformly.

also, the code model throws away the information which files were listed
as sources and which as headers. this is technically incorrect, as a
source may be only included rather than compiled, but there is no point
in extracting information which is not used.

conclusion: lump all c-like sources into one variable as far as project
processing is concerned.

and as far as configuration goes, our code model doesn't differentiate
anyway, so the duplicated setup paths can be eliminated as well.

Change-Id: I24b1bc056f8d9eb579c9378817f602912ab49971
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:35:59 +00:00
Oswald Buddenhagen
4148b05e0a remove some pointless complexity relating to IncludedPriFile
each such object has exactly one associated ProFile if it shall result
in a pri node, and no ProFile if it shall result in a pro node. there is
no point in dealing with lists at various levels.

Change-Id: I930fd8c14fcd6336cd297bacefdd0036f556741b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:35:50 +00:00
Oswald Buddenhagen
a8010b0fff make VFS aware of exact vs. cumulative evaluation
the cumulative evaluation has a good chance to make a mess of the
virtual file contents created by the exact parsing, so better contain it
to its own namespace.

the ProFile cache also needs to keep the files separate. this
specifically addresses the side issue discussed in QTCREATORBUG-10779.
it also fixes attempts to deploy the wrong build when the variant is
selected through a cache file, as in QTCREATORBUG-15815.

in the project explorer, we don't track from which evaluation pass
particular files came from, so we try the cumulative first to get the
most contents, and fall back to the exact one if the former file is
empty (or does not exist at all).

Task-number: QTCREATORBUG-15815
Change-Id: I2c1eb16c97526fa275a1c6a2eae9266d385859ac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:35:22 +00:00
Oswald Buddenhagen
cf82f21080 shave off duplicate stat()ing of source files
ProFileEvaluator::absoluteFileValues() now returns only files, which
allows us to skip the subsequent QFileInfo::isFile() calls at some
call sites.

as a side effect, IoUtils::fileType() does not see anything except
regular files and directories any more. that's not expected to be a
problem, given the function's scope.

Change-Id: I53063ad8cacb3afe5cc1baf6d6d5feba3465e74f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:35:14 +00:00
Oswald Buddenhagen
424639ecac make resource file handling able to deal with QMakeProject's VFS
resources.prf may create virtual qrc files when RESOURCES contains
non-qrc files.

Change-Id: If591de9b32b775059d67e94bc3cb06d23ee44b08
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:34:55 +00:00
Oswald Buddenhagen
1589ce3ce8 chuck sysroot handling out of ProFileEvaluator
qmake doesn't do anything with sysroots at this level, so this code
plain does not belong here.

sysrootification is used when resolving INCLUDEPATH, which is emulating
compiler behavior. this is done by higher-level code.

Task-number: QTCREATORBUG-11944
Change-Id: Ia25f0b6ef713e9809d974e3f3e49ba308b8c933f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 17:34:29 +00:00
Oswald Buddenhagen
c42b12c98e introduce ProFileReader::fixifiedValues()
... and use it for PRECOMPILED_HEADER, INCLUDEPATH, and install target
collection, instead of abusing ProFileReader::absoluteFileValues().

specifically, this falls back to a location in the build directory when
the path is relative and the file cannot be found. in qmake, this
somewhat weird behavior ensures that chaining extra compilers actually
works (and also ensures a lot of frustration with non-clean source dirs
...).

this also fixes INSTALLS with .CONFIG no_check_exists.

Task-number: QTCREATORBUG-14848
Change-Id: Iaf9483c0c4586c464bd10a2aea7cbac7e0df1ec5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-01 17:33:58 +00:00
Oswald Buddenhagen
fde9758fcb prune dead code surrounding isDeployable
no-one ever queried this state since S60 support was removed in
ae23d50576 (2012).

Change-Id: I3e05d90bb43514b4c326e124834cf9c5e89a0168
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-01 07:58:03 +00:00
Oswald Buddenhagen
3c43c35167 remove pretenses of support for DEPLOYMENT with .sources
since fa6d0f1231, DEPLOYMENT is aliased to INSTALLS, so we would have to
actually look for .sources in entries listed in that variable, which we
didn't. apparently, nobody noticed, among other things possibly because
the qt4 variant already supports .files in later versions.
also, our actual deployment code doesn't use .sources, either.

Change-Id: I990240716817118047fc9aa97eff55305fcf7eca
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-11-01 07:57:48 +00:00
Orgad Shaneh
3de8b56d88 Theme: Remove some more unused entries
Change-Id: Ie2df7520871db21930c39fd976fa8739d354a2dc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-10-27 12:54:22 +00:00
Oswald Buddenhagen
b8ea6e8f0e remove redundancy from QmakePriFileNode::recursiveEnumerate()
we *know* that this function is called only with folders; it's part of
its api.

Change-Id: Idada1e6672a916c0d550d191770396ebbc54b02f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 09:11:51 +00:00
Oswald Buddenhagen
7754606bea don't collect dynamic variable names from cumulative reader
we actually use variable values only from the exact reader, based on the
idea that the cumulative parse is too dangerous, as using recursive
watches on inexact data may be a bit heavy. using additional variable
names from the cumulative reader sort of defeats the idea.

Change-Id: I8bf3e298bf89593dcc77548cc3d2cbf7881202dd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 09:04:34 +00:00
Oswald Buddenhagen
65c32320df don't process SOURCES twice
moc.prf also adds an extra compiler which takes SOURCES as input. as we
add it to the list manually, we have to filter it just like HEADERS.

Change-Id: I81b8b68965c1b65fd0cef6a68c01ad00d51d6dee
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 09:04:04 +00:00
Oswald Buddenhagen
5e148f1147 actually show errors from bogus SUBDIRS entries
this got lost in 51ba32bcc.

Change-Id: Ic0c982cff8d4030eae8e942f9324fd6f49c68aa9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 09:03:50 +00:00
Thomas Hartmann
5e1debe9f4 QmlDesigner: Adding support for QML_DESIGNER_IMPORT_PATH in .pro file
The user can set QML_DESIGNER_IMPORT_PATH to define
a qml import path just for qml2puppet.

Change-Id: Ic9dac4cf478c9d0f8d6e066d6a9a481500cc5497
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-29 13:19:03 +00:00
Tobias Hunger
8f73b24e87 Qmake: Warn when project uses unexpected compiler(s) to build
Change-Id: I28b45b2f994ce2dd030f5dae2ab78ecb0b547b1f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-26 12:29:19 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02:00
Oswald Buddenhagen
b7706cdfeb make QMakeParser take a QStringRef as input
the only place where this actually saves a deep copy is the evaluation
of if(), but as a side effect the parser is now able to deal with not
null-terminated strings, which is kinda nice as well.

Change-Id: Ib6d08617aa79d2f9eaecd4906d4d548f34bf377d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
(cherry picked from qtbase/ad17a35853fe21a93fc34f7b2d9262c5ac992b29)
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-08-02 07:57:26 +00:00
Tobias Hunger
84f1466b01 Use FileChangeBlocker
Use FileChangeBlocker over expecting/unexpecting file changes manually.

Change-Id: I8428841f966d81be477260416c75e91dee795425
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-18 09:07:23 +00:00
Ulf Hermann
25b9989749 Add wizard and mime type for SCXML
This allows us to easily add scxml files to a qmake project.

Change-Id: I2b5b21683f3e76062e6858fb8d0bceaa699a5569
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-14 11:41:05 +00:00
Eike Ziller
a3880c4916 Merge remote-tracking branch 'origin/4.0'
Change-Id: If0ba896a083392a532f76bb26bec3540a7c17667
2016-04-25 13:27:14 +02:00
Alessandro Portale
fdad4bf7b0 New file overlay icons
Change-Id: Icba67a1404b6e4604aef56def00bfe2098b8c8fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-04-25 08:07:19 +00:00
Vikas Pachdha
d3dd0265b3 ProjectExplorer: Added duplicate file action.
Task-number: QTCREATORBUG-15952
Change-Id: Idab6f120e8324b21db261ad4f0db54dd73cda16e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-04-08 15:28:00 +00:00
Leena Miettinen
2706348040 QMake: Write "state charts" as two words
Change-Id: I6b0473c6f1029a9a0b99ce5e1a97e84e102d7218
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2016-04-05 09:55:31 +00:00