Commit Graph

373 Commits

Author SHA1 Message Date
hjk
58f984d2b9 Qmake: FilePathify remaining qmakeproject.cpp
Change-Id: I79860efc69b0053701306a83c61dfc4bc2d31bb3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-18 11:38:38 +00:00
hjk
e05bb25306 Qmake: FilePathify QmakeBuildSystem::buildDir
Change-Id: I856152c00a07d018b88526efb5576759e2b4b82f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-18 11:36:26 +00:00
hjk
3721f60934 Qmake: Make executableFor() return a FilePath instead of QString
Change-Id: Ie7e0432080577aedb9c8a4be2d20388afbdce349
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-17 11:41:38 +00:00
David Schulz
5ec611b68e Utils: add FilePath::completeBaseName
Removing some FilePath::toFileInfo() calls again.

Change-Id: I6610beebf2c30754fde525b71f4c4a34ceb5e30b
Reviewed-by: hjk <hjk@qt.io>
2021-06-04 07:07:07 +00:00
Christian Kandeler
413b83ddf9 QmakeProjectManager: Fix possible crash on project document reload
... while a parse is going on.

Fixes: QTCREATORBUG-25137
Change-Id: I02a914332ef120caee044139581e1901b4537bff
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-13 08:04:56 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Eike Ziller
484d40258a IDocument: Simplify permission changes
Take care of handling file permission changes centrally.

TextDocument had its own, caching implementation of tracking the backing
file's read-only state. Move that into IDocument directly.

IDocument::reload with a permission-only change is not a very
interesting case, but every subclass needed to add handling of it.
Instead, remove TypePermission from the file-change types, and handle it
separately via the now unified checkPermissions() implementation.
IDocument::reloadBehavior already was never called with TypePermission.

Change-Id: I321d47ba6193bc878efa9bb50ba7a739fa492745
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-14 14:55:34 +00:00
Christian Kandeler
a30aa4421a Qmake: Prevent unresponsive processes from hanging Qt Creator
That is, processes run via qmake's system() function.
Fun fact disovered while implementing this: "Canceling" the loading of a
qmake project did nothing at all except making the progress bar red at
the end of the parsing procedure. Now at least we terminate the
currently running processes invoked by system(), so the parsing threads
can continue and eventually finish.

Task-number: QTCREATORBUG-24825
Task-number: QTCREATORBUG-25000
Task-number: QTCREATORBUG-25194
Change-Id: Ic92ef200d3a49bbdeff0429ae7038fe3f1935b38
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-05 15:40:15 +00:00
Eike Ziller
d02afbe6b4 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: I2136ba89d3aa3c4c2a0e7a4f9d8ba9cec32924ce
2020-11-30 16:14:32 +01:00
Eike Ziller
18e3e70887 qmake: Do not bring general messages pane to front
- message(): Print to general messages and blink
- warning(), error(): create item in Issues pane
- parse error and other errors: create item in Issues pane

Task-number: QTCREATORBUG-24430
Change-Id: I6b37cef0b9e53e2207341bd179e2c60a40da9ee0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-27 15:43:33 +00:00
Eike Ziller
381c5656e7 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/mesonprojectmanager/project/mesonprojectparser.h

Change-Id: Id38d20ce20981dcdc322fe5d1d7647f4bec89d8a
2020-11-13 16:03:26 +01:00
Jarek Kobus
2b414508b7 Remove unneeded includes
Change-Id: I67fee9303509b7080e123a2a5826e200ce498ce2
Reviewed-by: hjk <hjk@qt.io>
2020-11-12 12:14:11 +00:00
Nikolai Kosjar
888ea6bbbb CppTools: Take "-include" files into account
Fixes: QTCREATORBUG-20602
Change-Id: Ibfc518fc64ed75f93265db800558ec1d2e424bb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-05 08:49:24 +00:00
Christian Kandeler
dd62254e4e QmakeProjectManager: Make "system" execution opt-in
It has too many side effects.
Amends fcd6384f4d.
T_SYSTEM and E_SYSTEM are now treated the same.

Fixes: QTCREATORBUG-24551
Change-Id: Ib6df2762d329f2ddc0dd66190454159d446a9ac9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-16 10:40:45 +00:00
Eike Ziller
8b031c8c05 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: I3f2a6c553819e992da7e9f538dc44b95b482359e
2020-10-02 10:47:07 +02:00
Christian Kandeler
4c1c11b7b6 QmakeProjectManager: Fix crash on reparsing
After a re-parse, the existing IDocuments need to be updated with the
new QmakePriFile object, as the old one may no longer be valid and thus
cause a crash on the next re-parse.
Amends f3bd07efd1.

Fixes: QTCREATORBUG-24683
Change-Id: Ib03d3005cb7831f1e05cb116aa3cdfe6cf5e72ad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-28 11:29:41 +00:00
Eike Ziller
5ad724c61b Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Ieb1c3e946f11d3c4fa1ee6b5afdf83cc532d8aed
2020-09-17 10:28:19 +02:00
Christian Kandeler
f3bd07efd1 QmakeProjectManager: Restore incremental re-parsing
This was broken in commit 37aecdd112, where we overlooked that a special
type of IDocument was used that triggers a re-parse of only the affected
part of the project tree. As a result, all changes to a .pri or .pro file
would trigger a re-parse of the entire project.

Fixes: QTCREATORBUG-24572
Change-Id: I480cff4e53cf86a17e1eaac0eb9b32901bc87051
Reviewed-by: hjk <hjk@qt.io>
2020-09-15 09:19:23 +00:00
hjk
c3ab20ef9c Qmake: Drop use of QTextCodec in pro parser
This follows 42d2d70ab in qtbase.

Change-Id: I519a20421ce452984fa21ec0f988379bed9368d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-11 07:14:31 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Stenger
6e798401a0 Fix plugin unit tests when using projects
The ClangTools and the AutoTest plugins use an internal
mechanism to load and configure a project when performing
their integrated unit tests.
Both assumed to have exactly one kit present for these
tests.
Make it possible to have more kits present when starting
with existing settings or if more kits get automatically
generated when starting with clean settings.

Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-17 04:13:30 +00:00
Christian Kandeler
1d2af6b4cc clang-tidy: Consider context when encountering duplicate files
Prefer source files from contexts where we know that they actually get
built and thus should have includes and compiler flags properly set up.
Also fix the qmake and qbs project managers to not mislabel any non-
application products as libraries.

Fixes: QTCREATORBUG-23394
Change-Id: I0d122c7b58e12d14d68a1ca7337df83074299cd7
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
2020-06-12 09:14:31 +00:00
hjk
db4f6a0e94 QmakeProjectManager: Suppress parsing for inactive build configurations
Change-Id: I25bf1cd4e1382ecf55df853f4f1ee3c16657a2f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 09:34:32 +00:00
hjk
f120d78f32 QmakeProject: More and better tracing
Hide the parameters behind yet another macro to get a uniform layout
and avoid parameter evaluation in the normal non-traced case.

Change-Id: Iaf24b0f1b285c8f664f8b3476ae82c39c1a2d7dd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 09:29:06 +00:00
Eike Ziller
d79febdde9 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakekitinformation.cpp

Change-Id: I90ef0063ed24e23bcb3d73fff086f50324faa1e2
2020-04-24 13:58:05 +02:00
hjk
85597f85b0 QmakeProjectManager: Fix missing run button activation
The problem could be reproduced as follows:
  - open any bigger qmake based project (e.g. QtCreator)
  - de-activate all kits
  - activate one kit
  - wait until the first parse (e.g. Debug build finished)
  - switch to Profile, and toggle the Shadow build button

The toggling re-starts the parsing.  The parse guard will not be released
in decrementPendingEvaluateFutures() (arguably correct as the parsing as
a whole is not done). On enteringing incrementPendingEvaluateFuture()
due to the re-start, the guard still guards the parse, but a new guard
is created in guardParsingRun(). As this happens while the build system
isParsing() is true, the created parse guard will be "non-guarding".
On assigning to m_guard, the original guard object will fire and then
be replaced by the non-guarding guard, that never fires again, so the
the build system will never have hasParsingData(), which is a
condition for the run buttons to activate.

As a workaround for people running into this issue in 4.12.0:
Select 'Run qmake' from the menu (any subproject suffices), and let
it finish.

Change-Id: If7a55db56ec67bac2635fb9a745b9aaf6ca6a413
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-24 09:58:34 +00:00
hjk
f781a72825 QmakeProjectManager: Add more detail do trace message
Change-Id: Ide8917d826baaa7277dde744f3843d5ab7fe0afd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-23 05:01:02 +00:00
Eike Ziller
deb0eaf795 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I34c3d1fd5be90537e37d15e00b1a0d455d1bf81d
2020-04-14 09:47:38 +02:00
Christian Kandeler
c0ea5736f3 Fix invalid reports about Qt <-> project mismatch
For instance, the warning was potentially erroneously triggered with
examples distributed via the installer, as those are present only once
for different installations with the same version number.
Amends e4738904d9.

Fixes: QTCREATORBUG-23753
Change-Id: I0dbb296cd974a3530222661c4b8cecc2106f0ea5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-04-08 08:44:49 +00:00
hjk
2444595fbc Qmake: Move context build action handling to build system
Among others, this removes the wart introduced in 4d3d2d0dfb.

Change-Id: Iafa63f6e4cca327a1d1dd6a8bbcfaa10032327db
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-30 10:21:55 +00:00
Tobias Hunger
10e79cebc9 BuildSystem: Add buildConfiguration() method
Add a buildConfiguration method that returns the saved
BuildConfiguration or the active BuildConfiguration if none is
set.

Change-Id: I8af25aa1037f59a0091900bac7eb84fed9e5fbb0
Reviewed-by: hjk <hjk@qt.io>
2020-03-23 13:16:15 +00:00
hjk
80a766a2cb Qmake: Move buildDir() from ProFileNode to QmakeBuildSystem
More a buildsystem than a node thing in general and removes
one use of activeBuildSystem and one use of the ProFileNode
-> ProFile back pointers.

Change-Id: Ie007fcd0db9e9294a08b3a1cd68f825c7d3dc9b8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-23 07:42:15 +00:00
Tobias Hunger
a596421ffc BuildSystem: Clean up use of BuildSystem::(kit|target|project)
Change-Id: I4852689cb54d02bb278f9cd596f1de506a43fc04
Reviewed-by: hjk <hjk@qt.io>
2020-03-20 13:10:01 +00:00
Christian Kandeler
f7d91a01d1 QmakeProjectManager: Use delay timer from base class
Change-Id: I38b55efc34b34b58430d1d665eb6672c3de89b4f
Reviewed-by: hjk <hjk@qt.io>
2020-03-16 13:00:16 +00:00
Eike Ziller
22cdc47077 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp

Change-Id: I4a90920e52dbbe9eb46aef3437ee3c5a6e7b31c6
2020-03-16 08:30:33 +01:00
hjk
3d67fbc55f Qmake: Do not delay initial parsing
And add some logging to make the situation debuggable.

There are a lot of reasons that currently trigger (or attempt to
trigger) parsing, including two unconditional ones on build system
construction and fromMap. Some can be avoided, but keeping track of
which one will be the "needed" one gets tricky without additional state.

So turn it around and try to reparse "immediately" until such a parse
finished. The parser itself is robust enough to deflect repeated
runs before the first one finishes.

Change-Id: Ic992b8730fa3a09ca14532cdd9bdbab4c245cb41
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-12 09:01:26 +00:00
Leena Miettinen
8bb3102438 qmake: Fix UI text according to the guidelines
https://doc.qt.io/qtcreator-extending/qtcreator-ui-text.html

Task-number: QTCREATORBUG-23683
Change-Id: Id567c21af61c939e177c65b2e1907b13f9b0bb62
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-11 12:00:38 +00:00
Eike Ziller
995ba78fae Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/tealeafreader.cpp
	src/plugins/cmakeprojectmanager/tealeafreader.h
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
2020-03-04 08:15:50 +01:00
hjk
b0b50257ec ProjectExplorer: Pass extra project files as QSet
They are available in some cases as such, and consumed as such.

Change-Id: I9866c7d7bd817fb19a8b11a0efbe583ed55fe393
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-03 09:17:20 +00:00
hjk
4672013595 QmakeProjectManager: Merge QmakeManager into QmakeProjectManagerPrivate
No need for two manager type classes talking mostly to each other.

Change-Id: I82a52385df08dc4cddac2d294661341a79b86a4d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 14:26:28 +00:00
Eike Ziller
61dc14b67f Merge remote-tracking branch 'origin/4.12'
Change-Id: I3e7049da2c3da6f784e3cb3407c22ada556e5d24
2020-02-26 08:35:05 +01:00
hjk
cc857390f8 QmakeProject: Use buildsystem's own build config for toolchain tests
It is currently only getting there if it's the active one, so it is
not a real problem, but distracting.

Change-Id: I1f83644a71a3f22e23f966e273c1a23cfc0cc6b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-25 13:38:53 +00:00
hjk
3f68292dbe ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChain
Special accessors to the repeatedly used C and C++ cases to denoise
and slim down user code.  Plus some code cosmetics nearby.

Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 15:59:12 +00:00
hjk
e9f2178a4a Qmake: Use direct access to build config from system when available
Change-Id: Ic514fb73db90f0868679d04efba62c40e28b7b59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-07 10:55:34 +00:00
Christian Kandeler
96868447ce QmakeProjectManager: Make sure we reset the ProFileCacheManager
Otherwise, we can get an assertion when exiting during a parse.

Change-Id: I3a2a1fbb854662b77b2e1485a9097b9f39d94fe2
Reviewed-by: hjk <hjk@qt.io>
2020-02-07 09:40:14 +00:00
hjk
278e981422 Qmake: Deactivate parse guard before it can cause trouble
... in the QmakeBuildSystem destructor

Change-Id: I23336cc0b72673fd2c63235b1c568439159d3d8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 16:45:04 +00:00
Tobias Hunger
e4738904d9 TargetSetupPage: Improve reporting on invalid kits
Give the reason for a kit being disabled in the tooltip.

E.g. for a CMake project you will now get

"Kit is invalid: No CMake tool set."

instead of a generic error message about the kit being invalid.

Change-Id: Ic776dc24149d65ebf27163b605ec2e52a3a504a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 13:50:57 +00:00
Christian Kandeler
37aecdd112 QmakeProjectManager: Do not keep an IDocument in QmakePriFile
Instead, we keep the IDocuments as "extra project files" in the Project
class, like the other project managers do it.
This has two advantages:
    - The document is no longer created in a parser thread
      callback, improving Qt Creator responsiveness while
      loading a project.
    - The IDocuments no longer get needlessly destroyed
      and re-created on a re-parse.
This is relevant because adding these objects to the DocumentManager
results in the creation of file watchers, which is expensive.

Task-number: QTCREATORBUG-18533
Change-Id: I49c03377974e6b33340234dbabbbd82b8d0c827c
Reviewed-by: hjk <hjk@qt.io>
2020-02-04 11:01:01 +00:00
Christian Kandeler
c7d8b9b01c QMakeProjectManager: Move some parsing code out of the UI thread
When parsing larger qmake project, the callbacks from the parser threads
are currently overloading the UI thread, often rendering the application
non-responsive until the project is completely loaded.
This patch moves some expensive operations from the UI thread into the
parser threads, at the cost of a somewhat ugly two-stage setup for some
types of objects.
On my Linux machine, I measured that the time spent in parser callback code
went down by almost 50% when loading the Qt Creator super project.

Task-number: QTCREATORBUG-18533
Change-Id: If9624da5b07e81a50c180693580b20a70e1aaea7
Reviewed-by: hjk <hjk@qt.io>
2020-02-03 16:07:54 +00:00