Commit Graph

217 Commits

Author SHA1 Message Date
hjk
b0e125ac11 ProjectExplorer: Move Node::nodeType implementation
... to the only remaining user, and rename it there.

Change-Id: I0bdb3179282e323f5ad7b41d034bb5f3db8f6ffc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-04 09:25:50 +00:00
hjk
729c74379a ProjectExplorer: Merge Node::isFileNodeType and asFileNode
They were identifying the same set of nodes.

Change-Id: I3316cbc434ff740547bcf0baf9e5f1544f6e3f56
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:44:22 +00:00
hjk
ad4e2562fa ProjectExplorer: Replace Node::setNodeType by virtual functions
Not the usual direction of change, but currently there are
several systems to identify or invoke node functionality.

Virtual functions are likely to stay in this context, so this
here attempts to help consolidation by reducing the influence
of the node type flags, hopefully leading to full removal
by making remaining functionality available through the
other mechanisms (virtual functions, asFooNode() 'casts',
less so the FileType flag).

Change-Id: I12a17ce30b3c8883995b29b4720408020ee0fa3e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-01 08:32:14 +00:00
Christian Kandeler
4079dd5cbc ProjectExplorer: Support Drag and Drop in the project tree
E.g. moving a file from one pri file to another is much simpler for the
user now.

[ChangeLog] Source files can now be drag-and-dropped between project
nodes in the project tree.

Fixes: QTCREATORBUG-6446
Change-Id: I8bd4a7588fc5f2830f6585dfcb54ab4a547bc6b0
Reviewed-by: hjk <hjk@qt.io>
2019-02-15 16:02:40 +00:00
Christian Kandeler
29e20e369b ProjectExplorer: Allow users to quickly expand the project tree
... by adding an "Expand All" action to accompany the existing "Collapse
All" one.

Fixes: QTCREATORBUG-17243
Change-Id: I84e185562ee4c62ede7d0dc40f0d296020c4f0ea
Reviewed-by: hjk <hjk@qt.io>
2019-01-16 13:10:02 +00:00
Eike Ziller
8e05783019 Merge remote-tracking branch 'origin/4.7'
Change-Id: I4332eba9f1f66fef185359c79c4d96420d8b78ca
2018-08-30 08:31:25 +02:00
Eike Ziller
7b6ea357f6 Avoid shortcuts with "Alt" on macOS
On macOS shortcuts with "Alt" are used for entering special
characters, where "special" depends on keyboard layout and can
mean e.g. '|' or '~'.

Task-number: QTCREATORBUG-20873
Change-Id: Ifa70b95381ef48d2ba3b15a528a5dcfe43d53bfd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:52:44 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
Eike Ziller
29dd67f45e Don't select file extension when renaming resource files
Resource files would not get the handling like files do, because they
are folder nodes.
For folders, if they provide the rename functionality at all, the file
extension can have similar influence on the type of folder like it does
for files (e.g. ".app", ".framework"), so just remove that restriction.

Task-number: QTCREATORBUG-20057
Change-Id: I3802f17695da9d323d4d60c14ecef5c39aeef576
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-06-13 10:39:20 +00:00
Tobias Hunger
f7a0a3cd26 ProjectTree: Do not use disabled state for disabled nodes
Rendering disabled nodes using the disabled state in the painter
breaks themes as it introduces a discrepancy between the actual
state of the node and its graphical representation.

IIRC this was introduced since there was no easy way to find what
color was supposed to be used for disabled items. That is no longer
the case, so let's clean this up.

Change-Id: Ic5653cd970e07eb680cb1d28d1feefd70aded540
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-09 14:58:42 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
Alexander Akulich
48a68851fc ProjectTree: Select only (complete) file basename on rename
Change-Id: I29effc5f61fbaa214d7a1a01d92de5d5a726cec4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-09 11:52:05 +00:00
Alexander Akulich
783b310ee6 ProjectTree: Refactor editCurrentItem()
Change-Id: Id848b608e256b95e9704d61d1926d05625106ecc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-09 11:51:58 +00:00
Eike Ziller
124e4499eb Merge remote-tracking branch 'origin/4.6'
Change-Id: I421af2d62994436782dab6d37e97622bd055ed44
2018-03-05 09:28:34 +01:00
Alessandro Portale
807c7c6380 utils: Let the link icon have a LINK and a LINK_TOOLBAR version
Change-Id: I910d491f7f5ac47c55c966f687b004c0e0793c5f
Change-Id: I910d491f7f5ac47c55c966f687b004c0e0793c5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-02 10:32:47 +00:00
Tobias Hunger
31f1713c75 ProjectTree: Do not register action more than once
Change-Id: I9d9c86694cd8066ba4be2a065805a3b52bc272ff
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-07 13:42:50 +00:00
David Schulz
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +00:00
Tobias Hunger
c7e4eee345 ProjectTree: Add command to manually sync current document and project tree
Add a command to manually sync the current document and the project tree.

Task-number: QTCREATORBUG-19625
Change-Id: I2423853ca1a876c6203a004b465adde949eb6c5b
Reviewed-by: hjk <hjk@qt.io>
2018-01-26 14:35:10 +00:00
Eike Ziller
d8fd5292f1 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/tools/clangbackend/ipcsource/clangiasyncjob.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.h

Change-Id: Ib8602530663813ade418f995dfd2a736908cfe75
2017-08-15 10:07:51 +02:00
Tobias Hunger
ea867cd49a ProjectExplorer: Add option to hide empty directories from project tree
Together with the earlier fix for hiding generated files, this change makes
for a very clean CMake server-mode project tree:-)

Change-Id: Ib70fd66699eddf5d6e602f3f8848b31fd6d85b57
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 13:34:13 +00:00
Tobias Hunger
45046f7071 ProjectNodes: Do not derive Project Nodes from QObject
That should save some memory per node, and since creator has a lot of nodes
(e.g. opening the LLVM project adds about 1 000 000 nodes) this should be
noticeable:-)

Calling update inside ProjectTree::currentNode() and rename it to
findCurrentNode() to make sure it is an still existing pointer.
Also, try to reduce the somehow more expensive currentNode() calls
and sprinkle some const around that usage.

Change-Id: I6a7c5db01a71d53d39544d3013cad557d5b96cdc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-01 11:24:53 +00:00
Tobias Hunger
f5beeb4c7e ProjectTree: Show parsing state of projects
Show which projects are currently parsing in the project tree.

Change-Id: Ie69907a73ec7c3cf2ef40c37db620a0144178f95
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-28 08:33:50 +00:00
Orgad Shaneh
eebac87be5 ProjectTree: Enable Synchronize with Editor by default
Changed by 4943510b60.

Change-Id: I359c4abd77009b22bc1a7143002563f66a3b5fd0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-07-17 14:28:30 +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
Serhii Moroz
69da534f99 TextEditor: add right sidebar
Task-number: QTCREATORBUG-9436
Change-Id: Ic0406758a30d52c22c58433f5f35305b798cb462
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-09 08:19:54 +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
hjk
aabdc242d5 ProjectTree: Use signals to communicate change from FlatModel to view
Better encapsulation and potentially more than one view on the model.

Change-Id: I45657484a68eba61b3987d324cf1542704ffd61c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-02 07:45:48 +00:00
Tim Jenssen
42061e8cdc ProjectExplorer: fix possible crashes
Change-Id: I0b06e31f07ddf9c052f360bb66ac2330cc21d7b6
Reviewed-by: hjk <hjk@qt.io>
2017-02-10 16:26:25 +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
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
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +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
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
Orgad Shaneh
15f8bb07ed ProjectExplorer: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I619db09a79760186b72e7662490ed1205155c1a7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-01 15:51:34 +00:00
Orgad Shaneh
3e4e462638 ProjectExplorer: WS fixes
Change-Id: I49c961159ad1d3ece0e55f453377daa879ef7703
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-02-01 07:57:04 +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
Alessandro Portale
033862f305 Themed Icons: Introduce Utils::Icon
Instead of describing icons via file name or in the themed icons case
via
a string that is a list of mask/color pairs, we have now a class for it.

Icons are now listed in per-plugin *icons.h headers.

RunControl::m_icon was The only place left where an icon property was in
fact a string. This patch changes that member to be a Utils::Icon.

Change-Id: Ibcfa8bb25e6d2e330c567ee7ccc0b97ead603177
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-25 12:30:52 +00:00
Tobias Hunger
5d7f5a2a32 ProjectNode: Rename path() to filePath()
Change-Id: I78bb73f8c9457fd74c470eacbf54eb9195ac9681
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-03 11:01:50 +00:00
Eike Ziller
310ae09996 Merge remote-tracking branch 'origin/3.6'
Change-Id: I68512c775ed25b51c8b0abe1818c9c7c5955874c
2015-10-30 16:08:03 +01:00
Orgad Shaneh
0d849b9f29 ProjectExplorer: Add a soft assertion
Task-number: QTCREATORBUG-15246
Change-Id: Ide3d94f6a72579626feb0f031c5381518db45326
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-29 10:08:39 +00:00
Alessandro Portale
b8bdc6f669 Icon refresh: First step towards the new Qt Creator themes
http://blog.qt.io/blog/author/didesous/ announced new designs/themes
for Qt Creator. This patch replaces many of the existing toolbar icons
with recolorizable masks for better theming support.

Change-Id: I557aa485205fe2624f33724226f698c303342b40
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-10-23 16:04:52 +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
Christian Kandeler
2f781ac280 ProjectExplorer: Add missing override modifiers.
Change-Id: I8f71a0992baead514a9c0962d5a574e75a5cb733
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-08-20 10:51:13 +00:00
Daniel Teske
0a23dd4e23 ProjectTree: Improve resizing of project tree
On each resize event the treeview iterated over all rows to get the
maximum width of them. That involves text layout and is very slow
with bigger trees.

So cache the size hint for the column and connect to all signals
that can potentially change the size hint.

Change-Id: I83a13982848df56515fed8225ced336096370546
Task-number: QTCREATORBUG-8075
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-08-10 13:42:38 +00:00
Daniel Teske
62d36ac9a9 ProjectTree: Improve save/load of expand data
So far the code only saved the path of the expanded nodes, which always
created problems for nodes that had the same path. This broke for the
virtual folders SOURCES, FORMS, HEADERS recently because they have
nowadys the same path. They used to have different paths.

This new code saves both the path and the displayname and compares that,
this fixes the expanding for those folders.

Obviously there is no sure way to indetify the right nodes to expand,
and this isn't backwards compatible.

Change-Id: I9854f90ca942f92420970765b0cc19138ad5d63d
Task-number: QTCREATORBUG-14304
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-04-27 13:43:32 +00:00
Daniel Teske
facc89fafd Optimize ProjectTree for adding folders/files
Instead of searching the whole tree for the current node,
only check the newly added files/folders.

Change-Id: I015a955815223767367c4cad476d0620f69abd71
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-09 15:47:00 +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
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
Orgad Shaneh
23b4dc128f ProjectExplorer: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I1d05d48b23f44e3d589cc2a790803714786b57d2
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-06 12:06:22 +00:00