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>
Instead, get root project nodes directly from the project.
Change-Id: I5cf95a7dce1fa29c1adc26013ad03cc017f38a6d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Move the code used to set up the default project structure from the
Project into the sessionmanager. Now that the models are no longer
connected to the project this is the safer way as less change to the
projects logic is required.
Change-Id: Ib6b897f990a24d2dcce96a9821f090551fe45f13
Reviewed-by: hjk <hjk@qt.io>
Make sure the ProjectTree gets its data exclusively from the Session
and the SessionNode it holds.
Change-Id: Ic44e1364adf36077018edc972e18815d7f972922
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Silence a warning about using a pair by value instead by reference.
Also, remove an unnecessary duplicated check.
Change-Id: Idd5a01cdfcb16dad03389d2f360e0b2dbff21dc8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The project tree is updated in one go now, so there is no need to
signal each and every change.
Change-Id: I7d5829d688b406ee2e701a2aa004b9e8bb5870a9
Reviewed-by: hjk <hjk@qt.io>
Create an initial project tree with a ProjectNode and a FileNode for
the project file itself.
Fix the Projects to not implement their own tree before they have
better data.
Change-Id: I147ccd5603d22d1d60880a97f30fd8c271eac88c
Reviewed-by: hjk <hjk@qt.io>
This moves ownership of the project's root node from the
project into the project tree!
Change-Id: I84eba884bd63b44e56c75023d8bf12caf5cc2833
Reviewed-by: hjk <hjk@qt.io>
And inline it into user code. Less code in total and no intermediate
node lists.
Change-Id: I3724883408bfaa868266110aee27bbffd4d96bd8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Clean up methods around projects() and update its usages to modern
language standards.
Change-Id: Ia0a4574d014ce41e0d511a392e4eed4680981d0e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
One step closer to direct use of Utils::TreeNode.
Change-Id: Icd0dfd2fa4d12c2572a68f61ae43c5e906956a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Simplifies the implementation and is the only way used.
Change-Id: Ie3ac1cb66ae7fb85e3d6358a01975ba2e857ab6c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The FlatModel is essentially a proxy model keeping expansion and
filter state per ProjectTree(View). Using a Utils::TreeModel makes
it fast enough to allow recreation of the proxy structure on
structural changes simplifying the parent/child logic significantly.
The {Session,Project,Folder,File}Node hierarchy still is still primary
information and shared by all views.
Change-Id: Ic08180a19bda37908280ff30e0737d188ed93e92
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Clean up action update and use more const variables. Spread some
const over other code, so that const variables can actually be used.
Change-Id: Ia814900ddff294aeafedb2a223d3705990f9b7c1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Use a class enum with a type quint16 for the NodeType. Frees 2 bytes
per node that can be used for better things now.
Change-Id: Ib84bf8629e9f4a5fb0793355eff0f0d6302167dd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This can show the last modified time of a session and
will be used in a next commit to make it more clear
when session was saved.
Change-Id: I9f73f62652efc9287563f833f25c49f79c39d936
Task-number: QTCREATORBUG-15790
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
It is unused. Also remove singleProjectAdded signal, and replace
the only use with the projectAdded signal.
The singleProjectAdded signal was emitted for each project that was
ever added, simply because nobody ever used addProjects(...) with
more than one project.
Change-Id: I5aee315c64a2cfb721471d580989a6a02d44fefc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Makes it more uniform to use and allows placeholder widget
creation to be independent of mode creations.
Change-Id: I4021bc9db7f8c78f0374c0cc3b3331506959afe4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Add setDocument method, implement document method, use this in all
projects.
Change-Id: I5018bf7c2739665c13eee340184ce7c41fd319bb
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>