summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cppprojectupdater.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused includes of QFutureInterfaceJarek Kobus2023-05-041-2/+0
| | | | | | Change-Id: I70f5e842801b628c7f9ad4d433334ce04d4e648e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}Jarek Kobus2023-05-031-1/+1
| | | | | | | Follows AsyncTask -> Async rename. Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225 Reviewed-by: hjk <hjk@qt.io>
* Tasking::Async: Rename Async into AsyncTaskJarek Kobus2023-05-031-3/+3
| | | | | | | | | Rename Utils::AsyncTask into Utils::Async. Rename AsyncTaskBase into AsyncTask. Task-number: QTCREATORBUG-29102 Change-Id: I3aa24d84138c19922d4f61b1c9cf15bc8989f60e Reviewed-by: hjk <hjk@qt.io>
* FutureSynchronizer: Change the default value of cancelOnWait to trueJarek Kobus2023-04-261-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "false" default wasn't really useful. This changes the default value to the following usages: 1. AndroidDeployQtStep Introduced in 91f136ef3ab75471cabcaed9dc16dad9f504add8 The synchronizer was used to cancel the running tasks inside the doCancel(), so the similar behavior should be expected when destructing the AndroidDeployQtStep. 2. GitClient Introduced in f3106ebafe9a02904e822e9698c8b4cbb6c7e0f5 Is used only inside the last line of GitSubmitEditor::updateFileModel(). The running function (CommitDataFetchResult::fetch) doesn't take QPromise<>, so it can't detect if the future was canceled or not. In this case this change is no-op. 3. ExtraCompiler Introduced in c99ce1f455189864de9a2043730f704d7b024abf The intention was to make it cancellable and finish early on cancel. 4. PluginManager global future synchronizer Introduced in 72bddf9f51fedd064f551bcb4ced5feeb46fdfc1 The intention was to make it cancellable and finish early on cancel. The relevant places in code are marked explicitly for points: 1, 2 and 3. Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ProjectInfoGenerator: Use QPromise for async callsJarek Kobus2023-03-101-4/+4
| | | | | | | Change-Id: Ibf95090bee773cabcaed82a79687508e1f017059 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* DiffEditor: Fix a crash when "No difference"Jarek Kobus2023-02-031-1/+2
| | | | | | | | | | | | | | | | | | | | | It may happen that async task associated with diffing one pair of files may not report any value. This happens when both file contents are the same. In this case taking a result from async task on a successful done will lead to crash. Add AsyncTask::isResultAvailable() method. Use it in client code just in case, where needed. Fix DiffFilesController, so that no result is allowed for all running tasks (i.e. make the main group optional). Collect list of optional results instead of direct results. The empty optional on the list means the result wasn't delivered by async task and it's skipped. Fixes: QTCREATORBUG-28750 Change-Id: I4ca678a187fad619bae470da3e806e8c8da61127 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CppEditor: Convert to Tr::trAlessandro Portale2023-01-121-1/+2
| | | | | | Change-Id: Ic4025e06e17c45eb6dc2162fb7f21f5b8aebe84d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* CppProjectUpdater: Reuse TaskTreeJarek Kobus2023-01-111-93/+58
| | | | | | Change-Id: I7474e5a31d169bf435d94536cffd77d218320977 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* ExtraCompiler: Expose TaskItem for compile taskJarek Kobus2023-01-111-27/+24
| | | | | | | | | | | | This is an intermediate state before employing one common TaskTree inside CppProjectUpdater. Use multiple one-task TaskTrees for now. Refactor ExtraCompiler so that there is only one pure virtual method to be implemented (taskItem()) instead of two (2 run() overloads). Use TaskTree inside ExtraCompiler for running the compilation process. Change-Id: I6884934508e043594589d117f6d3f0aed94b84c2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppEditor: Use FilePath for ProjectPath::m_sourceFileshjk2023-01-111-2/+3
| | | | | | | ... and update using code. Change-Id: I682727a4b2982dba388e7cc7b9488225748d591f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-2/+2
| | | | | | | | | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.0' into 6.0Eike Ziller2021-11-031-1/+6
| | | | Change-Id: I436d15f2aeefbf6fc80340f01398509c213fc1b1
* CppEditor: Un-export some classesChristian Kandeler2021-09-061-0/+2
| | | | | Change-Id: I285fe7bd3ac835c4a43f0a200dd7905f577ff211 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-0/+179
There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>