Commit Graph

357 Commits

Author SHA1 Message Date
Jarek Kobus
925bb2ca31 Various Plugins: Simplify return QStringList statements
Change-Id: Id014225851e6b9f8436387c681bea42e5de3b797
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-02 05:38:31 +00:00
hjk
2559654132 GenericProject: Use the right kit in example creation
Change-Id: I1743f3bdcda0658ef5062f1a1784597b95e9bfec
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-28 06:38:19 +00:00
Eike Ziller
7724f8653f Merge remote-tracking branch 'origin/10.0'
Change-Id: I7a3925ad8e4f97461b64a70217102ed900430253
2023-05-05 10:39:47 +02:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Christian Kandeler
6bf6b89fe8 GenericProjectManager: Do not make every subdir an include dir
Large projects can have thousands of subdirectories, only a tiny subset
of which are supposed to be include directories. Use the directory name
as a heuristic instead.

Fixes: QTCREATORBUG-29099
Change-Id: I207ea2b7d2739c4f6c27fa96865dfde2570caf8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-02 15:04:30 +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
hjk
5d21da74f9 Utils: More explicit host os use to make it stand out
Quite a few of the uses are actually wrong, but are better visible
now and therefore more likely to be fixed.

Change-Id: Ia51f7d6eb1b2d3a9c9f73d67dabacfd227c44b15
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-07 15:53:18 +00:00
Eike Ziller
2f5aed6c78 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/clangcodemodel/clangdlocatorfilters.cpp

Change-Id: If91f26625ea9620fb9fdbf45705b32f37cb7f158
2023-02-10 10:43:06 +01:00
Knut Petter Svendsen
dbe411ca4c GenericProjectManager: Fix outdated comment
Change-Id: I9295380515c64da90a23f4fd95eae67273924d19
Reviewed-by: hjk <hjk@qt.io>
2023-02-08 13:51:36 +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
hjk
3ff5661327 Move some FileSystemWatcher usages to FilePath
Change-Id: I72d24ae3f819e429009b0d7e42b21957f07cb00a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-27 08:18:49 +00:00
Alessandro Portale
5a5a91f7d2 GenericProjectManager: Tr::tr
Change-Id: I7ed1fac9dd6b4517cbc90a8c03a1c67d1e5404ae
Reviewed-by: hjk <hjk@qt.io>
2023-01-20 07:09:48 +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
Jarek Kobus
162c8f71d3 GenericBuildSystem: Don't store unused expander
The default value of expander = project()->macroExpander()
was never used, as later it was always overwritten.

Change-Id: Iafaa491c4fb68aa6b9153a3647f6470a2aa293e8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-09 11:40:56 +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
5d7c5e21c0 GenericProjectManager: Remove two uses of QFileInfo::exist
Change-Id: Ibfa64783ecd7150200683126b432abc8703debc8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-30 10:46:58 +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
Christian Kandeler
d0a192064e GenericProject: Re-introduce variable resolving in include paths
Variable expansion and relative path resolving were accidentally removed
in 25ff15a1fb. Relative path resolving was re-added in 214968a80b, which
is superseded here.

Fixes: QTCREATORBUG-27401
Change-Id: Ida09e7b486765942c43acf55c4ef9c04eb3df12b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-20 13:35:46 +00:00
XutaxKamay
e88d049402 GenericProjectManager: Add support for pre-compiled headers
Users can now add the tag "pch" after a file path in the .files file, and
we will pass this information on to the code model.

[ChangeLog][plugins][genericprojectmanager]
Added support for precompiled headers in generic projects for
Clang Code Model.
In order to use it, inside <projectName>.files add the "pch" tag just
after the filename and the '|' separator, example:
... other files ...
src/pch.h|pch
... other files ...

Fixes: QTCREATORBUG-26532
Change-Id: Iffc9d49cfc0bf92eba56cfc08a3977b0be777131
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-11 16:44:41 +00:00
Christian Kandeler
214968a80b GenericProject: Pass resolved include paths to code model
Apparently, we used to rely on relative paths being resolved elsewhere,
but we shouldn't.

Fixes: QTCREATORBUG-26304
Change-Id: Ia52b728909abc87c1225f8e935f4548a32ca9b63
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-27 08:48:51 +00:00
Eike Ziller
877bfa4056 Add FileSystemWatcher::clear()
Change-Id: I9f28e763c943a6d8c5cf3082755e64d7e4df7155
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-15 06:40:38 +00:00
Christian Kandeler
939cc5af21 ProjectExplorer: Give build systems a name
... and make it accessible through a variable.

Fixes: QTCREATORBUG-26147
Change-Id: I0601c09a74360b91fe8421876207a8f4ae9d75b6
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 14:41:56 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
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>
2021-09-01 14:53:58 +00:00
Christian Kandeler
25ff15a1fb Add convenience functions for creating ProjectExplorer::HeaderPaths
Change-Id: I7b1f63caca6b70ba4ec1b1870b83cbf20aa6564a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-30 10:46:56 +00:00
hjk
1bde4ddbec ProjectExplorer: Use FilePaths in project tree nodes
Change-Id: I31b15c428d9b962333947b1e32641fd80f61d069
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 13:45:06 +00:00
David Schulz
f66df921d7 Core: filepathify file renaming
Change-Id: I3d4f39e34e65cde3df7b7c19570e3a54d0625d53
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-17 11:13:51 +00:00
David Schulz
410b02f8c5 Core: filepathify expected document changes
Change-Id: Ifa9341e55c79459db9ecef3c441da9b2816695bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-17 06:30:51 +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
David Schulz
a13aef759e Utils: filepathify fileutils
Change-Id: Ic9048369f64d793f5f567cdb0c715488fb5a4ff6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-18 14:30:53 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
Christian Kandeler
201786d3fc ProjectExplorer: Prevent target switch on project that's to be removed
Switching targets starts up a lot of machinery that is undesired for a
project that's going away.
The same goes for switching build configurations on a target that is
being removed.

Fixes: QTCREATORBUG-25655
Change-Id: I0cb6e395cca8f89bfeb70fcdf571bbcb64f94247
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-06 10:08:24 +00:00
Christian Kandeler
743ef263c9 GenericProjectManager: Make sure we parse for the right configuration
Fixes: QTCREATORBUG-25592
Change-Id: I5f03fa799f693c16d842cf8279d664194684884d
Reviewed-by: hjk <hjk@qt.io>
2021-04-20 08:56:30 +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
Eike Ziller
8245523653 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/designer/cpp/formclasswizard.h
	src/plugins/designer/cpp/formclasswizarddialog.h

Change-Id: I9f9d166e1a9249022305503f9cbe571136c2a2b1
2020-11-25 11:25:34 +01:00
Eike Ziller
f534624fce Fix build with newest Qt 6
No implicit casts from QString to QFileInfo anymore, and a few more
QChar(int) fixes.

Task-number: QTCREATORBUG-24098
Change-Id: I3326fc0701a9259c7bdd2d8c3025de0a4774f8aa
Reviewed-by: hjk <hjk@qt.io>
2020-11-20 15:43:25 +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
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
Eike Ziller
c8a2ea5433 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp

Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
2020-03-19 09:35:50 +01:00
Eike Ziller
9e0009803c Fix lupdate issues
Change-Id: I26f08ae82354c178f6d26f9138796328b50bfba8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-03-18 10:45:15 +00:00
Tobias Hunger
c32f80b4a7 GenericProject: Simplify Guard handling
GenericBuildSystem::refresh(...) already takes care of a guard,
so there is no need to get and store another one in
GenericBuildSystem::triggerParsing().

Change-Id: I83875ac4a42bfaf67997b5f1977f63913fc1d76c
Reviewed-by: hjk <hjk@qt.io>
2020-03-02 13:27:23 +00:00
hjk
4ad4871fdc GenericProject: Use own target instead of activeTarget()
... when updating deployment data.

Change-Id: Ifa18d4f4fce2fddba91989e2c3094299d4d1f0ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-05 13:30:10 +00:00
Eike Ziller
5c121d5791 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: Ib54f1645ec70a9e6460a888a13190ede130bccca
2020-02-05 11:59:35 +01:00
Christian Kandeler
b59785c4b5 GenericProjectManager: Fix crash updating deployment data
Fixes: QTCREATORBUG-23501
Change-Id: Ia36fe567edf26c293a8db2446d1ee2344b96433e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-22 08:59:14 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +00:00
Leander Schulten
6168c3b675 GenericProject: Do not ignore flags that are not in the first line
Now flags in all lines of the .cxxflags and the .cflags files are parsed. Not only the flags in the first lines of these files.

Change-Id: I2abddbfce9888dd9cb94aa75b562dc86997bdf48
Reviewed-by: hjk <hjk@qt.io>
2019-12-03 13:28:33 +00:00
hjk
c2127c9ec4 ProjectExplorer: Introduce and use a Target::buildSystemUpdated signal
Change-Id: I497d46866146600a1ed9162bd720c574ee4d4769
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 13:08:06 +00:00
hjk
738bbf1a87 ProjectExplorer: Introduce per-buildsystem setRootProjectNode
Currently diverting to the original Project::setRootProjectNode.
Idea is to focus on the BuildSystem <-> generated tree relation.

Change-Id: I8b20173e364713f0919cf4f8b76a2f79ef8770bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 07:40:22 +00:00
hjk
95ba85c86e ProjectExplorer: Use a Kit to initialize KitInfo
Change-Id: I70a83ff9a9da814b4e1ad9ce5e0b626105c09ca4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-11-20 11:31:14 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Christian Kandeler
18ecbb9b14 ProjectExplorer: Speed up FolderNode::addNestedNodes()
... by aggregating the look-up of parent folder nodes.
Also make use of this function in the GenericProjectManager.
As a test case, I added my whole ~/dev directory with ca 600,000 source
files to a generic project. With this patch, the time spent on adding
the new nodes to the tree went down from 15 seconds to two seconds.

Task-number: QTCREATORBUG-20652
Change-Id: If006bce55924feacc071c38ec7a0292d29c51be1
Reviewed-by: hjk <hjk@qt.io>
2019-11-14 12:33:10 +00:00