Commit Graph

78 Commits

Author SHA1 Message Date
Eike Ziller
15baf18911 iOS: Move info parsing from devicectl to a function
And add a test to document what we expect from devicectl.

Change-Id: I395171bb5316c21b461a01dce5c9ec87d81fb0c4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-30 08:38:03 +00:00
Eike Ziller
699b91d371 iOS: Fix small issues when connecting/disconnecting devices
- Make sure that the updating TaskTree is deleted on quitting QtC by
  maintaining a hash of running updates per device
- If an update is triggered for a device while another is running,
  cancel the first one
- If the device is disconnected while an update is running, cancel the
  update. Otherwise this leads to wrong connection information in QtC

Change-Id: Ia76921d01b47229da1b5decd6b890303f4acfbf5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-16 08:00:00 +00:00
Eike Ziller
1a29b9e36c iOS: Add a "handler" property for the tool that is used for device ops
To the IosDevice. So other parts of the code know if the device can (and
should) be handled via devicectl instead of iostool.

Change-Id: I700bd1528fad505c3f4b6442d73e24b09ceba68a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-15 07:31:29 +00:00
Eike Ziller
b2eac9acf8 iOS: Use layout builder for details in device preference widget
In Preferences > Devices > Devices > Type Specific.
This makes it fit the style of other devices, and automatically makes it
possible to select and copy text from it.

Change-Id: I637858a939ada261504970611ffdb7eccf003c1c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-15 07:30:56 +00:00
Eike Ziller
150441bf88 iOS: Avoid iostool for info gathering if possible
Previously we had a small workaround for retrieving the state of
developer mode for iOS 17 devices integrated into our own iostool.

Instead use devicectl for gathering device information for devices that
it can handle, and only fall back to iostool for the devices that it
cannot handle.

Since iostool cannot handle deployment, running, and debugging for
iOS 17 devices anyway, the end goal would be to only use devicectl
for these.

Also add a TaskTree wrapper for IosToolHandler for convenience.

Change-Id: I5bcd09eb354c2dce9b21e62e140de16f2e740d6e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-11 07:38:11 +00:00
Marcus Tillmanns
116ad3ed4f ProjectExplorer: Remove IDevice::setDisplayName
also removes IDevice::setDefaultDisplayName

Change-Id: Ie8ac3d95ba1991a20720342de3bf6e97c6414ffa
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-09-11 11:25:34 +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
Marcus Tillmanns
522de9bfd7 Devices: Unify Port Gathering method
All devices that support it use the same mechanism to gather ports
so this patch removes the individual implementations in favor
of a single one in IDevice.cpp.

This patch also removes:
* canAutodetectPorts() as it was not used.
* Port::parseFrom...Output as they are not used anymore.

Change-Id: I8ecedec2d71e60985402387982c64311c5a651e6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-06 06:58:44 +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
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
ac966d7bb9 IDevice: Provide default implementation for signalOperation()
Don't repeat implementation returning nullptr in derived classes.

Change-Id: I437f5d206464bf92706cd135d793438f46455ad6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-29 13:34:31 +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
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
Eike Ziller
b4caecae3e Ios: Fix compiler warnings
- avoid deprecated API
- remove unused variable

Change-Id: I33850ea2dda523900ead191542eadf65338d5210
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-13 09:01:55 +00:00
Alessandro Portale
30aec82285 Add missing "final" to unexported/unshared classes
Change-Id: I84d5fc39d7ef5588a20545854d0cfd0b993db090
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 15:40:29 +00:00
Eike Ziller
f4af71a3dd iOS Device: Show some more information in device options
Show iOS device name, identifier, OS version and cpu architecture.

Task-number: QTCREATORBUG-23016
Change-Id: I5fff2986a173800dabc585f17830cc242e436457
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-13 12:00:25 +00:00
Eike Ziller
72bf4cd15f iOS: Fix slow debugger startup on devices
We need to pass the path to the device symbols, that Xcode downloaded
for the device's OS version, as the sysroot to the debugger. Otherwise
debugger startup is very slow.

We already tried to do that, but it looks like, depending on the
devices, this path can contain an architecture specific part, e.g.
"iOS DeviceSupport/13.5.1 (17F80) arm64e" instead of just "iOS
DeviceSupport/13.5.1 (17F80)". It can still be just the latter, so we
get the devices architecture information, try the architecture specific
directory first, and fall back to the architecture agnostic name as
before if the former doesn't exist.

Fixes: QTCREATORBUG-21682
Change-Id: I2efdbfda0282f1cf0f8d10bd4e5217a298027fcf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-13 11:55:33 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
hjk
d08c0f31c4 De-Q_OBJECT-ify most DeviceFactories
WinRt is the odd one out.

Some were using setObjectName, but only used for debug reasons,
not really needed.

Change-Id: I4a370e4694443bc1c455fda4337ef3acfb9259b8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-23 13:32:12 +00:00
Eike Ziller
bd5dae90ad Merge remote-tracking branch 'origin/4.11'
Conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp

Change-Id: I5e424e34db619bb769c7abc1e8651b7b40210839
2020-01-20 09:59:27 +01:00
Eike Ziller
92a39e8d86 iOS: Fix retrieving USB serial number with macOS 10.15 SDK
When building without explicit compatibility with oder macOS versions
(-mmacosx-version-min), the Apple headers use a different value for the
constant that is used to retrieve the USB serial number, and that just
doesn't work for some reason.

Make sure we use a value for the constant that works in all cases.

Fixes: QTCREATORBUG-23460
Change-Id: Ie7de52a49a41c2ad33b2a6d2410414a9f1f05b1e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-16 09:41:42 +00:00
Alessandro Portale
9904464074 Make various Q_LOGGING_CATEGORY's static
Change-Id: I43d3a198b0863d85a7fb305c7cb768f68acbd139
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 14:54:10 +00:00
Eike Ziller
82d830e5d8 iOS: Guard against failure to retrieve device UID
It should not happen, but if it happens, Qt Creator should not crash.

Task-number: QTCREATORBUG-23460
Change-Id: Id25b53ff24d7e1726efc344dc6318c32073ee75c
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2020-01-15 08:20:10 +00:00
hjk
f187ddd590 iOS: Put common IosDevice constructor code into a function
It is not even clear that the remaining difference are needed.

Change-Id: Ic4418143242793d82a1f4c4c368af69a2e537078
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 13:51:56 +00:00
hjk
36d98d4af7 ProjectExplorer: Base IDevice::osType on a data member
Change-Id: I969563e6e62895a51fb4692c8eb0bab278f0ecae
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 07:44:45 +00:00
Christian Kandeler
45f9c178e1 ProjectExplorer::IDevice: Add a default display name
Task-number: QTCREATORBUG-16281
Change-Id: Ieff929343b5dc3a84d9ecf5f4f0a032cb4ae4076
Reviewed-by: hjk <hjk@qt.io>
2019-08-02 12:23:12 +00:00
hjk
e3b1106afa Compile fix with recent Qt dev
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.

Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-29 08:54:18 +00:00
hjk
f420788465 ProjectExplorer: Make Device::displayType a data member
Change-Id: If650f660e3b10bc28d575ded07a854f59be26f87
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-19 13:44:30 +00:00
hjk
a889669369 iOS: Use base IDevice::clone() instead of local toMap/fromMap
Some non-persistent data is handled in the base.

Change-Id: I5f6c5429b88178115bf26f885b80fa3daebf227e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 08:19:27 +00:00
Christian Kandeler
23a71e85bf Ios: Fix typo in device factory creation
Introduced in 0c2101d816, but only started to cause problems since
555360c1d4.

Fixes: QTCREATORBUG-22449
Change-Id: Id531d7cb94c80b762f7981cf3414348080d0d613
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-21 14:22:25 +00:00
hjk
555360c1d4 ProjectExplorer: Use the fromMap(toMap()) pattern to clone devices
Change-Id: Ie6e73f5ef1019907dd311aac116d71f08b5a5202
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-10 12:35:59 +00:00
hjk
15673b6eca iOS: Code cosmetics
Remove unused functions and declarations, brace style, empty lines, ...

Change-Id: I1afe90484879fa93bb1feaa25d12cd4794aa0234
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-25 07:49:50 +00:00
hjk
9e965409d1 Move IDeviceFactory closer to IDevice implementation
Except for the DesktopDevice, which is kind of special. Also try
a bit to make (and partially fail at doing so) naming and code
structure (#include, use of namespaces) more similar to each other.

Change-Id: I9fe266e706b72c14f59ff03ca1ae02dba3adcc71
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-21 13:20:16 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Eike Ziller
0345bcb7cc Help: Rename handleHelpRequest to showHelpUrl
Since that is what it does.

Change-Id: I13ffe21cdb625a0df1313f2ff09bf84196f08768
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-01-25 08:23:18 +00:00
hjk
3f3eb40417 ProjectExplorer: Introduce a setter for IDevice origin and id
They are not completely orthogonal, so use one function for
now.

This is the step towards streamlining the IDevice::ctor/create
lines of functions.

Change-Id: I1fe9144c45c7da0c9dcbda3bf424e976e0519cd6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-15 13:02:28 +00:00
hjk
09c1c170d2 ProjectExplorer: Use setter for IDevice::type
Second step towards streamlining the IDevice::ctor/create lines
of functions.

Change-Id: I8b0f2270a9f6545ff9419ef8cf44b456c2233223
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 15:45:00 +00:00
hjk
75bce4332d ProjectExplorer: Use setter for IDevice::machineType
First step towards streamlining the IDevice::ctor/create lines
of functions.

Change-Id: I44226f8a05902cadd40c8820ab67752070d186c0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 15:10:51 +00:00
hjk
a3c6d30b75 ProjectExplorer: Simplify IDevice extra device action setup
Function objects are easy nowadays.

Change-Id: Iec2b770b99d8f11b7a090fb3bd51af8aa60f6fe0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-14 12:55:51 +00:00
Alessandro Portale
39400381b3 iOS: Modernize
modernize-*

Change-Id: I64d2bb4320c9b444bc13e90099600628eac1f5a6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-13 15:44:34 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
hjk
7bc88000d9 ProjectExplorer: Introduce a Utils::OsType IDevice::osType() function
E.g. for easier construction of command lines in situations like

    if (isLocal())
        runnable.commandLineArguments = argumentString(Utils::HostOsInfo::hostOs());
    else
        runnable.commandLineArguments = argumentString(Utils::OsTypeLinux);

Change-Id: I5a35304e5d1b5a042952201f39f4134a5cd0ce24
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-06-28 15:49:56 +00:00
Alessandro Portale
a00ee753fe ProjectExplorer: Introduce IDeviceFactory::iconForId()
This adds the possibility to have an icon for a device type. Now,
a Kit can have a proper icon if just the device type but not device
is selected.

Change-Id: I2a382ffd5b46cbbf74cdd0b934b3d450d300bfff
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-11-30 13:55:38 +00:00
Alessandro Portale
ee6b19cb39 Themable, HighDpi Android/iOS device icons
Also used as option category icons

Change-Id: I40916ff4683554a3e7de7126d737286eba4a525f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-09-27 14:18:04 +00:00
Alessandro Portale
59b7601c58 ProjectExplorer: default icons for IDevice
Enable devices to define their default themable icon.

Kit icons are now by default the Desktopdevice icon,
overridable by the device icon of the kit's device,
in turn overridable by an icon file path.

KitManagerConfigWidget: The browse button for the Kit
icon gets a "reset" action.

Change-Id: I6328ba7d640393aee2c324c592e76b4d5430586a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-26 11:52:00 +00:00