Commit Graph

126 Commits

Author SHA1 Message Date
hjk
435b35ccfe Ios: Use setup functions for a few factories
Change-Id: Ide05c2ca859454c1745e5c243af6a3d05131194c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-02-05 07:06:55 +00:00
Jarek Kobus
656a30b407 IDevice: Replace QSharedPointer with std::shared_ptr
According to https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews
QSharedPointer impl is poor and it's going to be removed from Qt 7.

Replace QWeakPointer with std::weak_ptr.
Replace QEnableSharedFromThis with std::enable_shared_from_this.
Use std::static_pointer_cast and std::dynamic_pointer_cast
for casts used with QSharedPointer before.

Change-Id: If255a100c790860934f36d52906b93f33c31cfe8
Reviewed-by: hjk <hjk@qt.io>
2024-02-02 16:45:57 +00:00
Eike Ziller
479f1f34ce iOS: Disable anything but running for iOS 17+ devices
We currently cannot support anything than running for devices with iOS
17 and later.

Make it possible for RunConfigurations to state that they are disabled
depending on run mode.

Change-Id: I13df4dd482f6381cda15168c38ede00d95e1d692
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-29 12:13:51 +00:00
Eike Ziller
73475480f7 iOS: Do not decorate the iOS Simulator device with "ready to use" icon
The iOS Simulator device is always there, and always usable, it never
can be unavailable. Since now the device state leads to a decoration in
the device selector(s), always having a "connected" bubble there looks
confusing. Remove it.

Change-Id: Ia218e05367a18841e966ea8566e16ad859a09597
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-19 10:32:36 +00:00
hjk
23149b27ab Utils: Introduce variantFromStore and storeFromVariant
These are functional replacements for
  QVariant::fromValue(QVariantMap) (or QVariant::fromValue(Store)) and
  QVariant::toMap() (or QVariant::toValue<Store>())

We will have a few code paths in the end that need to explicitly
operarate on both QVariantMap and Store (e.g. actual reading/writing
to keep format compatibility etc), so these can't in the end be
simple to/fromValue(OneType) but need an internal 'if' or such.

Change-Id: I954f3cb24fa8fe123162b72bbd25d891dd19b768
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-28 11:16:40 +00:00
hjk
d7d78df9da Plugins: And more Store and Key
After this one, is compiles with the opt-in macro. Not changed yet,
though.

Change-Id: I29a66ecb5daa71d0d97566b81fd9f47d92f6368a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 11:45:22 +00:00
hjk
6e307be365 Utils: Rename the new Storage to Store
Apparently that's what the young people on the web use for such a thing.

Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 05:56:57 +00:00
hjk
dc6b40a5c0 Use Utils::Storage instead of QVariantMap in a few places
Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:30:50 +00:00
hjk
017d7c0e47 ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}
Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 07:31:03 +00:00
hjk
5af88f5702 Ios: Use aspects more directly in IosRunConfiguration
Change-Id: Ic6fd16287e28a16c231b0b30211f112aceb11795
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-24 10:45:04 +00:00
hjk
739f835ef1 ProjectExplorer: Remove unusual {Arguments,WorkingDir}Aspect
Follows suite to 2cc4967 to have the user side code more uniform.
Most of the extra verbosity (setMacroExpander) can go away again
when distributing the expander via the "owning" AspectContainer.

Change-Id: I9e80cb235f0a4a9ebee601dd638aefbaa41efc1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-05 12:55:31 +00:00
hjk
2cc4967451 ProjectExplorer: Replace unusual ExecutableAspect constructor
... by an (only) slightly less weird setter.

Helps with a more uniform aspect API.

Task-number: QTCREATORBUG-29168
Change-Id: I40d2e878987ed7b817e08d250566bc548712749d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-07-04 12:49:01 +00:00
hjk
f2aaf68b0c ProjectExplorer: Use FilePathAspect(s) in ExecutableAspect
In the read-only case, make it look like the previously used
StringAspect with LabelDisplay.

Change-Id: Ica76c1ba23bf9b3946c227e303cc1336f3f8d5b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-04 05:23:24 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
hjk
99f7679564 Layouting: Make aspects operate on parent items, not LayoutBuilder
LayoutBuilder is meant to be an implementation detail nowadays.

Change-Id: I777ab934d3d405873e819eeddd27428d8c652f9a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-03 13:44:28 +00:00
hjk
642c593481 Utils: Flatten LayoutBuilder related hierarchies
Originally the idea was to only expose LayoutBuilder, but we
are getting more and more related items. Be consequent now,
and have everything in Utils::Layouting, but not in nested classes.

Change-Id: Ic0f98595882e5c60a25c30ec52df4a0ea79bc0ca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-20 12:44:30 +00:00
hjk
6a1a6d85b8 iOS: Tr::tr
Change-Id: I547af218546927622414999e5b9019ab62916e7e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-16 16:11:20 +00:00
hjk
ac5db86129 iOS: use dedicated classes to create run workers
Change-Id: I3ba7b75edf69b9cf88726132f154de5c4cc7ca7b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-11 09:39:36 +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
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
Jarek Kobus
a98b185e90 Drop Qt5: Android, IOS & WASM: Get rid of QOverload
Add a context object into some lambdas.

Change-Id: I72631aeb36703f8f335f3819796fb52148f1b377
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-20 10:30:48 +00:00
Eike Ziller
d7ba5a84b0 Merge remote-tracking branch 'origin/8.0'
Change-Id: I024823b6667947895eff7570286cc11ee09d3e1d
2022-06-02 13:26:23 +02:00
hjk
9524a3f025 ProjectExplorer: Make target device for executable aspect explicit
Just run and host is not enough, build device is needed, too.

This fixes the MakeInstall step for remote linux.

Change-Id: I3ec797379b7d0d5842780d505d8b87a91286e460
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-02 10:55:23 +00:00
Artem Sokolovskii
1241761035 ios: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: If29d2960692c42456967025d60e6d6d7ddd09928
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-02 09:42:19 +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
6e5415e95f Ios: Move runControl's runConfiguration calls further up
The data is now pulled out of the runconfig directly instead of relying
on the indirection using the runconfig pointer inside RunControl.

This is only barely better, but gets rid of one direct user of
RunControl::runConfiguration().

Change-Id: If93576ba25ea9f3ddbeae2535217f5c2f361eaf6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-04-27 10:03:57 +00:00
Vladimir Serdyuk
5d1d6c83a4 iOS/CMake: Fix running non-Xcode targets and targets in subdirectories
Improve support for running iOS bundle built with CMake introduced in
3a294f670d.
Currently it supports only Xcode generator and does not work if target is
created in a subdirectory.

This patch adds support for non-Xcode generators (tested with Ninja) and
targets created in a subdirectories with any generators.

The solution is not pretty due to the need to keep qmake compatibility.
Would be glad to refactor if there's more correct approach.

Change-Id: Ieaf7e3186ab55cadc643d9bd3d94442f9ac72228
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-10 15:23:27 +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
61bfd32438 ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places.

Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:27:21 +00:00
hjk
51e7bce109 ProjectExplorer: Rename Base*Aspect to *Aspect
In most cases they are used directly, so there's not much Base* in that.

Added the old name as alias as porting help for a while.

Change-Id: I494a8a560b8996bcf74915ea3570b504df6a6b4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 07:35:43 +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
021cab2048 Utils: Introduce FilePath::operator/(const QString &)
Including some random uses.

This mimics  std::filesystem::operator/(std::filesystem::path).

Change-Id: I0b0f5cf0d962fd33d4cbb9be96645a0b4a21ee03
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-09 07:48:22 +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
hjk
88b037a600 iOS: Call deviceTypeAspect->update from any update
While triggering unncessarily in some cases now, the function
is cheap and moving the call out of the way will allow for
removing RunConfiguration::doAdditionalSetup() later.

Change-Id: I06961ca43e6e56ebd16bf3c04e8ce0a4478494ba
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-17 09:00:11 +00:00
hjk
bd63a47d67 iOS: Use new central RunConfiguration::update
Change-Id: If19926aac16b501aee7a1117c7915f915af061fc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-04 10:16:34 +00:00
hjk
d79c76eb11 ProjectExplorer: Make enabled state updating part of runconfig updates
RunConfiguration::update() is becoming a central place acting on
requests to act on interesting changes, triggering notifications
to "the outside" from there is natural.

Change-Id: I159cb548c159a607e2628a178362987fb37b59e3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-04 09:43:51 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Christian Kandeler
efa9832912 LayoutBuilder: Allow for more compact code at calling sites
Change-Id: I12bb6dbfc138e03138b9a74d36e864d8ea36092f
Reviewed-by: hjk <hjk@qt.io>
2019-11-07 11:53:37 +00:00
hjk
6eaf239777 ProjectExplorer: Prepare more flexibility to aspect layouting
This hides the explicit use of a QFormLayout from the aspect
interface in a new LayoutBuilder class. That currently works
only on a QFormLayout in the back, but opens the possibility
to use e.g. a QGridLayout as use on the Kits and some option
pages.

The aspects now only announce sub-widgets they like to add,
actuall positioning is does by a new LayoutBuilder class,
also cramming several widgets in an hbox in the right column
of the QFormLayout is done there.

Change-Id: I2b788192c465f2ab82261849d34e514697c5a491
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-18 12:24:39 +00:00
hjk
335ea0c831 iOS: Avoid double-indirection between DeviceTypeAspect and run config
No need to leave the aspect context.

Change-Id: I96a93f7c85d8bbb1fdc28352a4c70a29bc510e4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-30 07:11:45 +00:00
hjk
1ca91b16a0 iOS: Remove unused qtsupport includes
Change-Id: I0f5c867e712d152377d05c3e4105e7705e7a4547
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-14 08:37:49 +00:00
hjk
fcffb5f2fc Utils/all: Create an OutputFormatterFactory
Essentially following the scheme used for the various project
configurations. This makes it possible to construct OutputFormatters
by Id only, potentially reducing hard plugin dependencies and
opening the road to have several output formatters per
RunConfiguration/Outputpane/...

Change-Id: I4b5fb6fb6be8b0d9a0859f178bb0effc3398b09e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-13 13:07:06 +00:00
Eike Ziller
dcc47f2587 iOS: Share code for simulator display name
Change-Id: Iecfaa43aefc7ed783d4149dec008330ee5c124e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-12 08:37:12 +00:00
Alessandro Portale
0933c20de8 connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 14:07:03 +00:00
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
166cb39709 iOS: More FileName::appendPath -> pathAppended changes
Change-Id: I3db6b1778e6e47e26e243fb2609c481651aa91fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-17 09:26:57 +00:00
hjk
36f4b9a81e Ios: Remove direct compile time dependency of IosRunConfig on qmake
Change-Id: Ieb0cbc71b525972afb66883b010cbf389657c406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-06 08:37:31 +00:00