Commit Graph

307 Commits

Author SHA1 Message Date
hjk
377f5badd8 Project: Inline RunConfiguration::wrapWidget helper again
There are no external users left, so there's no need to expose
it in the header anymore. Also saves a cast.

Change-Id: I1ced368ebc9588cbc0058cc7d37f39ab80f9c595
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-02 06:29:46 +00:00
Eike Ziller
d3d47dd521 Merge remote-tracking branch 'origin/4.7' into 4.8
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: Ia1d6035a335fd56069ec8d6d106d58124ee8798d
2018-09-21 09:26:38 +02:00
hjk
b9a8e77a82 ProjectExplorer: Decommission RunWorkerFactory::priority
The only ever user (AppManager) doesn't need it for disambiguation
anymore.

Change-Id: Iea2f4d545bf9afb0610bf73c4ec7b2f29357edc0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-20 08:25:51 +00:00
Jonathan Liu
807b0f78fc ProjectExplorer: Do not add too many newlines for remote processes
Do not add newlines when remote process output gets flushed.

Task-number: QTCREATORBUG-19367
Change-Id: I9e878695279404d436264abd580884fb6a9e91ad
Reviewed-by: hjk <hjk@qt.io>
2018-09-20 07:43:33 +00:00
hjk
d421bc2fe3 ProjectExplorer: Split IRunConfigurationAspect
... into items that can be used generically in project configurations
(ProjectConfigurationAspect) and items that have a choice between
global and project settings (GlobalOrProjectAspect)

Change-Id: I94831237bdbb18c339eb76eba131bf7f928933d6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-18 06:13:21 +00:00
hjk
2c4dadccb6 ProjectExplorer: Update "generic" run configuration aspects
None of the run configuration aspects that are added to each runconfig
depend on the actual runconfig, only two need the target, the rest
nothing at all. So use target as common denominator.

Change-Id: I31829e63ac79d5c707bb068d73fc6a4687cb4c47
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-13 12:36:35 +00:00
hjk
32ba65c7f8 ProjectExplorer: Remove IRunConfigurationAspect::runConfiguration
... and adapt constructors to not take the now-unneeded
RunConfiguration pointer.

Change-Id: I53ff338f51334ff7b0c22d4bed92bfcfc8225ea7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-13 12:09:39 +00:00
hjk
35b941462e ProjectExplorer: Remove RunConfigWidget wrapper class
Not really needed, a QWidget does the job, too, and de-emphasizes
then 'Run' bit. The display name is now taken always from the
aspect, but that's what was the practically the case before,
albeit with different implementations.

Change all names to *[cC]onfigWidget* (in line with ISettingsAspect).

Change-Id: Ida0409a2dd0b175dd5ce4202f9b9e94b3f2db421
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-13 07:32:57 +00:00
hjk
f66770cde1 ProjectExplorer: Pass macro expander to ArgumentsAspect::arguments
To remove the last user of IRCAspect::runConfiguration.

Change-Id: I1390166730112008a4050877f96bb29f274e7ef1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-13 07:32:22 +00:00
hjk
b95b675e41 ProjectExplorer: Pass macro expander to WorkingDirectoryAspect
... when needed to avoid a use of IRCAspect::runConfiguration.

Change-Id: I0bdae0a2a1aad4475dd3225e6ae71da7bfd9513f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-12 07:08:19 +00:00
hjk
69753cf9b6 ProjectExplorer: Remove direct runconfig dependency from ISettingsAspect
Change-Id: I5d8a6a31f6bf97c34163b64b8d37f9ea070717ba
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-11 07:51:11 +00:00
hjk
3ffe3588d7 ProjectExplorer: Compile fix
Amends 6688623b37.

Change-Id: I89477ac44634402539fe58b243c036d478a762db
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-10 09:53:33 +00:00
hjk
4192d7d62f ProjectExplorer: Compactify runconfiguration aspect creation
Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-09-04 12:45:21 +00:00
hjk
25400751a4 ProjectExplorer: Remove RunConfiguration::fillConfigurationLayout
Instead of using a hard-coded list of well-known (optional) aspects,
add all aspects, so there is no need for special treatment of
RunConfiguration with unusual/custom aspects needed.

Price and benefit is that the individual run configs are again
responsible for the aspect display order which is determined
from the aspect construction order.

Change-Id: Iff2656b2e358c0f0f789d4c006a5c44d0a1536a5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-09-04 11:02:49 +00:00
Tobias Hunger
944aa963a8 Journald: Do not try to read journal entries for remote applications
Task-number: QTCREATORBUG-20995
Change-Id: I27911183084f8423ab7638b9443949a84c47b953
Reviewed-by: hjk <hjk@qt.io>
2018-09-03 11:10:30 +00:00
hjk
263cf4c608 ProjectExplorer: Remove RunWorker::setDisplayName
It has been an obsolete alias for setId for a while and downstream
uses have been adapted.

Change-Id: I467370aa67054599c7771e8275d28e62ddc461fa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:02:22 +00:00
Tobias Hunger
80c2ce118d ProjectExplorer: Modernize even more
Use unique_ptr for all *Private classes, except for those
in singletons.

Change-Id: Ib56c31ddedc6e9cf321f15de1f1e697a27ad4089
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-24 09:04:54 +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
hjk
0fbb2839f9 Remove ApplicationLauncher::Mode
The actual remaining use was to pop up a terminal in some
setups where Mode == Console, with a default of Gui meaning
"no console". In some downstream uses it was used set to
Console (probably to mean "this helper process does not need
a gui") but then luckily ignored when actually starting the
helper processes.

All cases where the console is useful and requested are
nowadays RunWorkers belonging to RunConfigurations with
a TerminalAspect, so they can directly get the relevant bit
from their RunConfiguration without having it part of
all StandardRunnables.

Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-05 15:08:29 +00:00
hjk
772098c710 Inline RunControl::canReUseOutputPane into its only caller
Change-Id: I2e858ab3bf715b41c26cfb6246d470787d003e3c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-29 14:30:22 +00:00
hjk
65be72d64d ProjectExplorer: Add RunConfigFactory::addRunWorkerFactory convienience
There is a recurring special case that certain run controls depend
on the presence of specific RunConfiguration (which in turn has
it's own restriction on e.g. target or project types) but have no
further restrictions.

Make it easy to handle that case.

Change-Id: I2e86f366591b02003f720dcc00b4c52bb2f34e00
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-29 09:03:29 +00:00
Eike Ziller
c8c6b28e22 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h

Change-Id: I192b9e88f967182f3275b4b98abed1220c26daac
2018-05-28 16:10:23 +02:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
hjk
68867a8a62 ProjectExplorer: Start merging Runnable and StandardRunnable
With AndroidRunnable gone, there is only one incarnation of
a Runnable left - the StandardRunnable.

It is not expected to ever need a different runnable again,
as platform differences are now handled in the platform specific
RunConfigurations and RunWorkers created there locally, and
global information is typically communicated via
RunConfigurationAspects, so there is no point in keeping the
Runnable::{Concept,Model} machinery.

This patch here essentially makes StandardRunnable a type alias
for Runnable, to allow downstream changing all

  if (r.is<StandardRunnable>()) { ... r.as<StandardRunnable>(); }

one by one.

When all downstream is adjusted, the alias can go completely.

Change-Id: I86aa92c7fae8d54ca603484b7e1746c126b0bddb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-22 08:24:46 +00:00
hjk
a5d987bb8a ProjectExplorer: Prepare RunWorkers for more flexible setups
A RunWorker can in theory (and will in practice) support several
run modes. Also, it has turned out to be beneficial to specify
restrictions on a fine grained level, so re-use the idea from
the RunConfigurationFactory etc. constraints setup here.

Creation of RunWorkerFactories can be made protected at some time.

Change-Id: I9e2a84abfd7377c5bf0bbe84e0c7940b1317dc10
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-17 07:08:12 +00:00
hjk
8580e32e88 ProjectExplorer: Start transferring RunWorkerFactory ownership
... to the plugins providing them.

To allow this being done one-by-one in the plugins, allow both
central and per-plugin ownership, and clean up the central instances
centrally. This step will be removed again once the transition
is complete.

Change-Id: Ica7786012e05ab83a0784448f2f8b3b781fe2167
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-17 07:05:59 +00:00
hjk
1f3381a3c2 ProjectExplorer: Create a RunWorkerFactory class
This paddles back a bit on the RunWorker creation setup mainly
to get a more flexible setup when it comes to share RunWorkers
between different setups.

Change-Id: I263742cb1df3689f133a2f6f948ed59a2a52d383
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-14 16:47:20 +00:00
Eike Ziller
2278ebed1e Merge remote-tracking branch 'origin/4.6' into 4.7
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp

Change-Id: I873a2fa112321225e7b478739fc017b01d24ce18
2018-05-14 09:44:43 +02:00
hjk
3cfc715d7d Debugger: Try harder to find a usable device
In remote setups without proper run configuration (e.g. attach
using the menu) there was no device available. In some situation
there's access to a kit, though, containing the right device.
Use it.

Task-number: QTCREATORBUG-20331
Change-Id: I54523f71fc10c9959901f36f3d62872d139279e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-11 07:56:33 +00:00
hjk
4ca54d86ff Enhance IRunConfigurationAspect base interface
Move some commonly used functions to the base,

The plan is to identify aspects by Id instead of type more often,
so avoid casts proactively.

Change-Id: I1b94b858a4491a0e31cedc788ded643a82242b2a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-08 12:57:03 +00:00
hjk
8b452b28d2 Inline complex RunConfigurationCreationInfo constructor
Names are easier to follow than positions in long argument lists.

Change-Id: Ia0ace9d864a1100e649f6725e7de338ab2653d05
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-07 07:46:20 +00:00
hjk
9ed3a05c59 ProjectExplorer: Introduce a RunConfiguration::buildTargetInfo() function
As convenience function, and use it in some places.

Change-Id: I02e49f2cdc301bbf1261836032d3fa3a5b188446
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-27 13:46:54 +00:00
Ulf Hermann
f0baf01a2e ProjectExplorer: Keep RunConfiguration in ISettingsAspect
Any SettingsAspect that doesn't refer to the global settings has a
specific RunConfiguration it is about. This can be very handy to know
when constructing the actual settings. Right now there is no way to find
out about it.

Drop the clone() and create() methods. They weren't used anywhere and a
proper implementation should take care of the runConfiguration member.

Change-Id: Ie505a9b19707f8a1b6bf9cae73513cd3c30d0bca
Reviewed-by: hjk <hjk@qt.io>
2018-04-27 08:55:24 +00:00
hjk
def04e88a2 Simplify runconfiguration aspect addTo... interface
The parent widget is always given by the layout, no need to pass
it as separate parameter.

Change-Id: I9e7ed3a89eb63b78a549471d839060131737ff78
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-24 07:26:22 +00:00
hjk
d269e9a492 ProjectExplorer: Factor out some common code in runconfigurations
DesktopQmake, CMake, Qbs, Nim, RemoteLinux and Qnx now have a common
understanding what should be in a runnable and how their
configuration widget should be set up. So move them over to
using shared code, too.

Several others runconfigs only lack a one or two more aspects
to follow suit in later patches.

Change-Id: Ia862c95c97d63bd0a0f2dc303435775a2fc530d3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-24 05:58:48 +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
hjk
83c6a4916c ProjectExplorer: Streamline OutputFormatter creation a bit
Note that the concept of a single monolithic OutputFormatter per
RunConfiguration (and why RunConfiguration, not RunControl to start
with?) is unchanged and suboptimal as one cannot easily combine
existing use cases, e.g. Python_and_Qt.

Change-Id: Ibeb8191020387324f22ed313230293597f96e36a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-13 11:55:31 +00:00
hjk
bc698d4ce6 ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of
BuildTargetInfo::buildTarget have by now been split
into separate values in BuildTargetInfo:
  - buildKey     a handle to one item in Target::applicationTargetList
  - displayName  a user-visible string in the run settings page

The buildKey was tweaked to coincide with the previous 'extraId',
i.e. the non-RunConfiguration-type part of the project configuration
id that (still) use id mangling.

This allows replacing the cases of locally stored seven different
versions of buildKey(-ish) data by one RunConfiguration::m_buildKey,
and do all remaining extraId handling in RC::{from,to}Map only,
i.e. remove the base ProjectConfiguration::extraId() virtual and
remove the "re-try fromMap with mangled id" hack entirely.

The id mangling is still used to temporarily maintain .user file
compatibility in some cases for now, but should be replaced by
storing the build key and the RunConfiguration type soon. Qbs
already changes in here to only use the uniqueProductName as
buildKey, without the previously added display name which is
stored as part of the ProjectConfiguration already.

It turns out that RunConfiguration::buildSystemTarget was intended
and used to retrieve an item from the Target::applicationTargetList
for some configurations, coinciding with what buildKey does always.
So use that insteand and drop RunConfiguration::buildSystemTarget.

There is clearly is further consolidation potential left.

handling of (default)displayNames is still a per-runconfiguration
mess and there is further consolidation potential left.

Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 12:11:45 +00:00
hjk
a06514c365 ProjectExplorer: Start unifing visual appearance of run config widgets
Margins and layout style widely differ so far. Start moving everything
to a QFormLayout with the same margin and growth policy.

Change-Id: I0bd1d8b2ec9830be56354be1376a2a24eebb8845
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-10 08:41:16 +00:00
hjk
e760cbdd52 ProjectExplorer: Remove unused functions
Change-Id: Ib35a04e486fb50a0a43c718adb726bee399165d9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-09 14:13:30 +00:00
hjk
0df9d6dda9 ProjectExplorer: De-qobject-ify RunConfigurationFactory
Some translations moved over to the corresponding RunConfigurations,
one setParent() replaced by direct deletion.

Change-Id: Ib5e527b71353a6be70b332ac2dfd2f5cd2499a60
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-09 10:57:36 +00:00
hjk
232e8712a5 ProjectExplorer: Streamline RunConfigurationFactory interface
canHandle() is only used locally in the implementation, so
make it private and de-virtualize.

canCreateHelper() did nothing except returning true anymore,
so remove it.

Change-Id: Ifac39e077e3c296b2b2dfc9fbb29c20884e056a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-05 12:13:05 +00:00
hjk
798d115a5c Consolidate some run configuration widget boilerplate
This removes the outermost layer of widget-vbox and moves some
common code into a helper function.

The pattern repeats (with variations) a few more times, that's
left for later patches.

Change-Id: I8c98229cf41d03d5330c896ec9fa0965bfc65602
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-22 09:44:49 +00:00
hjk
6d8eaad281 BareMetal: Fix run configuration display name setup
Change-Id: I0ba784a4d775730277ec0b21aef649011f37b739
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-22 08:45:43 +00:00
hjk
5d79e1dcee Drop QFileInfo::exists() check before trying to run an executable
Physical existence of a file is not strictly needed for something
being runnable, e.g. 'foo' can be used to start a process on windows,
even when only 'foo.exe', but not 'foo' itself exists.

On the other hand, the existence of the file is not sufficient either
to run it, so the check was too weak and too strict at the same time.

Change-Id: I4a41d2f5cbb0cb471023a8bc23628072b28a5984
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-03-20 10:14:50 +00:00
hjk
02dacc27eb RunConfiguration: Remove some unused prototype and functions
Change-Id: Iebe9a46e5c1effd56a561dda381403b0e2123cb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-03-15 09:23:13 +00:00
hjk
a5d6fe33cb Partially decouple local CMakeRunConfiguration from CMakeProject
Funnel all relevant data through target.applicationTargets() as
done for the non-local CMake-supporting setups and QBS already.

There is cleanup potential left for later changes.

Change-Id: I49ed6abd98c058a7fd1545e41b3bcd6ecb758a8b
Task-number: QTCREATORBUG-19985
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-13 15:02:54 +00:00
hjk
9541aa7772 QbsRunConfiguration: Re-model based on RemoteLinux precedence
Task-number: QTCREATORBUG-19985
Change-Id: Ifd95187b72fed3565552ecd14f3353b7e7df0069
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-03-12 09:38:27 +00:00
hjk
afe13e6812 RunConfigurationFactory: Simplify RunConfigFactory::create use
A for (f : X.allFs()) if (f.canHandle(t)) { f.doIt() ... } }
pattern can be replaced by some  static X.doIt(t), and
item.factory->create(target, item) by some item.create(target).

Change-Id: I65df8b71e03272d60f41a16795ea43a0fdb262ef
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-09 16:16:38 +00:00
hjk
2626e1629f Add some pass-through fields for {RunConfiguration,BuildTarget}Info
This is unused here by will be used in subsequent changes.

Project parsing yields information on whether there's a console
requested and whether the "magic" qtc_runnable flag for primary
executables has been seen.

Also, the current "targetname" is taking different roles in
different context, try to split-off the pure visual aspect
by allowing to specify an explicit displayName, with fallback
to the current decorated targetName if empty.

Task-number: QTCREATORBUG-19985
Change-Id: I11edfcaafd17972f6a78aeff3fbbf3d7eb91a213
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-08 14:20:34 +00:00