Commit Graph

166 Commits

Author SHA1 Message Date
hjk
c28fb1fdbe ProjectExplorer: Rename ToolChain to Toolchain
Change-Id: Ibb520f14ff3e2a6147ca5d419b9351c50c141063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-24 15:18:24 +00:00
hjk
b89baec2c1 ProjectExplorer: Promote CppProjectUpdaterInterface
... to ProjectExplorer::ProjectUpdaterInterface and generalize it
regarding language, but create a convience function for the C++
case, as that's the only user right now.

Also add the self-registering factory boilerplate and adapt all
buildsystems.

Change-Id: If928512609d41c25fad2aa58633c8bffabc4c48f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-06 14:50:10 +00:00
Jarek Kobus
72118e018e CompilationDbParser: Make parseProject() static
Don't operate on the same CompilationDbParser instance
in the main and the separate threads.
Pass needed data as parseProject's arguments.

Change-Id: Idf5e5d92727d5a279256673088880e6d2f48a7c1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-10-06 15:27:55 +00:00
Jarek Kobus
e8da3b5119 CompilationDataBaseUtils: Pass arg via const ref
Change-Id: I6374b0064249a4574ed77e6c9ae4bca3122878c5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-10-06 13:54:47 +00:00
Jarek Kobus
0cdced6914 CompilationDbParser: Make readExtraFiles() static
Make a local variable const.

Change-Id: I9befa9e9714bc6b3bf3f524c64880ad1bf9400d6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-10-06 11:40:35 +00:00
hjk
0b08a9752a CompilationDBPM: Remove some unneeded #includes
Change-Id: Iaccd053b12c440b07b7f07cdba70cf05ace1b03c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-09-14 11:49:10 +00:00
hjk
9679412a23 Replace QFile::exists by QFileInfo::exists
QFile::exists only calls QFileInfo::exists, so this saves one
function call per invocation.

Change-Id: I41cb407345654eeead14455a4955b8b9b015aedc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-01 10:24:31 +00:00
hjk
017d7c0e47 ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}
Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 07:31:03 +00:00
Eike Ziller
a419670ff5 Build: Change plugin json.in files to CMake style
They were still using variables in qmake style.
Directly use CMake variables in the json.in files and remove the no
longer needed escaping of quotes.

Adds a fatal message if it detects the old style in a .json.in file for
easier porting.

Change-Id: I8de88d8db2da55781f0e9d72eda03f943723188e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-25 13:21:16 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +00:00
hjk
d8de6c88e9 Avoid creation of temporary lists of ProjectNodes
Change-Id: Iac84f7f95291fb3b12a071a066d358aaab309c52
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-17 11:05:39 +00:00
Eike Ziller
2bc37de42b Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/python/pipsupport.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/examplesparser.cpp
	tests/auto/examples/tst_examples.cpp

Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
2023-04-13 15:59:08 +02:00
Alibek Omarov
abe7738811 CompilationDatabaseProjectManager: Add missing GCC include flags
GCC also accepts -iquote and -idirafter flags to set include path.

Change-Id: Id8088faa4cfcfb9d6005ad13527c0bc26dc4feb3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-11 12:29:05 +00:00
Eike Ziller
7fc0dcec0d Fix lots of tr.h files not being mentioned in CMakeLists.txt
Change-Id: I63d364ac50d9587339b10a5571870cb9a81c54ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-04-01 04:25:17 +00:00
Alessandro Portale
50a214de9e Qbs build system: Add a component for test files groups
Mainly in order to enforce a unified group name across QtC libraries and
plugins.

Change-Id: I6eafe0f9d227ec73d8c9029675866c67063768fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-21 14:54:08 +00:00
hjk
2704f8ff0b ProjectExplorer: Proliferate FilePath a bit
Change-Id: Ia671a1de17b9e58764375c5f64cc47b053b0725a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-15 09:57:02 +00:00
Jarek Kobus
adaf067e77 CompilationDBParser: Use QtConcurrent invocation for async run
Change-Id: I9649db2d7c890e89ddc3f5da36715b4fa6d5219b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-09 11:13:01 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
Alessandro Portale
e27f82b49e Translations: Merge "OpenWith::Editors" into "QtC::Core"
Change-Id: I241ccc53afa11fa3faa1f1ca9363421827081812
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-02-20 08:00:37 +00:00
Christian Stenger
518a513888 CDBPM: Adapt to change in FilePath
Silences a soft assert.

Change-Id: I976ba259533ab33b23f8b530b277638bf727af59
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-15 13:39:05 +00:00
hjk
b2815c39b1 CompilationDatabase: Use new plugin test setup
Change-Id: Ic45c59a2adb3287e2cd92b70836bc309f5e1a8e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-02-15 12:32:21 +00:00
Jarek Kobus
288b43424a Remove unneeded includes of task.h and taskhub.h
And some other includes spotted by the way.

Change-Id: Icd5eadf16617506fe48fae52ff0639d247002d75
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-14 10:35:08 +00:00
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
Alessandro Portale
4f55dbdd38 CompilationDatabaseProjectManager: Tr::tr()
Change-Id: I5a4b05ce3eab90cfe05c297fa3971f94270ec474
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 15:03:32 +00:00
hjk
8a8b50e8b5 ProjectExplorer: Proliferate Utils::FilePath use
Move the .toString() uses into  DeploymentData::addFilesFromDeploymentFile

Change-Id: Ic9ef22da1918ca105c92f0231960dab27b0d80bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-08 08:21:29 +00:00
David Schulz
739d4942e2 Merge remote-tracking branch 'origin/master' into 10.0
Change-Id: I9f6090e2a9f62fd3a9823f5a7342ea423dfbb2ac
2023-02-01 05:24:33 +00:00
Christian Stenger
04f521abcf CompilationDBPM: Adapt to FilePath change
Change-Id: Idc2987e0568d34cf024cb170aa604f47053c9617
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-30 12:20:20 +00:00
Jarek Kobus
62e0b4052f Remove unneeded includes of utils/runextensions.h
BTW, spotted some other unused includes marked with yellow.

Change-Id: I364e4b6fae73a2be2cfd3a63c1100be4a91aa49a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-27 13:16:44 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +00:00
Alessandro Portale
9414083ed5 CompilationDatabaseProjectManager: Fix recent FilePath-ification
Amends: 33cdb052ba

Change-Id: Id2a7133aaee9e4618683066ce116090c522f04d5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-13 15:24:57 +00:00
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +00:00
hjk
33cdb052ba FilePathify some testing code
Change-Id: I3739a6eb3c2172078e9519e8186daf94ec74d99a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-13 10:46:13 +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
Christian Stenger
538b77e376 CompilationDatabasePM: Fix test on Windows
Change-Id: Id771d3fbcb111ef3b8c4177981794c3bd841cedc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-06 12:30:04 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +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
hjk
8a44294821 Merge remote-tracking branch 'origin/8.0'
Change-Id: Iea4fd2949f5d5345802e2e7d9283d72c6c55f69f
2022-08-03 10:52:13 +02:00
Christian Kandeler
98a39401db CompilationDatabaseProjectManager: Be more careful with filtering
Do not blindly remove all flags that contain the file's base name.

Fixes: QTCREATORBUG-27990
Change-Id: Ib51b65a8694e82ec22af859176b0db0e5d86b5f0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-08-02 13:50:14 +00:00
Eike Ziller
347e489d14 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/clangcodemodel/clangdclient.cpp
	src/plugins/projectexplorer/kitmanagerconfigwidget.cpp

Change-Id: Id1454bfe8e4f283f3b06ac6945aced2975814161
2022-07-28 11:53:13 +02:00
Alibek Omarov
5b72ecbff7 CompilationDatabaseProjectManager: Fix cached state being unhandled
In this code, database file is being hashed and if hash stays the same,
parser quickly returns ParseResult::Cached. But as database never gets
read, source tree isn't being built, thus dbContents() never gets called

I moved ParseGuard::markAsSuccess() call to the finish() method of parser,
so we tell ProjectExplorer that parsing finished successfully on Cached state

Change-Id: I7ea28017e653ac6e2d7f50047c09a6eb7ecda13f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-07-26 20:29:39 +00:00
Marcus Tillmanns
3462bc67be filesystem: Add QFSEngine for filepaths
Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 13:14:01 +00:00
Eike Ziller
91fb0cf123 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/qmldesigner/qmldesignerprojectmanager.cpp

Change-Id: I5106bb632c2a3a144287097137be45b0894b9ee4
2022-07-04 08:53:22 +02:00
hjk
3be472c8d2 ProjectExplorer: Use FilePath for sysroots
... and reduce to the relevant part when passing to cmake.

Task-number: QTCREATORBUG-27229
Change-Id: I7cde2ff04530caf439d6707c2c6d15a8e734ae0b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-06-30 09:06:29 +00:00
hjk
9e363c6421 Add plugintr.h files to all plugins
Except FakeVim, which had it before.

for i in [a-eg-z]*/*.json ; do
    upper=${i##*/}
    upper=${upper/.json/}
    lower=${i%/*}
    trfile=$lower/${lower}tr.h

    cat << EOT > $lower/${lower}tr.h
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

namespace $upper {

struct Tr
{
    Q_DECLARE_TR_FUNCTIONS($upper)
};

} // namespace $upper
EOT

    git add $trfile

    perl -pi -e "s/(${lower}_global.h)/\1\n    ${lower}tr.h/"  $lower/CMakeLists.txt

    perl -pi -e "s/(\"${lower}_global.h\",)/\1 \"${lower}tr.h\",/"  $lower/$lower.qbs

done

Change-Id: I15ebbaaa9443c57b391b9e143f592d8a0c9208a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-27 13:34:57 +00:00
hjk
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
Christian Kandeler
b6adaab3ea CompilationDatabaseProjectManager: Fix flags extraction
The code would blindly remove all "options" starting with /, which meant
that all file paths arguments got lost on Unix-like hosts.

Fixes: QTCREATORBUG-22949
Change-Id: I43e2b1e57ed0e9ced9da8fa46d98d9ac25f83d13
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 10:20:38 +00:00
Eike Ziller
f562ebf239 Mimetypes: Make implementation switchable between new and old
- configure with QTC_USE_NEW_MIMEDATABASE to switch to the new one in
  utils/mimetypes2/
- added utils/mimeutils.h header for the Qt Creator specific static
  wrappers, that also includes the "public" headers for MimeType et al
  from the new or old implementation, depending on configuration
- change all utils/mimetypes/ includes to utils/mimeutils.h
- move the implementation for the wrappers to
  utils/mimetypes(2)/mimeutils.cpp
- also move the MimeDatabase declaration in the "old" implementation
  back to utils/mimetypes/mimedatabase.h

Change-Id: Ie8de229c035d6cd9a5e4739dc0fa78d9c17228e3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-25 07:19:58 +00:00
Eike Ziller
9d8a419d10 Remove qmake build files
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.

Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 12:18:15 +00:00
Christian Kandeler
9f7cdd6d3c CompilationDbProjectManager: Fix tree scanning
- We checked for the QFuture's canceled status at a time where it would
  always yield true.
- A pointless default value was used for the project root path.

Fixes: QTCREATORBUG-26356
Change-Id: I4d17c6ecb7e9e7e71df737d85b42feb37d3ead5d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-22 09:06:09 +00:00
Orgad Shaneh
f2f1fc8601 Use lowercase for Windows header for supporting cross-compilation
Linux mingw uses lowercase headers, so cross-building on Linux for Windows
target must use the correct form. Windows is case-insensitive, so it won't
affect host-native builds.

Change-Id: Ic2140412bb367bbce83b5e2546d70e0936928c5c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-27 07:23:22 +00:00