Commit Graph

257 Commits

Author SHA1 Message Date
Eike Ziller
7f626b1182 Merge remote-tracking branch 'origin/4.5'
Change-Id: Iceaa4ca40b5318744bde8a76c6d3ccca08df71bb
2017-10-25 16:07:21 +02:00
Tobias Hunger
a646196011 Session: Fix (un)loading of projects on session change
Task-number: QTCREATORBUG-19078
Change-Id: I4f527cb3af9b9270a65da1e283e8a1f3db737531
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-24 11:14:13 +00:00
Eike Ziller
1c1dd45bfe Merge remote-tracking branch 'origin/4.5'
Change-Id: Iebd340258966aff910fb9ab0e45b5149e8f242f0
2017-10-12 09:49:14 +02:00
Eike Ziller
1932912e7c Add icons to file system view directory selector
Change-Id: I0b6451d7f68fae93e0b140aaea030c88ec1a8801
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-10-11 07:06:41 +00:00
Eike Ziller
07bec99e8f Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: Iaad0659293681cce4266fc3e4ba2a4f2068de911
2017-10-09 12:09:27 +02:00
Tobias Hunger
4d32f3b7ce Session: Delay deletion of projects till all signals are processed
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>
2017-10-06 10:52:54 +00:00
Tobias Hunger
033b641373 Session: Make sure startupProject is set whenever a project is open
Never let the startupProject become nullptr while projects are still loaded.

Change-Id: Ie442c3a9b6cc4a65564002edc45b60a7993d2a52
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-05 08:15:03 +00:00
Ulf Hermann
0693db3579 SessionManager: set startup project on addProject
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>
2017-10-04 10:49:29 +00:00
Tobias Hunger
f8ded0df26 SessionManager: Modernize code a bit
Change-Id: I9e44990c62ccca8e06919576bb9be463bb84cf19
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-04 09:50:00 +00:00
Tobias Hunger
db5a00231f Session: Fix removal of projects
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>
2017-10-04 09:49:52 +00:00
Eike Ziller
e3a692a1a4 File System view: Fix that projects could be duplicated
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>
2017-09-27 12:37:53 +00:00
Eike Ziller
f5f4ebff73 Update project names in file system navigation pane
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>
2017-09-26 11:03:41 +00:00
Eike Ziller
f292a5e45b Add projects directory to folder navigation widget
Change-Id: Ia925fa99ba0f11be860f214e7809731ddf990268
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-26 11:03:31 +00:00
Eike Ziller
08aa833825 Sort root directories in file system view
Change-Id: I8ce68ffa4752c89de735583640103bc22c2a8bc7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-26 11:03:16 +00:00
Eike Ziller
3c988e5a0d Change File System pane to a forest of trees
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>
2017-09-18 09:15:23 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
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>
2017-09-08 09:06:53 +00:00
Orgad Shaneh
1f443bde52 Replace QFileInfo(fileName.toString()) with fileName.toFileInfo()
Change-Id: Iac7f866b4846939af4dcee086ab07797cc6b8ff1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-08-24 08:54:16 +00:00
Orgad Shaneh
f6c6224ebc Autotest: Avoid needless iterations over the project files
Task-number: QTCREATORBUG-18185
Change-Id: I6c541cfa577331edc1ff3083d2f9b705ffc7ce73
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-11 06:04:15 +00:00
Tobias Hunger
28c8da4f90 Session: Emit signal when project's displaynames change
Task-number: QTCREATORBUG-17957
Change-Id: I3fcbe2171e359f71434c6162d012e64f70efce99
Reviewed-by: hjk <hjk@qt.io>
2017-04-07 14:31:26 +00:00
hjk
ebae6426f8 ProjectManager: Remove SessionNode
Instead, get root project nodes directly from the project.

Change-Id: I5cf95a7dce1fa29c1adc26013ad03cc017f38a6d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-21 12:48:41 +00:00
Tobias Hunger
2ff0d30829 ProjectExplorer: Move code to set up default project structure
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>
2017-03-17 16:33:12 +00:00
Tobias Hunger
9434fa4888 ProjectTree: Decouple ProjectTree from Projects
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>
2017-03-16 15:07:37 +00:00
hjk
70578004cb ProjectExplorer: Some code cosmetics
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>
2017-03-13 13:01:28 +00:00
Tobias Hunger
d78e0edb5d ProjectNodes: Remove no longer necessary signaling
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>
2017-03-10 16:22:36 +00:00
Tobias Hunger
49fef0ae24 ProjectExplorer: Create initial project tree
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>
2017-03-10 16:22:31 +00:00
Tobias Hunger
71a5aee36f Session: Update SessionNode when Project tree changes
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>
2017-03-10 16:22:21 +00:00
Tobias Hunger
707990632c Session: Store project and root Project Node
Change-Id: Ie8bdd81e408fa97875b233b3a19811dde5fadff0
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 15:38:45 +00:00
hjk
d6df4492d0 ProjectExplorer: Use visitor-by-lambda for project tree
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>
2017-03-08 09:05:29 +00:00
Tim Jenssen
f2b8e9acd1 SessionManager: Clean up methods around projects
Clean up methods around projects() and update its usages to modern
language standards.

Change-Id: Ia0a4574d014ce41e0d511a392e4eed4680981d0e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-02 09:31:23 +00:00
Montel Laurent
44802d754e Delete QMessageBox after usage
Change-Id: Icba5fddb5596f263f2cbb19f91b6ce95ca7785c6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-02-23 07:25:27 +00:00
hjk
04a525877b ProjectExplorer: Merge FolderNode's m_{file,folder}Node fields
One step closer to direct use of Utils::TreeNode.

Change-Id: Icd0dfd2fa4d12c2572a68f61ae43c5e906956a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-09 12:15:23 +00:00
hjk
5c5d93943f ProjectExplorer: Let SessionNode operate on single ProjectNodes only
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>
2017-01-26 10:06:43 +00:00
hjk
3c743346b0 ProjectExplorer: Make the FlatModel a Utils::TreeModel
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>
2017-01-25 13:52:51 +00:00
Hugo Holgersson
2ab5561b9a EditorManager: Show file's relative path in window title
Task-number: QTCREATORBUG-17234
Change-Id: I35e04014f9ca5b72e1c5290977b477514872bc7f
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-16 08:24:27 +00:00
Tobias Hunger
879aa21063 SessionManager: Make session node a unique_ptr
Change-Id: Ic11679c409305a5f117316114e9ffa3d82475ceb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-21 14:24:55 +00:00
Tobias Hunger
63cf5b8ad6 ProjectExplorer: Use more const
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>
2016-12-21 14:22:26 +00:00
Tobias Hunger
c9ee7ee378 ProjectExplorer: Shorten NodeType enum
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>
2016-11-03 15:55:13 +00:00
Orgad Shaneh
738eaf85d1 SessionManager: Improve encapsulation on save
Change-Id: I3fa5edf226c8369f9f12ccf95bf2914b50f9d48b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-10-12 16:30:56 +00:00
Tim Jenssen
29f6f4f253 Sessions: introduce a sessionDateTime
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>
2016-09-26 11:36:23 +00:00
hjk
a3adfc75b9 ProjectExplorer: Remove a use of sender()
Change-Id: Iaee2412879f7a0a9108a8da2ee15b70ad983c845
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-04 10:23:50 +00:00
Tobias Hunger
c64fa0d329 SessionManager: Simplify code
Change-Id: I97755d07f5d37452e01f6e687f1790dee33bb48e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-14 09:19:12 +00:00
Tobias Hunger
4d617c8102 Session: Remove addProjects(...) method
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>
2016-06-14 09:06:57 +00:00
Tobias Hunger
2f11372dce ProjectExplorer: Modernize some more
Change-Id: I54bcda3dcf5f561f3936450c0621f6a06ac0b36a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-15 13:57:19 +00:00
Tobias Hunger
95ac4edfd4 Projectexplorer: Modernize codebase
Change-Id: I4793b58aa77bcd46af99f8b843c0f7439cdc9269
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
2016-04-15 09:40:53 +00:00
hjk
5e47d35fcd Use Core::Id in ModeManager interface
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>
2016-04-08 10:38:49 +00:00
Tobias Hunger
5a04c8b06a Session: Modernize code a bit
Change-Id: I6459da31592a391533f7eb062e1b9f1bb9dabc78
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-29 10:50:25 +00:00
Eike Ziller
74cdce071f Merge remote-tracking branch 'origin/3.6'
Conflicts:
	src/shared/qbs
	tests/manual/proparser/main.cpp

Change-Id: I13654bf10c14eb6b1d6805fe86b67ac73b2e4d75
2016-02-24 10:08:37 +01:00
Tobias Hunger
998c2a7380 SessionManager: Fix possible crashes in session manager
Change-Id: Icd97c765fb4d5b88ff2986b927433e2583817605
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-17 12:17:42 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
b386dd0e99 Project: Add setDocument method
Add setDocument method, implement document method, use this in all
projects.

Change-Id: I5018bf7c2739665c13eee340184ce7c41fd319bb
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-01-11 12:18:11 +00:00