Commit Graph

404 Commits

Author SHA1 Message Date
hjk
c5f7f5ab0a ProjectExplorer: Tr::tr
Change-Id: I8f1b463c5cc7a53627f7a9ad261998b92f13e56a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-16 12:10:24 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Jarek Kobus
1a70403f94 Remove unused includes of QFormLayout
Change-Id: Ia877cb57037342f2a7b332b29d9cb45e9b01c4bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 07:33:29 +00:00
David Schulz
c1edc1e9df ProjectExplorer: Fix starting a docker project on windows
... by mapping the executable and working directory to the target
device.

Change-Id: I0a220fe9bae980cb279fae776962f23335eac248
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-11-16 14:01:55 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
b97c495d2b Utils: Make the second parameter to LayoutBuilder::attach() an enum
More explicit and more potential options (e.g. "treat grid as form")
than a bool.

Change-Id: I89413efe30410160c38b0e524ba64288dde2332e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-26 11:52:16 +00:00
hjk
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
hjk
8dacb123e0 Utils: Pass MacroExpander to ArgumentsAspect constructor
In the past we wanted to keep the aspect constructor simple but
it turned out that exceptions were needed and accumulating, so those
are likely here to stay.

By passing also the MacroExpander to the ArgumentsAspect constructor
allows other single-purpose warts like the ProjectConfiguration::doPostInit()
machinery can be removed.

Change-Id: I148b0ca1ab0740270eecd0d3134620de65a86d4f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-20 07:06:10 +00:00
hjk
72a2083cd1 ProjectExplorer: Shift full FilePath creation into Executable aspect
Less need for correction: When a target is given, the executable
produced by the aspect will be on the target device.

Change-Id: I86c38e9f9fa5b4d4fe9b2ef7f21a0b3aa5b28670
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-18 09:50:40 +00:00
hjk
0d733e68b5 ProjectExplorer: Create Runnables with full device paths in RunConfig
... instead of fixing them later in the ApplicationLauncher as used
by all SimpleTargetRunners.

The mapping to device paths happens now in the default commandline
getter on paths from the ExecutableAspect. This is (only) wrong in the
case of (local) custom runconfig with a device present, so this needs
a custom commmandline getter not doing the transformation.

Change-Id: I525bc0ea59b5e7caf7a445a1a723d6f5b152162d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-16 10:57:43 +00:00
hjk
5da8695dca ProjectExplorer: Pass envAspect directly to WorkingDirectory constructor
This trades a now necessary order of setup for the now removed
"acquaintSiblings" facility.

Change-Id: I85058578b792e210f24573e2ab4e3a40a8813a11
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-22 11:53:59 +00:00
Jarek Kobus
7fadaff5d4 IDevice: Make it possible to forward declare Ptr and ConstPtr
Most inclusions of idevice.h inside other headers are
required just because of IDevice::Ptr or IDevice::ConstPtr
was used there. Unfortunately, since these "using"
are defined inside a IDevice class, we just can't
forward declare IDevice::Ptr nor IDevice::ConstPtr.

Instead, create a separate header that defines
IDevicePtr and IDeviceConstPtr while having IDevice
forward declared. Redefine IDevice::Ptr/ConstPtr
inside IDevice to use IDevicePtr/IDeviceConstPtr.

Now, instead of forward declaring a IDevice::Ptr
it's sufficient to include the idevicefwd.h.

This drops the number of files being recompiled
after touching idevice.h from ~770 to ~210.

Change-Id: Ib6f2982aa0761fb4cd6593badb9c3c0c527ea535
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-04-14 12:27:04 +00:00
hjk
a26f0ba808 Debugger: Avoid one use of RunControl::runConfiguration()
Change-Id: Iaf9fb0cee4544121a4df433c3726d98ae0175ff2
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-14 09:25:46 +00:00
hjk
530b9ae85a ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs
to be copied and also to provide a suitable interface (kind
of source-compatible to direct use) for access.

The important change here is that RunControl::aspect(...) doesn't
need to access RunControl::runConfiguration() in fully aspectified
RunConfigurations anymore. In not-fully aspectified the runConfig
access is moved to the user code to make the problem visible there.
Long term, aspectification should be finished.

As an additional benefit, the resolving of macros etc can
now be done at the correct time.

Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-12 08:43:09 +00:00
Leena Miettinen
4f3d3d445c Project Explorer: Fix UI text
Task-number: QTCREATORBUG-27055
Change-Id: I9b0e4f02ea7d1ebb14a9581f21c76b8908589334
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-02-17 12:08:37 +00:00
hjk
3dd8831f14 ProjectExplorer: Simplify retrieval of WorkingDirectoryAspect values
Drop the macroExpander argument, at the cost of complicating internal
ProjectConfiguration setup a bit.

Simpler code at the user side.

Change-Id: Ie9ea0b719f6e402b44d9ba7ce6047aa4e15441fe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-23 15:22:28 +00:00
Christian Kandeler
e1e962503a ProjectExplorer: Make sure the working dir is properly expanded
... in the path chooser.

Fixes: QTCREATORBUG-26274
Change-Id: I4aa920888b9bef2820ed883e1f34a5c670a545d6
Reviewed-by: hjk <hjk@qt.io>
2021-09-23 09:18:05 +00:00
hjk
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +00:00
hjk
4a42bcd4e8 Utils/ProjectExplorer: Use FilePath for Runnable::workingDirectory
... and in some using code.

Change-Id: I231ea56628908f7d305d13f07eabe8803fe8a791
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 12:51:24 +00:00
hjk
f4a529ea95 Utils: Change signature of MacroExpander::registerFileVariables
... to take a function returning a FilePath as base.

Implementation is (not) yet changed.

Change-Id: I624efab35cf38631c816b630be5296bdf696899e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-03 05:50:18 +00:00
hjk
f7310dd8fb ProjectExplorer: Add a RunConfiguration::setRunnableModifier()
To override RunConfiguration::runnable() behavior without the
need for subclassing. Will be useful for the docker plugin.

Change-Id: I9e8511faa95355038b08c3e3be24429d66a5253f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-13 07:43:33 +00:00
Eike Ziller
2800f3b51f Merge remote-tracking branch 'origin/4.15'
Change-Id: I0afcf51d354ffd73a8f2956a7f78b1e4f032677b
2021-04-09 12:42:03 +02:00
Christian Kandeler
65db684c7d ProjectExplorer: (Re-)Add run config variables
As for the build config, we provide a global variant for use by external
tools, and one for use in the respective run configuration itself.
Also hide the deprecated "CurrentRun" variant, which was forgotten in
b55825a420.

Fixes: QTCREATORBUG-25561
Change-Id: I51aaff10301f7ff1256abf1c09ac9f5be136ab00
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-08 13:22:39 +00:00
Eike Ziller
c0cfafdd3d Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I403b236c40d73a61ae22304e289e9d4374366395
2021-04-06 15:17:40 +02:00
Christian Kandeler
1e9c42d76b ProjectExplorer: Do not cut off the "file extension"
... when constructing a run configuration display name.
The target name is not typically a file name and might legitimately
contain a dot.

Fixes: QTCREATORBUG-25480
Change-Id: I7954763661d36ae20b931d6d05ef3e29b36a9fc9
Reviewed-by: hjk <hjk@qt.io>
2021-04-01 15:08:54 +00:00
hjk
4cc6fef901 Utils: Merge BaseAspects and AspectContainer
They were quite similar, largest difference was the ownership of
subaspects, which is now handled by a bool property.

Change-Id: Ib3f2f20b9a84ef40ea8a9eb59da9c89c9a281750
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-03-31 11:56:04 +00:00
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
hjk
f8a946ce96 ProjectExplorer: Silence recently introduced warning
The checked path is actually used in the context of the debugger.

Change-Id: I58af35db65b8fb4ad0af9694714765bdc336a0ef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-22 12:06:02 +00:00
hjk
6bba37ab16 Analyzers: Re-enable switch between global and project settings
This was apparently always using project settings for a while,
even when "Use Global Settings" were selected in the Run settings.

Change-Id: I1293a617edcbfd6bc47c57102fa53096c717ec4e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 13:40:28 +00:00
Alessandro Portale
afc2fda8a9 ProjectExplorer: Use qAsConst w/ non-const Qt containers in range-loops
Change-Id: I6422b3e40a6925504a231be2d47b3214d86c6e06
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 11:19:21 +00:00
Sergey Levin
4d1b7d4c3d Update run configuration after device change
The run configuration name defaults to "<executable> (on <device>)".
When another device is selected e.g. using the MiniProjectTargetSelector
or Kits->Device option, the <device> part in run configuration name is
not updated and keeps referring to the initially selected device.

Change-Id: Idda828b7f33b754d3b50268d7417c9a2790db30e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-03 12:45:07 +00:00
hjk
0edebcfa9c Utils: Pimpl BaseAspect
Change-Id: I70a7d49010c24a44dc64d20c5548c249964b78bd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-18 14:31:45 +00:00
Christian Kandeler
ccf5daa16d ProjectExplorer: Un-tighten the RunConfiguration::isConfigured() check
Only report a run configuration as unconfigured if it has a fundamental
problem that should inhibit automatic creation.
Adapt the potentially reported issue in QdbRunConfiguration accordingly.
The concrete reason is that for cmake projects, deployment information
is only available after deployment has happened, so the on-device
exutable is not known right away.

Task-number: QTCREATORBUG-24685
Change-Id: Ibe49649ebb001d3ba2b752c9c335687da9c08ce7
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 14:37:19 +00:00
Christian Kandeler
b55825a420 ProjectExplorer: Clean up variables
Global variables with names such as "CurrentProject*", "CurrentKit*" etc
are harmful, because the term "current project" as used in Qt Creator
does not refer to the "active project", but simply stands for the
project that contains the node that is currently selected in the project
tree, which in turn may or may not correspond to the current editor
document, depending on the "sync with editor" setting. In other words,
the "current project" is almost a random value with little meaning
outside the project tree itself.
Therefore, we remove "CurrentProject*" and friends, except the ones that
are currently intentionally in use. The latter get renamed to
"CurrentDocument:Project*", so their purpose becomes clear. Their old
names are kept around for backward compatibility, but are not suggested
by the variable chooser anymore, so new usages are unlikely and we can
remove them at some point.
We also add some ActiveProject* variants that have been requested in the
past.
Also remove the "CurrentSession" prefix that was deprecated six years
ago.

Fixes: QTCREATORBUG-12724
Fixes: QTCREATORBUG-24606
Change-Id: Ibba5d0e0ce3d2beb444a5eec01fbb9b745d90a1d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-02 07:49:08 +00:00
hjk
2cabd2ceb5 Utils: Consolidate LayoutBuilder interface a bit
- the var args template for addItems was overkill creating a lot of
  instantiations. Use a temporary list instead.
- allow default constructed LayoutItems to be used for an empty cell,
  avoiding the use of a QLabel with empty text
- add an addRow({...}) overload as convenience shortcut for
  .startNewRow().addItems({...}
- rename startNewRow() to finishRow()

Change-Id: I6d49dacbac3d7acf140ca526884ba1ceeeca2e0d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-24 10:32:26 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
hjk
beee73ce5b ProjectExplorer: Update parts of RunConfigurationFactory docs
Change-Id: I4b9addde8055cb07565eea1c62e4e5b47725ff48
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-16 07:33:36 +00:00
hjk
beee392dd8 ProjectExplorer: Consolidate RunConfigurationFactory::ids
It was already only one id string with two names. Since it is not
an id for the factory but the id of the created run configuration,
settle of  runConfigurationId() as accessor.

The factory and id fields in RunConfigurationCreationInfo were
redundant. factory always implies (runconfiguration)id (but not
necessarily the other way round, in theory different factories
are possible for the same runconfiguration type for different
devices). So drop the id field here.

In one case now factory pointers instead of ids are compared, but
this is neutral there as this happens in a context of a fixed Target,
device and project are fixed there, so id and factory are equally
unique.

Change-Id: I859aa91486a2dd4abfc7369540a3322d6ec6260d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-15 12:13:38 +00:00
hjk
dd980e23f8 ProjectExplorer: Remove Target::applicationTargets()
That's BuildSystem::applicationTargets() nowadays.

Change-Id: I01cf0a491e4cb289af08f529fd15c85bfcdf5493
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-25 10:42:22 +00:00
Eike Ziller
0585ad0f64 Merge remote-tracking branch 'origin/4.12'
Change-Id: I4523ea36332772a310fd462df55683c93c61bb18
2020-02-27 09:41:05 +01:00
hjk
8cd145b32f ProjectExplorer: Remove RunConfiguration::activeBuildConfiguration
Only used once, and the concept is undesirable.

Change-Id: I7f28f8a20d6d1f003a6d8b18bbcfba343614625c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 14:51:56 +00:00
hjk
df7400b686 ProjectExplorer: Disentangle ProjectExplorer::updateRunActions
This enforces a linear pass through

  [static] ProjectExplorerPlugin::updateRunActions
  ProjectExplorerPluginPrivate::doUpdateRunAction
  [emit] ProjectExplorerPluginPrivate::runActionsUpdated

instead of the previous direct emission of the signal from
user code and connecting also the internal update to it.

This is meant to simplify reasoning about execution order and
maybe to help elimimating double executation.

Change-Id: Id8cc41a46d9dec06afb5514855f2ae80560f3695
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 14:32:58 +00:00
hjk
2cd44a546f ProjectExplorer: Inline RunConfiguration::isActive
... into the only internal caller.

The use there is dubious to some degree.

Change-Id: Icfa7437b3fdaa4dbd73fe9965a88abf4700cd3e0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 13:56:35 +00:00
hjk
a68aee95a1 ProjectExplorer: Replace ProjectConfiguration::m_macroExpander
... by MacroExpanders in Build and RunConfiguration. Deploy didn't
use its own, BuildStep always composed an empty expander with
the BuildConfiguration's, uses now the BuildConfiguration's expander
directly.

Change-Id: I9de51bfc32aeb3d73f4974175e42a37807e49ac1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 09:31:02 +00:00
Christian Kandeler
5bb6c7f0cf ProjectExplorer: Call RunConfiguration::update() when restoring
Otherwise, the executable path will not be set right after cloning a run
configuration. This is due to the fact that it's not a stored attribute,
but is retrieved from the build system.

Change-Id: I948a2765b5b5d7707b44a72fcde7559e2742284c
Reviewed-by: hjk <hjk@qt.io>
2020-02-18 15:04:41 +00:00
hjk
d32f1cd2ea ProjectExplorer: Trigger full run config update when parsing finished
The update is meant to be cheap, and this makes it easier to reason
about what state the ui is meant to be in after a parser finished.

Also, make on in-object connection a normal function call. Saves cycles
and bytes and also makes order of execution defined.

Change-Id: I9a411cd2a1ed1e0cc677bf45a7a5ea367efd7d0b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-21 13:03:00 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +00:00
hjk
b1474dc5ef ProjectExplorer: Replace RunConfiguration::doAdditionalSetup
... by an explicit update() call. This is what effectively done in
most cases, and should be harmless and reasonably cheap in most other
cases.

Change-Id: I323112ec7cdbccf19050ac54466d8e1d97a0516e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-17 16:29:45 +00:00