Commit Graph

240 Commits

Author SHA1 Message Date
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
Tobias Hunger
727523ffc9 SessionManager: Improve handling of unconfigured projects in sessions
Force Project Mode if the startup project is in need to be configured after
a session is loaded.

Task-number: QTCREATORBUG-15228
Change-Id: I625a9485c5233ff717be20fd2c14c85a3b9275e3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-11-13 09:16:29 +00:00
Daniel Teske
8395157426 Project: Add a option to synchronize kits and build/deploy across projects
This is far from perfect but seems to work. Further work could add more
fine grained control over which projects are affected by the automatic
synchronize. Also there might be a few cases where the switching is
over zealous or missing.

Change-Id: I26ad3d59431251564917e4b408c66695dc454823
Task-number: QTCREATORBUG-5823
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-15 10:45:53 +00:00
Daniel Teske
b82311024d Open Project: Don't show a error dialog for duplicated projects
Instead, switch to edit mode, show sidebar, scroll to project,
and show a tooltip next to the project.

The tooltip is somewhat easy to miss, but this is a clear improvement
in most cases.

Change-Id: Icd27f76e7d434f33e731b6fd56473ff913986a89
Task-number: QTCREATORBUG-8422
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-08-24 11:29:09 +00:00
Daniel Teske
bce3335365 SessionManager: Be smarter about loading/unloading projects
On switching sessions don't unload projects that are in both
sessions.

Change-Id: Iceceea262677ab523f8c3c9d2dda64faa34d6e0d
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-08-24 11:02:09 +00:00
Daniel Teske
8247a0b4d7 SessionManager::projects() return a copy instead of a const&
Fixes a crash on session restore for Eike. Iterating over
a const & of the list is dangerous while projects are
added to the list.

Change-Id: I1861b7f1875420769c2493fb0b4012728380efd2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-04-23 09:19:12 +00:00
Daniel Teske
804a573105 Fix renaming of seesions not deleting the old session name
This was caused by the PersistentSettingsWriter writing the old
session on being deleted. Which was after we removed the file.

So delete the PersistentSettingsReader earlier.

Change-Id: I7e73775cc1c2e31b2f2a567b1d08efefdb3ee949
Task-number: QTCREATORBUG-14285
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-16 13:50:11 +00:00
Kai Koehne
46fc33d914 Don't mix iterator and const_iterator
This avoids unnecessary detaches of the Qt container data.
The mismatches where detected by defining QT_STRICT_ITERATORS;
however, this define violates the ODR (causing linker errors),
and therefore is not added permanently.

Change-Id: Idd336a9c8b394214a820437ef1b92d2101f6101c
GPush-Base: 62b0848b9c
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-04-02 09:40:24 +00:00
Tobias Hunger
fb6d7ce91b Remove some duplicate includes
Change-Id: If7bae084cd34c6fb0fe77f9227d9848517c0e691
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-20 14:45:04 +00:00
Eike Ziller
58ffa2cf5f Never save Welcome as the mode to restore for sessions
With the recent fix for restoring the mode when restoring sessions
(0d10ecd668), it would save and later
restore Welcome mode when switching sessions on Welcome mode.

Change-Id: I285dc1f25734b8358ca04cfdb887aafa93576c3d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-03-13 14:06:23 +00:00
Eike Ziller
0d10ecd668 Session: Fix that active mode was not restored
Change-Id: I3a94f1c18eb187716bfa275cfe8869c4fe046500
Task-number: QTCREATORBUG-1746
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-03-12 10:00:11 +00:00
Friedemann Kleint
54da18eaaa Clean exported headers of the Core plugin.
Change-Id: I26472d568844d5fee62323e01f5c5c12082d5450
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 07:18:14 +00:00
Orgad Shaneh
7a9a1b04b1 ProjectExplorer: Use FileName in NodesVisitor
Change-Id: Ia02b4dc64b343664b5d47fe3743fbdd0782da121
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-03-02 11:43:14 +00:00
Orgad Shaneh
831701bb67 Avoid storing references to rvalue FileName strings
Following 73616849, it is dangerous to store a reference to the rvalue of
toString(), since it might become dangling.

Example:

FileName foo() { return FileName::fromString(QLatin1String("/some/file")); }

void func()
{
    const QString &fileName = foo().toString();
    // fileName is now a dangling reference
}

Change-Id: I5dfad5dc8dd568a0a3c8f9f71ad93292dc26cbbe
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-02 07:27:10 +00:00
Daniel Teske
2ffd0e2d0d ProjectExplorer Nodes: Replace dynamic_cast with as* functions
The OS X linker makes using dynamic_casts across shared object
boundaries fail, so do all casting in the projectexplorer library
and provide functions to do it.

Task-number: QTCREATORBUG-13864
Change-Id: I0e13c0986f8342d83c3b838ffdd2dd7b8312b13c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-25 14:57:18 +00:00
hjk
45b58ac2e8 Use Qt5 connects in ProjectExplorer and Session
This is a first, self-contained step only: Replac the connects
themselves, rename private slots that coincide with
signal names, apply minimal compile fixes and formatting.

Change-Id: I0a28d2ebcf4d4f6fdf68a06f582ed962ed54724d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-02-23 18:07:43 +00:00
Orgad Shaneh
88e7f935f4 ProjectExplorer: Use FileName for Node::path
Change-Id: I4a41cfb629be8bb06b4b0616cd4475525e617a51
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-13 13:14:03 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00