Commit Graph

57 Commits

Author SHA1 Message Date
Eike Ziller
dab19c4a8c Use Nanotrace to generate startup performance report
Add various trace points to the code, including the plugin
initialization methods (centrally in plugin manager), code that is
scheduled on the event loop with QTimer::singleShot or
QMetaObject::invokeMethod during initialization, and code that is
triggered from ICore::coreOpened

Can be turned on by configuring with `BUILD_LIBRARY_NANOTRACE=ON`
Run with `-trace <file>` to write trace file. If Nanotrace is not built,
the added code expands to nothing.

Changes in Nanotrace:
- turned generated data to microseconds instead of nanoseconds, because
  that is what Chrome tracing expects
- fixed serialization of duration (needs to be an item of the event, not
  in a "arg" subitem)
- fixed shutdown() to reset the initEvent

Change-Id: I994de82023b820d771e1be0a859ebd8da0b73d4d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-12 07:32:07 +00:00
hjk
55b5b8a975 CMakeProjectManager: Fix connection to save tools settings
Amends 4e23f2a6eb.

This should actually not be needed in the end, and rather steered
by the auto registration and settings page apply.

Change-Id: I7f94e776fec4394f539e32e5c527c367251654a8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-23 10:47:10 +00:00
hjk
3e155919eb CMake: Use current pattern to access main settings page
Change-Id: I95c556bebe1d583879b6702f727d9a859b9a4bcb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-07 12:57:27 +00:00
hjk
91513a53dd Utils: Make aspect settings access implicit
Generally, aspects should use fromMap/toMap, but some older pages
use {from,to}Settings with always the same ICore::settings().

To make that less intrusive on the user code side, make that globally
implicit.

Task-number: QTCREATORBUG-29167
Change-Id: I29a8e23a31eb8061bb143e93931a07c6741eb7f9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-07 09:02:29 +00:00
Cristian Adam
a8f288fc9e CMakePM: Store CMake Autorun state for all tools
Amends 2f39b51bdc

The default tool's value is taken as default global value,
then will be saved for all tools.

This fixes the case when the false Autorun value for the default
CMake tool would always be set as global autorun with no option
to actually set global Autorun value due to the "upgrade" path
mechanism.

Change-Id: I17076bc0c77b087c5d4048fdfe74ddf91d837fd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-08 14:52:48 +00:00
hjk
87c3f08e52 CMake: Move settings storage closer to class implementation
Simpler in use.

Change-Id: I8cc929001035974b9b73566b206410bfd77f73a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-23 14:49:45 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Cristian Adam
2f39b51bdc CMakePM: Make "Autorun CMake" a global setting
The "Autorun CMake" is only visible in the Tools settings page when
the user clicks on CMake tool.

This is not very visible and it doesn't have to be per CMake version.

Change-Id: I57ded0b2e6a3ecb731bb8bc1495b6b61bc04c8b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-05 14:37:50 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
ab4c9b9679 CMake: Move to Tr::tr
Change-Id: I169da93b5184351cb915d4c198fd33318fcfe06f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 06:56:21 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Marcus Tillmanns
2c4553366c docker: Correctly initialize Kit during autodetection
* Added returning the Id after detecting CMake so it can be set in the autodetected kit
* Trying to keep autodetect from adding the same Qt installation twice if qmake is linked in /bin and /usr/bin
* Added FIXME for RunControlPrivate::runConfiguration as it is used after free in rare cases
* Fixed IosCompilerDetector to not just run if a device is set
* Fixed QnxCompilerDetector to not just run if a device is set
* Fixed auto-detected debuggers not being set as auto-detected, as they now can be removed from the device screen

Change-Id: Ia7772c454d70e147e4326efacc4a6a888fa26782
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-12 14:15:45 +00:00
hjk
16c25d99c8 Docker: Provide a means to select search paths for auto-detection
A combobox in the device dialog to select between the (docker image's)
system path and a semicolon-separated set of user defined paths.

Use it for cmake and gdb detection; qmake and toolchains currently missing.

Change-Id: I3c478ca914a1bf02dcb69ebcb9ea6e358d24aaf9
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-14 11:15:21 +00:00
Christian Stenger
1cc50c8dcc CMakePM: Prevent device cmake becoming default
When auto-detecting cmake on device ensure any found
cmake will not end up as default cmake as this would
update even desktop related kits to use this if they
had no cmake configured before.

Change-Id: I27960fc1f76d95bd7ddef6bff40f163aa46a610d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-12-09 13:48:07 +00:00
hjk
57a90b019f Utils: Introduce a FilePath::searchInPath() convenience function
Diverts to searchInDirectory(). Use it in some places.

Change-Id: I9e5642f0ae0ed4dd9fb9f34bcaa11a25bd26c690
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:56:24 +00:00
hjk
a78665ede7 Utils: Rename FilePath::searchOnDevice to searchInDirectories
Makes it a bit clearer that there's no magic path use or similar
beyond this point.

Change-Id: I86c06850d16bf777db05ad23b540d8096926c059
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-12 08:29:09 +00:00
hjk
cb23530798 Docker: Add a button to list auto-detected kit items
Helps to understand what's going on.

Change-Id: I5b8c591cbd60227cf250932c8654063236eec05f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-21 06:44:21 +00:00
hjk
d06c670504 Utils: Introduce a FilePath::withNewPath() convenience method
It's effectively the mirrored version of onDevice() with an
equally odd name which is a bit more straightforward to use
in some cases.

Change-Id: I0cfedeb58871a857c93144e2a0d734bad1bcd887
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 11:13:14 +00:00
hjk
f8c7d2e848 Docker: Rework auto-detection and removal of kit items
- Use more uniform messages for the different kinds of items
- Remove all auto-detected items

Change-Id: I0b0df0bca484337039432b163bd8e19593b1cd22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 12:55:53 +00:00
hjk
a4c05f585f Docker: Move some cmake detection logic to cmake plugin
This make the code better re-usable from other places that
wish to put a cmake version into a new kit.

Change-Id: I1ef7770a7f8efa36e88b2f3862b011fecd38de98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 09:41:30 +00:00
hjk
6d26f4f5b0 CMake: Allow autodetected tools to associate themselves with kits
Change-Id: I5b48ddf36ba1b9c4eb6476017be63c4d43b60627
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 13:57:36 +00:00
hjk
8ffeecc633 Docker: Simple Auto-detection for cmake binaries
Change-Id: Ia7e6f648c99c87786604cb8801c1408b9e231d3d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 08:10:03 +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
Tobias Hunger
5350288e45 CMake: Fix includes all over the CMake plugin
Keep internals internal, remove some unnecessary includes, add
some that should have been there.

This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.

This patch also moves some code around that ended up being
in the wrong file.

Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-20 10:05:24 +00:00
Tobias Hunger
e38ccf16cd CMake: Make use of CMake-provided .qch files
* Have UI to select a .qch file location in CMake Tool setup
* Auto-detect CMake's .qch file in its default location (relative
  to the cmake executable)
* Register the .qch files with the HelpManager

Task-number: QTCREATORBUG-21338
Change-Id: I4057eec42c39535012d9f0daf788fc62ef20d544
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 10:40:03 +00:00
Eike Ziller
b61a5b759b CMake: Remove unused function
Change-Id: I6b793e0cb01b989f3087dcefe091b77bcfebe370
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-08-12 12:54:19 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Christian Stenger
5944c7f0f6 CMakePM: Fix order of initialization
CMakeToolManager instance must be created first to avoid connects
to a nullptr.

Change-Id: If8738a26d58c80ffc9a63193240895f1bc9a87ae
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-20 05:47:40 +00:00
Tobias Hunger
abc177efbc CMake: Use SettingsAccessor to read/write CMakeTools file
Change-Id: Idcb0d97c8ef4037ea97d8498f935f8631ca30bc5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-10 09:00:14 +00:00
Tobias Hunger
58ebcbe0ec CMake: Use unique_ptr to store CMakeTools in CMakeToolManager
Change-Id: I4dfb76b40e22da745b80c359d544fa2b6d3dac52
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-10 09:00:06 +00:00
Tobias Hunger
ccfb7c6aa4 CMake: Make handling of default CMakeTool more consistent
Change-Id: Idc2ba2c51122855f0b335f89ca5f916dea7665c5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-03 08:33:37 +00:00
Tobias Hunger
a15a7052c4 CMake: Simplify CMakeTool registration in CMakeToolManager
Change-Id: Ida5e6aea8c39ef21f535e06c8fed11b130f875e9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-02 09:54:34 +00:00
Tobias Hunger
2127f96f5f CMake: Remove CMakeTool::addCMakeTool method
Change-Id: I9c6abb58711acc14ae78d79b6f077034389c0a6f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-02 09:54:26 +00:00
Tobias Hunger
dca645f4c0 CMake: Fix header-related issues in CMakeToolManager
Just reorder some lines, make it clearer where the headers are actually
used.

Change-Id: Iec5cf98e7cfad7ee1bdd98df85df38b03c54dff4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:43:11 +00:00
Tobias Hunger
1c014c7573 CMake: Remove handling of legacy settings for CMake
Remove the code that reads CMake tool location from the Qt Creator settings
and then removes them from there.

This code was added in QtC 4.1 to ease transition to the (back then) new
cmaketools.xml settings file.

Change-Id: Ice96628159f4171716882cfdefc8991ec2341556
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:43:03 +00:00
Tobias Hunger
9c1fd4c2aa CMake: Move CMakeTool merging into separate function
Change-Id: I7c70e0aa09def8c7483d183791a76e56be18a0a4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:42:51 +00:00
Tobias Hunger
f5d51dcb69 CMake: Simplify restoration of CMakeTools a bit
Change-Id: If62acc96bb64e8e0c2767e35d4f2bca43cc23c65
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:42:41 +00:00
Tobias Hunger
be7109d732 CMake: Move code around a bit
Change-Id: I6129ee26ddd6ef2af713ad249dc884e63c1d5d6e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:41:56 +00:00
Tobias Hunger
88438a0e79 CMake: Small simplification
Change-Id: Ib89f95febeb45628e99e3c6a473853da4dcde3d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:41:49 +00:00
Tobias Hunger
8128d89a0b CMake: Remove cmake autodetectionhelpers
No user in-tree and the Ubuntu SDK for which this code was added
is no more.

Change-Id: I5b0c5f6faccf1adb451c4043378a204bfc350e50
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-27 13:07:43 +00:00
Tobias Hunger
73f617ab34 CMake: Simplify code
Emit signal in addCMakeTool method directly instead of later.

Change-Id: I4640ffdf76d22f80a8c1ee14f8d79cc7885ddd70
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-06-01 14:03:19 +00:00
Eike Ziller
f42ea09b74 Do not construct settings/resource paths from QSettings object
These paths are controlled by ICore.

Add ICore::installerResourcePath() to replace constructions with
settings(SystemScope)
Replace constructions with settings()->fileName() by usage of
ICore::userResourcePath().

Change-Id: I5a9fa9d09f2563c39dc5d11a4586da825c62f9ac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-11 10:42:09 +00:00
Tobias Hunger
3d8be750b9 Environment: Use Utils::FileName for path() and related methods
Update users accordingly.

Change-Id: I9432e82308e9d0630514c6c8632aeb6b6ee0cf90
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-27 07:37:26 +00:00
Orgad Shaneh
f10af21922 CMake: Fix auto-detection on Windows
Recent CMake installer (3.9) installs the executable in CMake/bin.

Change-Id: I3912badc0907c91044e76b3155e924dd985819f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-14 10:01:15 +00:00
Jake Petroules
e3285ce85d Auto-detect CMake in standard paths on Windows and macOS
Change-Id: I8ae765eaed5bc234347e01fe81c208b77c1c32ec
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-23 17:41:13 +00:00
Tobias Hunger
5c5e5a3aae CMake: Remove "Prefer Ninja" checkbox on CMake Tool page
This is no longer needed now that the generator is a property of the
Kit.

Change-Id: Ife35fd9207c805a4ead1e067603df1bfc77e6855
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-15 11:06:24 +00:00
Tobias Hunger
fa17e27b7f CMake: Delay initialization of CMakeTools
Do not run cmake 5 times during startup. Delay that as far as possible.

Also add a supportedGenerators() method while visiting the code anyway.

Fix up and simplify the other cmake help output parsers.

Change-Id: I6622d552ffe559bf099b4b278618676a045e350e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-27 12:43:45 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
b2b6d3c526 CMake: Semi-automatic cleanups
* Shorten header guards
* Use override and auto where possible
* Remove useless destructors, etc.
* Remove private slots sections, unify private: sections
* Use member initialization where it makes sense

Change-Id: I00eaf6d706adc16859176d1b68c631d3336bb39f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-01-08 12:17:41 +00:00
Tobias Hunger
ca29cbfc8a Consistently use Utils::FileNameList
Consistently use Utils::FileNameList in favor of QList<Utils::FileName>

Change-Id: Iafbb466c882bfd91c25c9e78f107d401bfdb6d55
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-16 08:33:02 +00:00