Commit Graph

326 Commits

Author SHA1 Message Date
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
Christian Kandeler
ecf0105287 GenericProjectManager: Speed up adding lots of files
This operation was slowed down by a function that inserted a new element
into a sorted list without making use of the fact that the list is
already sorted.
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 building
up the new list went down from 90 minutes to one second.

Task-number: QTCREATORBUG-20652
Change-Id: If537e58a73cc5f09bb45d47f0beb2925048a2b14
Reviewed-by: hjk <hjk@qt.io>
2019-11-14 09:54:52 +00:00
hjk
bf47e3ee55 GenericProject: Move parts of GenericProject to GenericBuildSystem
Change-Id: I27b7ccb6a1382dd59c339fbcd3f0275c6b2cc291
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 13:05:57 +00:00
hjk
6a878c7293 ProjectExplorer: Use a functor for BuildSystem creation
... instead of creating the BuildSystem direct. This will help the
shift of BuildSystem owner ship as a Project will have potentially
multiple BuildSystem instances (one per BuildConfiguration), but
still be responsible for creating them with the Targets.

Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 09:01:52 +00:00
hjk
66c7d75dbd Qbs, Qmake, Python, Generic: Introduce BuildSystem derived classes
... and move context menu action handling there.

This is a temporary measure to be able to move that functionality
alongside the actual BuildSystem to the BuildConfiguration.

There is a lot to be cleaned up left, to keep the patch small.

Change-Id: If4b0820a13b376fc97b70785052924972ce22705
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-25 07:55:10 +00:00
Eike Ziller
b6c2277146 GenericProject: Make dependency on CppTools optional
Especially in the light of the language server, the generic project is
currently the project one can use for language servers that require a
"project workspace".

Makes it possibly to run Qt Creator with
"-noload CppTools" if you still want to use generic
projects with some other language.

Change-Id: Ib9059289a2db4c44c0c1060a02fcdafacb885fbd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-13 06:43:02 +00:00
Eike Ziller
9cc45fe1fb CppTools: Move RawProjectPart to ProjectExplorer
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.

Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 06:22:12 +00:00
Eike Ziller
caf08513cf GenericProject: Little cleanup
Change-Id: I348f56ce2154530e7b6cc392cfaae2aa8621df41
Reviewed-by: hjk <hjk@qt.io>
2019-09-03 10:04:35 +00:00
Tobias Hunger
3eea938a04 Project: Rename Project::activeBuildEnvironment to Project::activeParseEnvironment
This is used for parsing the project only, so reflect that in the name. Not all
projects have build configurations, so the old name did not make too much sense
for what this has been used for.

Eventually this code should move into the BuildSystem.

Change-Id: Iff766150b5fe370f2912b0b3b15348b1c1fad5b5
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 07:28:18 +00:00
Christian Kandeler
9f88fc881f GenericProjectManager: Support framework paths
Rather than adding yet another meta file, we use the .includes file with
a special line prefix.

Fixes: QTCREATORBUG-20099
Change-Id: I494e0143b8e0f1f8828a56d7487b2201f1680337
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-19 10:44:08 +00:00
Tobias Hunger
22092ee4e6 GenericProject: Simplify code based on Project::projectFileIsDirty signal
Change-Id: I3e9eb892f22c716c3b6cf40498f232d234aa163e
Reviewed-by: hjk <hjk@qt.io>
2019-08-16 12:46:13 +00:00
Tobias Hunger
09530d6dcc ProjectExplorer: Use RAII pattern for parsing start/stop signalling
Change-Id: I13de537140f265db3e3d0ab1cd924d6897cd90c8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-09 12:45:29 +00:00
hjk
16b9a47e83 ProjectExplorer: Replace Project::projectConfigurationChanged
... by a Project::buildConfigurationChanged. That's the only case
used, and saves filtering on the receiver side. Also, the passed
bc is (in non-null) the active one, so isActive checks are not
necessary.

The null case seems to be only possible to trigger when removing
the currently active build configuration manually i.e. happens rarely,
so having it trigger an unneeded final display update on the dying
build config is tolerable, so drop the null check in such cases
to achieve a more uniform pattern.

Change-Id: I46f72e9e277767214dbd6920dd86b026a7084f46
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-02 13:59:31 +00:00
hjk
09e5c167bd ProjectExplorer: Add convenience Project::addTargetFor{Default,}Kit
Less noise on the user side.

Change-Id: I5cdf4af4910a3cc1ee0af1b43fcbc7329a6d59db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-01 16:16:29 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Eike Ziller
4ce34fd90f Merge remote-tracking branch 'origin/4.10'
Change-Id: I88a6704fb8d723a3cbdfb1a2d9c84741f30d4da6
2019-07-22 09:34:47 +02:00
Christian Stenger
4c6c3de53b GenericProjectManager: Do not crash on removing all files
When removing all files from a generic project QC crashed on
trying to access the first item of the empty file list.

Change-Id: I85045bf126f4e12575305466f0f4a6c4191176d3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-19 05:43:02 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
Christian Kandeler
f7520b7d99 Make the project managers tell the code model about include paths
... from the environment.

Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-07-12 09:13:42 +00:00
hjk
c77cef5706 Avoid more deprecation warnings
Change-Id: Icc7bb7a4ccf7fc9f89f6f668c194ccd440e5231c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-05 07:49:48 +00:00
Ville Nummela
63e4180242 ProjectExplorer: Add special handling for removing files
... from a project which are pulled in via wildcards.
Such files cannot be removed from a project file, because they are
not listed verbatim. This kind of failure should not be reported to the
user if the file is also deleted, as the file list will have the correct
state after the next reparse.

Fixes: QTCREATORBUG-22586
Done-with: Christian Kandeler <christian.kandeler@qt.io>
Change-Id: I3dc66fe9a6594be7d0b86f46d830cd099ee49fd7
Reviewed-by: hjk <hjk@qt.io>
2019-06-25 11:53:58 +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
Martin Haase
76d44aea0d Generic Project: cut common part of path in project explorer
This is necessary, if the project files on a
different directory than the source files. In this case, the project
explorer will show the full path e.g. in windows starting by C: for each
directory until the source files.

use-case:
some directory
|- project directory
   |- *.creator & *.files & ... generic project files
|- source directory
   |- some sub-directories and the source files

Fixes: QTCREATORBUG-19454
Change-Id: I95eee4afdc11adf4281220edc5f6ff29da41a3a5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-05-23 07:32:11 +00:00
hjk
1e9636ab8a Some more FileName::appendPath() -> pathAppended() changes
Change-Id: Ie494f7ae8a96d97c9497b3ef38d774d2cf787b7f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 07:46:56 +00:00
Christian Kandeler
261d7752b0 RemoteLinux: Retrieve deployment info from local install root
This provides correct deployment information as seen by the build system
when Qt Creator cannot retrieve it directly.
It's most useful for autotools and cmake projects, but can also help
with qmake in certain edge cases.

[ChangeLog] It is no longer necessary to provide a
QtCreatorDeployment.txt file when using CMake projects with remote Linux
devices.

Fixes: QTCREATORBUG-21855
Change-Id: I27e07a45dd1565e489f4b573cc3fff8191c57d9b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-23 15:52:05 +00:00
hjk
e3a7aa1ad2 ProjectExplorer: Flip default for ProjectNode::showInSimpleTree
Change-Id: Ibd4f91ad55b2be93d20dfc4f583de95274e981ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:57:05 +00:00
hjk
09372918c1 ProjectExplorer: Remove FileNode's isGenerated constructor bool
Use setter of base class, similar to setListInProject() before.

Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-25 12:23:31 +00:00
Tim Jenssen
c3a04c1873 GenericProject: fix memory leak
Change-Id: I5f5811229c6311fa19432a5018a1da33ead7894a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-21 12:44:30 +00:00
Nikolai Kosjar
62c8aecb5f GenericProject: Support forwarding flags to clang code model
...in order to specify e.g. the language version to use.

Create the additional files project.cxxflags and project.cflags. These
are expected to contain command line flags for the clang code model on
one single line.

For example, "-std=c++11" can be provided to set the language version
for parsing.

Fixes: QTCREATORBUG-19668
Change-Id: I7712f546ba1fae536c32adfa5bd449c5b3484521
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-15 13:33:34 +00:00
Nikolai Kosjar
7b494c068e CppTools: Simplify ProjectUpdateInfo
...by using KitInfo.

Change-Id: I17b4dd6c368ba8b10b765f12a4663c041c9be7e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-10 07:13:49 +00:00
Nikolai Kosjar
4ce9ec5d63 CppTools: De-duplicate code for CppProjectUpdater
Centralize gathering the kit, toolchains and qt version.

Change-Id: I6bd586ac7925e2ee556fd119f1dab096cd500e41
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-10 07:13:38 +00:00
Bernhard Beschow
5916be8756 Remove unneeded invocations of CppProjectUpdater::cancel()
The cancel methods were called just before setting up the parameters
for the CppProjectUpdater::update() call, which calls cancel() as its
very first action.

Change-Id: I748cb4daa86bc8245cd906b2dff3c7b2d50795b2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-06 21:49:53 +00:00