Commit Graph

62 Commits

Author SHA1 Message Date
Christian Kandeler
a420374976 QmakePM: Do a "sorted insert" when adding files
Don't blindly append to the end of the list, but try to put files into
the right place with regards to lexicographical order.
We do not re-sort existing file lists, nor do we attempt to be fancy
with strangely formatted project files. But lists conforming to our own
style will stay sorted, in particular lists that have only ever been
touched by Qt Creator.

Fixes: QTCREATORBUG-553
Fixes: QTCREATORBUG-21807
Change-Id: I15db0e867a2d477fcf95e008f98ba468dcd83e45
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-01-24 15:31:53 +00:00
Nikolai Kosjar
820e4f8177 ClangTools/QMake: Stop analyzing files not part of build configuration
...for the qmake project manager.

When parsing the project files, remember whether a file was discovered
by the exact or cumulative parse. Only files that were discovered by the
exact parse are considered "active" and thus part of the build
configuration. The others are not offered for selection.

Fixes: QTCREATORBUG-16016
Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I7a28b4de15e048975d7f0cd737dd8c11f744315b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-08 14:09:52 +00:00
Ville Nummela
76262814b6 QmakeProjectManager: Watch wildcard directories for changes
If e.g. DISTFILES contains wildcards, watch the directory for changes.

Fixes: QTCREATORBUG-21603
Change-Id: Ia6e8c94ab7b74e0404776ba1d7d9b10eb3b643de
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-12 05:09:22 +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
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +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
Eike Ziller
9bbb085718 QMake parsing: Improve behavior in case of empty build directory
The build directory can be "empty" if there is no build configuration,
or if the build configuration's build directory is empty.

Handle both cases in the same way.
This avoids passing an actually empty build directory to the parser,
which the parser does no longer handles gracefully on Windows.

If the build directory is empty, use the project's source path (instead
of QDir(QString()) which is the current working directory), which makes
it consistent with the behavior when actually building in that case.
The parser does not actually write files to disk, so there is no issue
with temporarily using that directory and later switching to a shadow
build directory.

Task-number: QTCREATORBUG-20121
Change-Id: Ia454085edae6b55b445cc5cf0ec3ae1c85464b0c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-04 15:17:04 +00:00
Eike Ziller
6e66b2a078 Remove some lambdas from Utils::transform calls
It is often possible to user (member) functions or members directly.
That improves readablility and potentially reduces the total number of
symbols.
Also use qobject_container_cast at places where it is appropriate.

Change-Id: Ia2591bca356591e001e2c53eeebcf753e5bc3c37
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-05-28 13:45:20 +00:00
Antonio Di Monaco
bf5ba08435 Fix coding style
This patch fixes the incorrect brace symmetry contained in the patch
916bc59cfb .

Change-Id: I003c89f5f2170190d1ae2f52f186862fe06a2135
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-11 14:47:18 +00:00
Antonio Di Monaco
916bc59cfb Add support for system include directories in qmake project files
When system include paths are added via QMAKE_CXXFLAGS in a .pro file,
in order to use the -isystem parameter, they are not taken into account
by Qt Creator.

This patch adds support for -isystem parameter in QMAKE_CXXFLAGS
parsing.

Change-Id: Ibd25734ec9f3a18258c445804c4a17269d7522ed
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-10 14:57:20 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Eike Ziller
278a5f1e33 Merge "Merge remote-tracking branch 'origin/4.6'" 2018-03-16 10:29:37 +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
Oswald Buddenhagen
60245e55d7 qmake: Change source identifier type in ProString
The strings remember in which file they were created/assigned.

However, this used a non-counting reference to a ProFile, which could
become dangling. If a subsequent ProFile re-used the exact same address,
a string's source would be mis-identified, which would be fatal in
conjunction with discard_from().

Since we actually need only a unique id for comparison, let's use an
integer for that.

comment on cherry-pick: this is actually a lot more than a cherry-pick,
because the file ids need to be aware of the dual VFS which was
concurrently introduced on the qtc side.

Started-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a
(cherry picked from qtbase/190aa94be7f5e146bef44862b974d733755cec85)
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-14 15:34:01 +00:00
Eike Ziller
8e1fefd8de Merge remote-tracking branch 'origin/4.5'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I29979e76cb01bc94ddcd7868ca1cbc34afb14c5d
2017-11-27 12:46:56 +01:00
Tobias Hunger
dfcd573427 Qmake: Do not crash when closing a project while it is parsing
* Fix crashes and resource leaks in qmake project.

Task-number: QTCREATORBUG-19358
Change-Id: I3b383640cdf994b4014ccbfc4278be48f9e5fd3f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-11-27 09:16:54 +00:00
Orgad Shaneh
a6cda6dbe0 Merge remote-tracking branch 'origin/4.5'
Change-Id: I16e3bb9ee3a1e6dc6edf7a65f8a137a25cda4fe3
2017-11-05 16:49:17 +02:00
Tobias Hunger
19e125ce5f Qmake: Pass on QMAKE_CFLAGS to the code model
Change-Id: I87c07177adcfd72c7852f84266feb9baf1f87e5b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-03 14:07:30 +00:00
Tobias Hunger
1094fe5abf Qmake: Fix detection of successful parsing run
Do not report success of a qmake parsing run based on every .pro-file
having reported success. Take the top-level .pro-file's success value
instead.

This fixes e.g. Creator, which has some .pro-files that error out in
some conditions.

Task-number: QTCREATORBUG-18992
Change-Id: I888141e723da84fb780ccd84c86acc25d03f5f28
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-03 10:12:59 +00:00
Tobias Hunger
af572c546f Qmake: Speed up QmakePriFile::findPriFile
Avoid needless detaching in that method: The method is used less since
the Nodes no longer need to go through it. All the runconfigurations
still use it, so this change is still noticeable.

Change-Id: I9f5e238ab1ef7165fd4fef1b0f80d4e5daa9a7e8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-11-03 10:12:49 +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
Christian Kandeler
9e32603c3d QmakeProjectManager: Support wildcards in INSTALLS again
This functionality was (accidentally?) lost in some semi-recent
refactoring in the pro file evaluation code. Note that only the "*" and
"?" globs are supported.

Task-number: QTCREATORBUG-17935
Change-Id: I9ade940f4dbf9c5836cd8b5fab2d85d10f42ad9a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-11-01 11:27:40 +00:00
Ulf Hermann
e902980dde Treat .ui.qml mime type the same as .qml
Right now, the qmake project manager offers a "Build" context menu entry
for .ui.qml files and various other things are off because the mime
types are different.

Change-Id: Icc966e56513b9c5aed05f929dc8cb728ed408723
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-10-18 08:11:42 +00:00
Tobias Hunger
09b127f9f1 Project: Move signalling of parsing state into Project
Get rid of duplicated code to do such signaling in derived Project types.

Change-Id: I26914a1d751d72ee65c15a7943e0e7f34978f042
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-26 09:29:21 +00:00
Tobias Hunger
98764a44a7 qmake: Fix WS
Change-Id: Ib87bdf6c686e3bb37bdd55955d5e18de79d2729a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-07-18 08:05:07 +00:00
hjk
b0117cdfb4 QmakeProjectManager: Remove unused QmakePrifile::buildsFile()
Change-Id: Ia71e00036f5468415ffc2e5649efe96f3debbfc8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-28 13:25:59 +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
3f5caf4cdc Utils: Wrap MimeDatabase into static functions
To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra
all over the place.

Change-Id: I4bfef62e73275a991455141671d6071162788e9d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-03 07:57:54 +00:00
hjk
be204a125e ProjectManager: Cut ties between Project and IProjectManager
Not needed, less code.

Change-Id: Ie0d5c3a60f0392f30ed2ee9d2c5a32156b4e67e1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-01 17:07:05 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Tim Jenssen
005ca71cac qmake: Use a QSet<FileName> for sets of folders
Change-Id: Ia2b9c435bd16eb5175534975fd822cecb74cc70f
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:10:33 +00:00
Tim Jenssen
f716aac52a qmake: sprinkle some const
Change-Id: I7f4ecc97650d8ed9c9720f3ff3af1b7eaa89c623
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:04:22 +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
025d57981d qmake: Remove QmakePriFile::runConfigurations
There is no need to forward that from the QmakePriFileNode.

Change-Id: I6ebc267eac68729ddb13027412cb315f81d55e82
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:20:40 +00:00
Tobias Hunger
e06e00c23c qmake: Add knowsFile() method to QmakePriFile
Change-Id: Ib3f0799313afdb141270caa135b208a300078bc5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:19:50 +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
96a7902383 qmake: Introduce QmakeNodeTreeBuilder
Introduce a new class used to turn a tree of QmakePriFiles into
a project tree.

Change-Id: I13b785fb988db3c5784bdf6e8daca6ba42f5a333
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:16:34 +00:00
Tobias Hunger
4ab44b07e5 qmake: Add method to find QmakePriFiles and QmakeProFiles
Change-Id: I04a75b94603b5483d5f9eaa827d08415c0a92985
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:14:00 +00:00
Tobias Hunger
bc64e91c5e qmake: Use more FileNames in Qmake*File
Change-Id: Id9f704d941a0f8df98bbb4e83e1ea773241a7023
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:13:27 +00:00
Tobias Hunger
5a223ca94e qmake: Add accessor for file lists to QmakePriFile
Change-Id: I37f9f39eba3bae2376d5349ce597e29fca6cb21f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:12:17 +00:00
Tobias Hunger
f8aaa2e0eb qmake: Do not rely an rootProjectNode in QmakeProFile::buildDir
Change-Id: I68211110c84587376079c02e0a7cd5f6ac6f9295
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:10:55 +00:00
Tobias Hunger
167762c2c6 qmake: Implement QmakeProFile::allProFiles
Change-Id: I9074b398e8b90657125c697cfa366f304c6c9ab5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:10:04 +00:00
Tobias Hunger
2f333b1072 qmake: add displayname method to Qmake*File
Change-Id: I90e6ef357f050953f51ae9cad4eb1c1d2daf4e5a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:08:53 +00:00
Tobias Hunger
8eb63d8375 qmake: Use Utils::FileName for QmakeProFile::subProjectsToDeploy
Change-Id: Iaa87f8049998939c883867aa13d9d347c19c33f9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:05:59 +00:00
Tobias Hunger
9e63c71412 qmake: Update QmakePriFile::subPriFilesExact
Change-Id: Ie1db4eb200c2a5d56bbca678dbe007f91aadf04a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:04:33 +00:00
Tobias Hunger
aa4c7dc07c qmake: QmakePriFile is no longer a ProjectNode
Change-Id: Ife3ca88e0d4e0a9de290b2b991ac8d10e3c55674
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-22 13:03:12 +00:00
Tobias Hunger
3bd6b69e66 qmake: use nullptr
Change-Id: I372c0b49b894c3758621e2e9d2b73aaa49371dde
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 11:03:18 +00:00
Tobias Hunger
4070b49118 qmake: Enable more code
Change-Id: I3b2a7d638571cb941906f37c7dfd6de613261a0a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 11:02:48 +00:00
Tobias Hunger
07c0ca5ef5 qmake: use class instead of struct
Change-Id: Ieb0d7557555c4a0c2e196b28841972483f3fd135
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 11:02:41 +00:00