Commit Graph

128 Commits

Author SHA1 Message Date
hjk
cbfedd4328 ProjectExplorer: Fix display of .qrc contents
Change-Id: I2779e12daa8a7972380f51b72a56de3466d453a5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 13:43:31 +00:00
hjk
30bf801629 ProjectExplorer: Further tree node related simplification
Drop the list sorting and difference generation which is not
needed in the "build from scratch" setup.

This also removes some of the intermediately introduced
convienience functions and fixes a regression that led to
missing project files.

Change-Id: I39d1966324917f466fb347da3a52552393ca4a01
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-01-30 07:56:05 +00:00
hjk
87304b3ce0 ProjectExplorer: Introduce some FolderNode convenience functions
... and use them.

Change-Id: I9f5237e5eac30715c2effbd3301dd2a70516d2a9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-27 08:40:20 +00:00
hjk
beaba559a5 ProjectExplorer: Slim down user side ProjectNode handling
Change-Id: If727ff6cd09cc127e031c49c47f61ffda631a80e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-26 15:24:57 +00:00
hjk
e20549d295 ProjectManager: Add function to set a list of files in folder nodes
... instead of having to remove/add. Use it in some places
in QmakeProjectManager and the ResourceEditor where the
(sub)tree is rebuild anyway.

Change-Id: I46b3c078c576b72dba6e87432570d030b7572026
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-26 10:32:22 +00:00
hjk
4012611aab ProjectExplorer: Simplify FolderNode::buildTree
Change-Id: Id2425310ee4192758a2b21b22fe49ffe9b30d276
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-26 10:32:12 +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
Tobias Hunger
1b2fc1c815 CMake: Pass const QList<const FileNode *> to Directory Readers
This makes sure they need to copy whatever they need.

Change-Id: I767ac0c5f54ca1f9f46acdefe4bd7fea35657312
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-21 14:19:36 +00:00
Tobias Hunger
d44bc75f72 ProjectNodes: WS only change
Change-Id: I2b62fefcba4c8a64472b3e88904134903aec47c4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-07 12:36:32 +00:00
Filippo Cucchetto
1e70a156f9 ProjectExplorer: Fixed missing check for futureinterface nullness
Change-Id: I56808b84964218038ac9709583f07c212391f601
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-05 09:30:38 +00:00
Tobias Hunger
49f5d98871 ProjectExplorer: Make priorities available on more nodes
Make priority available on all FolderNodes. Make the sort order
of all kinds of FolderNodes check the priority.

This allows no reorder e.g. ProjectNodes as needed.

Change-Id: I369edd28807ab9f89fb646b0001e1b3eb1a19d7e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 09:03:10 +00:00
Tobias Hunger
3af1372395 ProjectExplorer: No more pointer to the parent project node
That information is used rarely, and is not too expensive to regenerate,
so there is no need to store and manage it for every node.

Change-Id: I2261853431cd4328ec447031de3b9f5d5347e796
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 09:03:04 +00:00
Tobias Hunger
43258f91e8 ProjectExplorer: Nodes: Rename member holding parentFolderNode pointer
Change-Id: I8c2abc5a3b258f1ec0b9d2b9582e0f4b41e11568
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-11 14:27:46 +00:00
Tobias Hunger
8850d2e732 ProjectExplorer: Allow for const-correct use of Nodes
Change-Id: Ic1f145e3b429d80c0dcff642b900cb3a3f78f06b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-11 14:27:41 +00:00
Tobias Hunger
327f09c240 ProjectExplorer: Override filePath for recursiveFindOrCreateFolder
Override the base node's filePath for recursiveFindOrCreateFolder (and
buildTree, which is based on that). This makes it possible to use this
method to build up trees below project nodes, etc. that have no
representation as a existing directory in the filesystem.

Change-Id: I29fd1ab5b81b144b3db1966dc08dd50470c2d5d7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-11 14:27:36 +00:00
Tobias Hunger
d59489c462 ProjectExplorer: Make it easier to trim down the project tree
Change-Id: I6dc712f131a27eceb5548c0e3a79418d9b950639
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-11 14:27:16 +00:00
Tobias Hunger
04aa6f67dd ProjectExplorer: Make scanForFiles cancel-able
Change-Id: Icbc4fa4c84189bd470bd5720a674d11f3e485037
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-11 13:22:46 +00:00
Tobias Hunger
39e2c013dd ProjectExplorer: Handle root directory when creating folders
Handle root directory properly (a empty filePath in the base node) when
creating folder nodes in the project tree.

Change-Id: Iad761b94ee210406ed5ab9ceb2d00ce25db90046
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:59:14 +00:00
Tobias Hunger
f9e9357756 ProjectExplorer: Add method to find ProjectNodes
Change-Id: Ib8056bd7d5603ced67c3ce3514d49ec51d05e2cf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:22 +00:00
Tobias Hunger
ad003363b7 ProjectExplorer: Rename Node::projectNode to Node::parentProjectNode
Change-Id: I47fa794a0bd8456ae23271934a957d9667d2d7bb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:14 +00:00
Tobias Hunger
c7b0163fcb ProjectExplorer: Make FolderNodes a bit easier to work with
Add some methods to look up different kinds of nodes in the
project tree.

Change-Id: Ia91844b45c2a124dc01771297e1f5c414d84e7cb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:08 +00:00
Tobias Hunger
67e011ba5f ProjectExplorer: Make naming of methods on Nodes more consistent
Change-Id: I5050a020f0fc0ef4556db1d2020afeadfcd51585
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:02 +00:00
Tobias Hunger
6b469e81e8 ProjectExplorer: Never delete base node when building a tree
Never delete the base folder node when using buildTree to set up
a tree of files in the project tree. This makes sure the node stays
around, even when it turns empty. This matches how buildTree is used
in our code.

Change-Id: Id2a589985d9ac704316db5f210232532dcdb5d58
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-07 21:16:25 +00:00
Tobias Hunger
69b378eb73 ProjectExplorer: Expose sortByPath operator on project nodes
This is universally useful, so expose it.

Change-Id: I9cceee076397c7d690d8d34ef8ac815059e4454d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-04 10:20:56 +00:00
Tobias Hunger
7150c0778b ProjectExplorer: Allow for disabled nodes in the project tree
Change-Id: I82d8284777f5691eb3ba9cf4ef92da05057aac18
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-03 15:56:16 +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
Tobias Hunger
e86383c741 ProjectExplorer: Add a way to scan a directory for filenodes
This is useful for several project types, so do this properly in
ProjectExplorer.

Change-Id: Ic659ff6824daffaeb441e11f5072d496194d48fe
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-10-25 09:17:08 +00:00
Tobias Hunger
69627e494b Add helper code to generate trees of project nodes
Add helper code to FolderNode that enables the creation of a tree
of File- and FolderNodes from a FolderNode and a list of FileNodes.

Change-Id: Iba4b6a768fc3d0501851f141372e7e34913ba518
Reviewed-by: hjk <hjk@qt.io>
2016-10-05 15:42:47 +00:00
Orgad Shaneh
670e54345c Remove use of deprecated Qt algorithms
Change-Id: Ib35cffa2d5762874feea9b1d4df7f569c0e5f496
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-09 13:41:25 +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
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
a08cb7d52e FolderNodes: Specify filter for Add Existing Directory
Allow foldernodes to specify which files they care for when doing
"Add Existing Directory". Before we used a fixed list with C++ header
and source files, which does make no sense for e.g. adding to resources.

Task-number: QTCREATORBUG-15278
Change-Id: I15dad133391485c2bcebd2d864623304b31b5f8f
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-09 10:35:30 +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
Daniel Teske
798fa669bf ProjectExplorer: Check if the project can rename a specific file
before renaming the file.

This adds a new api:
FolderNode::canRename(oldFileName, newFileName) that asks the
project manager if a specific file renaming could be applied to
the project file.

Change-Id: I77bae56db06d81fd03e590285d6079abea2c514b
Task-number: QTCREATORBUG-14521
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-16 09:58:56 +00:00
Daniel Teske
bcdadbec72 ProjectNode: Provide default implementations of a few functions
Since a lot of derived classes can make use of those.

Change-Id: I051542e8d318476348d753de4d4c0a30b3a9ed62
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-09-15 10:46:28 +00:00
Christian Kandeler
bcc4ab301f ProjectExplorer: Fix FolderNode::addNewInformation().
We should use the actual display name of the node there, not some
hardcoded value.

Task-number: QTCREATORBUG-14240
Change-Id: Idf0fc4cdaab52d7f838d3d48d834a89b55ee593f
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-04-08 15:12:47 +00:00
Orgad Shaneh
25096de511 ProjectExplorer: Avoid copy for node path
It appears to take 7% of project loading...

Change-Id: I2d20d919cc861a6ee95af359a584fb27a915cf80
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-02-27 10:41:20 +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
Daniel Teske
a19bda48fc ProjectExplorer: Remove setNodeType
The only two cases where it is used, the type can easily be passed to
the constructor. So do that.

Change-Id: I1658a377aac56b5332992c445fba39b00620a74b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-02-17 14:02:50 +00:00
Eike Ziller
5a3a940ad3 Use new mime database
Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-17 13:00:07 +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
Orgad Shaneh
8b5dcc13c5 Replace QFileInfo::fileName() with FileName::fileName()
Change-Id: I4852ff215abf25649fc5eac1e922ae901839ca3d
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-29 11:15:43 +00:00
Daniel Teske
7958565c96 ProjectTree: Fix crashes on removing folder nodes
The code that invalidates m_currentNode folder nodes on removing wasn't
run due to a typo.

Change-Id: Ib7d545da4078275b2875c9a4c6246909234c8073
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-01-20 15:52:02 +01:00
Daniel Teske
e7e8f2265e ProjectTree: remove unnecessary emit
Change-Id: I6631f0aec8a487095f4c6133c1c2a4dad8f810ee
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-01-20 15:26:27 +01:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Daniel Teske
b88cdef0a3 ProjectTree: Fix signal emissions for nodes that are not yet mapped
The Generic Project Manager builds the tree from the bottom to the
top. Previously no signals were emitted while doing that since
the watchers were added on adding the top level node at the end.

With the new ProjectTree that leads to lots of signals, and leaves
the FlatModel confussed, as that expects the nodes to be already
in the hierarchy and crashes otherwise.

Restore this behavior by checking if the affected nodes are in
the hierarchy.

Change-Id: I832b348867a8abad2afef11297b44f058592cb1d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-01-15 12:15:48 +01:00
Daniel Teske
70c9c51e5e Refactor ProjectExplorer::Node and remove NodesWatcher
The idea behind NodesWatcher was that it was the central place
to catch node related signals, so that users didn't need to
connect to each individual node and the nodes didn't need to
be QObjects. Somehow Nodes ended up being QObjects anyway.

Both the recently added ProjectTree and the FlatModels consume
the signals the NodesWatcher sends. Unfortunately there's a
ordering dependency between the ProjectTree and the FlatModels.

This patch removes all NodesWatcher and instead makes the
ProjectTree singleton the emitter of various project tree
related signals. The ProjectTree also ensures that the ordering
between the FlatModel and itself is taken into account.

And it makes Node not derive from QObject, saving some memory
in that process.

Task-number: QTCREATORBUG-13756
Change-Id: I8b0d357863f1dc1d2d440ce8172502594138b9fb
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-01-14 11:48:12 +01:00