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>
... and make it accessible through a variable.
Fixes: QTCREATORBUG-26147
Change-Id: I0601c09a74360b91fe8421876207a8f4ae9d75b6
Reviewed-by: hjk <hjk@qt.io>
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>
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>
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>
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>
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>
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>
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>
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.
Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
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>
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>
... 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>
... 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>
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>
... 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>
... 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>
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>
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>
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>
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>
... 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>
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>
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>
... from the environment.
Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>