Commit Graph

286 Commits

Author SHA1 Message Date
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
2b1c8aa877 ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 05:51:40 +00:00
hjk
9433b8a7e7 ProjectExplorer: Use Utils::FileName in ProcessParameters
For the command and the working directory.

Change-Id: Ia69dc7100aeb57bb6e1b35f4dd4f3cf3763d8cda
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-15 12:55:22 +00:00
Christian Kandeler
261d7752b0 RemoteLinux: Retrieve deployment info from local install root
This provides correct deployment information as seen by the build system
when Qt Creator cannot retrieve it directly.
It's most useful for autotools and cmake projects, but can also help
with qmake in certain edge cases.

[ChangeLog] It is no longer necessary to provide a
QtCreatorDeployment.txt file when using CMake projects with remote Linux
devices.

Fixes: QTCREATORBUG-21855
Change-Id: I27e07a45dd1565e489f4b573cc3fff8191c57d9b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-23 15:52:05 +00:00
Ivan Donchevskii
2c5808bada CompilationDatabase: Ask for the root path and scan for headers
Let's use the same approach we have for CMake projects by using
the same TreeScanner class.

Compilation database does not have a concept of the root directory
so let's show a file dialog and ask for it the first time the project
is loaded. Next times we open it we take this path from settings.
This root path can later be changed from the project tree context menu.

Fixes: QTCREATORBUG-22031
Change-Id: I151aed8d0504b2e8aa14aa774cad25f8c86d5c17
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-05 15:26:19 +00:00
hjk
4d2981b1f4 ProjectExplorer: Un-protect ProjectNode constructor
Not much protection needed, and not provided either, as seen in
the removed workarounds.

Change-Id: Ib33f6481cdb04481c0324bdeb57eb50143ecb62f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 10:41:50 +00:00
hjk
09372918c1 ProjectExplorer: Remove FileNode's isGenerated constructor bool
Use setter of base class, similar to setListInProject() before.

Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-25 12:23:31 +00:00
Eike Ziller
868160f215 Merge remote-tracking branch 'origin/4.8'
Change-Id: Ia8fed69168d87afafdb5acf4de4d5d30f9b4ebf5
2019-01-31 08:38:13 +01:00
hjk
9bb936499d ProjectExplorer: Collapse BuildInfo hierarchy
... to pass it around as real values, avoiding, among others,
the need of occasional explicit deletion.

The formerly extra members of the derived stuff are handled via
an extra variant (for data) and via a functor in the build
configuration factory.

The change is mechanical.

Change-Id: I19ca4e0c5f0a5b196fc16dfb98bb005dc679f855
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-30 16:51:05 +00:00
hjk
070e0efdcc ProjectExplorer: Rename IBuildConfigurationFactory
... to BuildConfigurationFactory. It hasn't been an Interface for a
while and the new name matches Run- and DeployConfigurationFactory

Change-Id: I923c6a27e18a99628251b69e0270e910836e7b2a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-29 11:38:31 +00:00
hjk
346ddbaa08 ProjectExplorer: Use DeployConfigurationFactory::clone
... instead of DefaultDeployConfigurationFactory::clone when copying steps.
It's effectively the same function, so functionality is unchanged, but
the Default* class name is misleading.

Change-Id: I004ddcd500498fc5a34f12fea74ddcab3c861e10
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-28 10:02:46 +00:00
hjk
e6a184fe5c ProjectExplorer: Merge Qbs* into DefaultDeployConfigurationFactory
DefaultDeployConfigurationFactory used extra effort to not apply to the
Qbs (Desktop) case, with QbsDeployConfigurationFactory plugging exactly
that hole with essentially the same functionality, which is even the
default of the base class.

The only differences are the display name, which is dropped in this
patch, and the different keys in the .user file, which are updated
with this patch. Note that the display name "Qbs Install" for the
DeployConfiguration stays with this patch whereas a freshly created
one will get the default "Deploy Configuration" name.

Change-Id: I255371d0a0688fbc6303083eb6aa20563e876264
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-25 09:57:08 +00:00
Christian Kandeler
e5a5d38c20 Fix ProjectExplorerPlugin::testProject_setup()
The absolute test paths must be in the right format for the host
platform, i.e. have a drive letter on Windows.

Change-Id: Ibf08a9e8a8b1f9ee1bb19d5307205b53012049b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-24 08:39:56 +00:00
Orgad Shaneh
b46fc4a3b9 ProjectExplorer: Simplify Project::isKnownFile
Use std::binary_search instead of lower_bound. The iterator is not needed.

Change-Id: Ie40441c0780bcf0b912644c4cdfd2d73068fb441
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-21 16:24:25 +00:00
hjk
93257a56a0 QmakeAndroid: Replace remaining AndroidQtSupport
This uses the same approach as in the previous patches: Have some
generic interface in the base classes (here ProjectNode::targetData()
setTargetData()) and implement on the qmake project side.

Implementation for Cmake/QBS is architecture-wise possible, but
not used right now, and left for later.

Change-Id: I3bbf66170020cf9027a894cd66db15ec7ffbf499
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-20 13:13:51 +00:00
hjk
f2bade30cf ProjectExplorer: Introduce a FolderNode::findProjectNode()
And use it.

Change-Id: Iaf13c4661e397bdb4d756c352683b696e337c8af
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-18 14:59:40 +00:00
hjk
7915e47cff ProjectExplorer: Fix Project::findNodeForBuildKey
Amends 18669c8215.

Change-Id: I36232f434195c59014a8d085d13f324b7e39cfd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-18 13:30:25 +00:00
hjk
6ad9446086 ProjectManager: Fix Project::findNodeForBuildKey()
Amends c58da42bab.

This operates also on not-fully loaded projects now, which was
previously causing a crash on android projects.

Change-Id: I44eeb7af8ed53a47ef39e7f1bafb07b871879ce5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-17 13:02:02 +00:00
Eike Ziller
2529b36b40 Merge remote-tracking branch 'origin/4.8'
Change-Id: Id1484d611d457d8e4598fb53975b2288690b64bb
2018-12-17 10:05:11 +01:00
hjk
5ad66f6442 ProjectExplorer: Fix initial top level expansion of projects
For freshly created projects using the json wizard, this
expands the outermost level of that project's entry in
the project tree.

This intentionally does not trigger when reloading from existing
sessions do honor a user's choice after collapsing that
item manually.

Fixes: QTCREATORBUG-17800
Change-Id: I101efaea84e68a4e769c803918652a1447805b2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-13 14:22:01 +00:00
hjk
18669c8215 ProjectExplorer: Reduce qmake specific logic
- add a QString FileNode::buildKey(), returning the build key
  for a build represented by that node, if any.

     * for QmakeProFileNodes the build key is traditionally equal
       to the file name, so use that.

     * for QbsProductNode use the uniqueProductName()

- add a Project::findNodeForBuildKey(QString buildKey) convenience
  function searching a Project(!)Node matching that build key.
  That's the only use case there is right now, and I see no reason
  yet to travers all files (yet).

Change-Id: I388c0e06c03111e12d630899d762448e974a5737
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-12-04 08:53:34 +00:00
Christian Kandeler
2485eb1a8c QmlDesigner: Do not require a qmake project for designer import paths
Let's enable all build system plugins to provide this information.

Task-number: QTCREATORBUG-20810
Change-Id: I0ef953e3c2c9a2be1fc4187e93232e9a2aeacafd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-08-20 12:44:41 +00:00
Marco Bubke
7bae47642c Add optional system include to compiler option builder
System includes suppress warnings and prevent indexing of unwanted symbols.
Using system includes for all includes outside of the project can be
quite advantageous. The rootProjectDirectory() can be extended to be set
in the project settings. An automatic generation could be possible but
could create an unwanted path which includes files outside of the
perceived project.

Change-Id: Ib9d3158f14f41efe1f6657f962d5c4437bb324b2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-08-14 15:03:51 +00:00
Tobias Hunger
28a1ef8bab Project: Fix setActiveTarget()
Allow setting to nullptr if no target is available.

Change-Id: Id51a176185eeaa31fef827d9ca722da9e62b9232
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-14 14:32:16 +00:00
Tobias Hunger
46f0fa8b27 ProjectExplorer: Use sessionmanager to set active target
Change-Id: I1e3abe473dc5eb68589de5b0b5d6ec8ea361febf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-06-05 08:09:13 +00:00
Tobias Hunger
bcbb6e61ef ProjectExplorer: Use unique_ptr to hold targets in projects
Change-Id: I8f793f5e552b65939d6c7c5e0eb42b89f9f45c3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-24 11:39:49 +00:00
Tobias Hunger
e8040081a6 ProjectExplorer: Don't register targets that are restored to empty state
Don't accept targets that get restored to an empty state. This un-confuses
the Projects page:-) Note that DeployConfigurations are not tested:
I see no use-case where a target with only a deploy configuration makes
any sense.

This can be triggered, e.g. by opening an existing cmake project after
making sure there are no more kits with cmake tool set up.

Change-Id: Iaf14f70e4e0d4206a88a08b47b0eccc666653f76
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-18 08:29:13 +00:00
Tobias Hunger
bdd2dd371e ProjectExplorer: Add FolderNode::addNestedNodes taking unique_ptrs
Use that in CMake's tealeafreader.

Change-Id: Id1c372b083df380d0d930668cf7eec4ee89060c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-04 09:02:56 +00:00
Tobias Hunger
0b1ed791a5 Project: Fix soft-assert triggered by Qbs projects
Soft-assert when a root project node is set again, except when
that node is nullptr.

Change-Id: Ib7c1891defc79d464a692c0e982b668be9a40cf9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-03 11:24:14 +00:00
Tobias Hunger
5754d5accf ProjectExplorer: Use unique_ptr for Project::setRootProjectNode
Change-Id: If63a49d0eecfb93adcc6076fcb3208c87603af10
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:35 +00:00
Tobias Hunger
1f55ba9012 ProjectExplorer: Use unique_ptr to hold ProjectNodes
Change-Id: Iaa5bea221686564de24138a99b5fe0d09521c118
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:29 +00:00
Tobias Hunger
2a34f2177c ProjectExplorer: Hide build page for projects that do not build
Change-Id: I56feaab67690b5ece7379a9c1f676392230de107
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:52 +00:00
Tobias Hunger
460fdc02e0 ProjectExplorer: Report project-specific kit errors/warnings
Report project-specific warnings about the kit used in Project Mode.
E.g. a python project should not complain about missing toolchains,
while a qmake project should.

Change-Id: I5ce6742683cdeffc7ff3f1a3e8f0b89aee9aa0b4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:45 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Tobias Hunger
63a4654a8e ProjectExplorer: List foldernodes in project as well
List folder nodes (e.g. used for QRC files) in Project::files(...).

Task-number: QTCREATORBUG-20220
Change-Id: I9879d79530fd78a6b0976fe7fdb45a23d2d9c553
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-11 13:23:22 +00:00
Eike Ziller
ab7960f6cf Move Project::makeUnique to Utils
This is more generic than projects

Change-Id: Ifdbc57ff48f9fd4a40e6149ba636e0a55cbac502
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-11 06:42:27 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
hjk
66d18ce07f ProjectExplorer: Simplify IBuildConfigurationFactory interface
Following the RunConfigurationFactory lead this replaces
f = Foo::find(); f->do() by static Foo::do() stanzas.

Also de-virtualize/private-ize IBuildConfigurationFactory::canCreate()
as it is only a local helper nowadays.

Change-Id: Id36ba514f426ebd054592189aa29c170ba00d92f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-04 10:14:22 +00:00
Tobias Hunger
530fc225fa Project: Use std::unique_ptr for root project node
Change-Id: Ice101fa57c5ee09a58dc6c99f6716fa4919ade59
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-03-28 13:11:32 +00:00
Tobias Hunger
49c910c7ab TargetSetupPage: Work for projects without BuildConfiguration
Change-Id: Ie145bc3c87f01326a25e75f5c80a4d05da58bf6b
Reviewed-by: hjk <hjk@qt.io>
2018-03-16 11:25:48 +00:00
hjk
805b28b8b7 ProjectExplorer: Simplify DeployConfigurationFactory interface
Following the RunConfigurationFactory lead this replaces
f = Foo::find(); f->do() by static Foo::do() stanzas.

Also protect DeployConfigurationFactory::canCreate()

Change-Id: I80fa491f836c3b9186f6ce6dccac4d52d4b80fc8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-15 13:09:27 +00:00
Tobias Hunger
835d4e92f3 Project: Improve default implementation of Project::needsConfiguration
Change-Id: Ic4d227334d818658f179c0589462551509274c17
Reviewed-by: hjk <hjk@qt.io>
2018-03-09 12:57:59 +00:00
Tobias Hunger
8ae505f30e QmlProject: Unify selection of supported kits
Change-Id: Ic33e9688d823bd09664e5dc74fe5253cb5fcbc58
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-09 10:56:17 +00:00
hjk
8b92da254e Rename IRunConfigurationFactory to RunConfigurationFactory
It's not an *I*nterface anymore

Also, remove the in-all-but-one case unused QObject parent and the
object name that was only there for debugging purposes. The class
type serves the same purpose in the debugger.

Change-Id: I0dafb01e6b4fd7c7df04a63aaa3ef3e4bd693f6f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-07 16:07:42 +00:00
hjk
6781217280 ProjectExplorer: Consolidate RunConfig creation codepaths
Move some code around to make interfaces slimmer.
Also no need to check canHandle() twice per creation.

Change-Id: I7c86e2dc78ebd53a0f8e9609e9fa135aaf31e7b7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-02 15:32:21 +00:00
Tobias Hunger
997ece4361 Project: Remove unused Project::requiresTargetPanel(...)
Change-Id: I7a5298edefd7e26841c4070be23534dd33d093cb
Reviewed-by: hjk <hjk@qt.io>
2018-02-19 13:22:21 +00:00
Tobias Hunger
8059bf6204 Project: Make setRequiredKitPredicate private
Make calling Project::supportsKit(...) the default implementation.

Change-Id: I0e47972097e760e2ff3be229afb85eff839146b8
Reviewed-by: hjk <hjk@qt.io>
2018-02-19 09:28:02 +00:00
Tobias Hunger
034f0209b0 ProjectTree: Fix crash working with resources
Fix the notification of subtree changes to keep the project in
the loop, so that it can adjust its list of known files.

Ignoring that will cause crashes, e.g. when the ResourceEditor
updates its subtree of the project.

Task-number: QTCREATORBUG-19613
Change-Id: Ib7bb9afe48eb248cdf675ba2093b266fd728d7b2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-22 11:51:47 +00:00
Orgad Shaneh
e75dd28d0c ProjectExplorer: Fix build with Qt 5.6
Change-Id: Icb9cae9c5baaa5cdc2dd6dca2bb493cdf0d73012
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-01-11 13:48:43 +00:00
Tobias Hunger
4f49b46eaa Project: Add some basic tests
Change-Id: I2b60c9df93700a8aa659adceee4e00cf46584a5b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-11 10:32:02 +00:00