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>
Saves some code on the user side.
Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@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>
... involving projects that aren't currently in the session, for the
purpose of re-establishing the dependency when they get re-added.
In addition to the rather special use case described in the linked task,
this also prevents losing dependency information involving projects that
temporarily fail to load.
Fixes: QTCREATORBUG-22524
Change-Id: I2558736a634e91cccc3f071a3c522b33a88003c0
Reviewed-by: hjk <hjk@qt.io>
Opening Qt Creator, closing it again, and then opening Qt Creator with
"-lastsession" opened some session - the last session that was opened in
Qt Creator at some earlier time.
The intention of "-lastsession" was more to re-open Qt Creator in the
state it was last closed from, so in this case it makes more sense to
not open a session at all.
Change-Id: Ia33ac5b79d93c7c97865186c56db2ef0b33b9f7c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The "implicit" default session, that is. See the verbose comment inside
this patch for details.
Fixes: QTCREATORBUG-19388
Change-Id: I270ca25ce3d4c32db51c53de2af055bdfe8c54af
Reviewed-by: Eike Ziller <eike.ziller@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>
It was not possible to return false from
ProjectExplorerPlugin::initialize() without triggering crashes.
Change-Id: I96b2f80c835e69769f64f9b9c61f473e9ff88623
Reviewed-by: hjk <hjk@qt.io>
... when switching to a project that is unconfigured.
Task-number: QTCREATORBUG-22682
Change-Id: I91c6f791677054d2f86a5a5d81003f38ecc812fb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
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>
Helps to adapt to potential upstream changes in Qt 6
Change-Id: Ie154bd4fd513d46cb0493758be8943fc4581d71c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Checking some basic invariants, plus a small stress test
Task-number: QTCREATORBUG-20975
Change-Id: I975d0b96ade8a81c1358387927e4fe5a98d25892
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If the second call really serves a purpose, we will find out eventually
and can add it back in with a proper comment.
Change-Id: Id4db1e59d771578f0eceebb6829ecf12e7da4d49
Reviewed-by: hjk <hjk@qt.io>
Use unique_ptr for all *Private classes, except for those
in singletons.
Change-Id: Ib56c31ddedc6e9cf321f15de1f1e697a27ad4089
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
It did nothing if false was passed. So do not call it in that
case and drop the parameter.
Change-Id: I9b055cb0c0c8be85d528247a269fb7fea062326b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The destruction of a project can still trigger file list changes, so
just check if the project is actually still registered before updating
anything.
Task-number: QTCREATORBUG-20314
Change-Id: I0d634ca8986d1f09e84c310ae732c0bcdc675534
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Do QTC_CHECK to warn if a new project is not fully set up.
Change-Id: Iafeac9ed5bd62bd57754015aed832848e50b037a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Do no longer expose Nodes from the SessionManager's API. These are now
exclusively handled by the ProjectTree.
Change-Id: I585c2ac919462073870363436e767640775d9045
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Make the project responsible to provide information on which files
belong to it instead.
Change-Id: I80accf9104af33eaffc6b8f3e6024e9725697d37
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Delay actual deletion of projects till all signals related to the
removal event (incl. the startupProjectChanged signal) are handled.
Change-Id: I8e2c8db49f732b80234a3cfa81d73f17c8d02608
Reviewed-by: hjk <hjk@qt.io>
Never let the startupProject become nullptr while projects are still loaded.
Change-Id: Ie442c3a9b6cc4a65564002edc45b60a7993d2a52
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
If there is no startup project when we add a new project the new project
should become the startup project, as a situation where there are
projects, but no startup project is invalid. removeProject also checks
for the startupProject and adjusts it if necessary.
Change-Id: I5f12add832db82af553fc1e393e32185eb322866
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
When removing a project setStartupProject(nullptr) may fail, since
it will reject any attempt to set the startupProject to nullptr while
any project is still available.
So delay this till nullptr is an option:-)
Change-Id: I6f41a17d922cf6333b7b7e17f8300e831e4807d9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
It is not possible to use the display name as an ID, because that can
change (and to propagate that change we use the ID).
Remove the display name from the ID, use a separate sort property, and
sort by this property + display name.
Task-number: QTCREATORBUG-18972
Change-Id: I27017473842931defa3a123ce9f41cc8e8ba1a61
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
When the project reports a change in the display name we need to update
the drop down in the file system navigation pane as well.
Task-number: QTCREATORBUG-18972
Change-Id: Icfc0e6b2185f147bfc36589d8aea13a0966e8793
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
It shows the file system as a tree, where the user can change the root
directory of the view. Currently there are "Computer" (the default), and
all project directories.
If synchronization with the current editor is enabled, the view
automatically switches to the best fitting root directory.
Task-number: QTCREATORBUG-8305
Change-Id: Ic265eb49b1e8e0fd8cdeeb4fb1c64b8631f32e21
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Also, add context to connect() expressions where we are or were
capturing "this".
Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>