Commit Graph

107 Commits

Author SHA1 Message Date
Jarek Kobus
72d9decb87 QEventLoop: Remove unused includes
Change-Id: Ic278aa9b204a3caa17e38125d07a0176a8281422
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-15 10:35:29 +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
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
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>
2023-05-04 05:52:16 +00:00
Jarek Kobus
a3a5b8f806 Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}
Follows AsyncTask -> Async rename.

Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225
Reviewed-by: hjk <hjk@qt.io>
2023-05-03 13:24:20 +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
Eike Ziller
b36287731e Merge remote-tracking branch 'origin/10.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp
	src/tools/perfparser

Change-Id: Ie5643100e0eb00e0933359dce320169b876f5634
2023-03-29 12:21:50 +02:00
Alessandro Portale
f7639f458a Android: Launch "adb track-devices" with explicit working directory
Since no working directory was explicitly set, the "bin/" directory of
QtC was chosen as working directory.

"adb track-devices" leaves the server process alive after terminating,
and that server process used QtC's working directory. On Windows, that
caused that directory to be undeletable/unmovable as long as the adb
server was alive.

This change sets the working directory of "adb track-devices" to the
parent dir of the adb binary.

Task-number: QTCREATORBUG-28932
Change-Id: I3adf52829c9f4bf456d05d2685c04314e1d25a40
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-03-24 13:50:14 +00:00
hjk
5996e58ffa ProjectExplorer: Allow Devices to be added without using the wizard
This re-organizes the buttons on the main device page a bit: The
topmost one still starts the wizard selection, below that are direct
individual buttons to add specific devices.

Change-Id: I52b2803febf658259dde9589544656fd4c8fc889
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-24 13:20:19 +00:00
Jarek Kobus
2f5aad0cdb Android: Use QtConcurrent invocation for async run
Change-Id: I275af7c52197ecdb0c02e2e1039b37bd8c9bb1c1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-10 15:36:06 +00:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
hjk
d57dd8462e Android: Use better filepath conversion for AvdPath
This is internal data, so to/fromVariant should do. However, the
device extra data is stored in settings, so stay on the safe side.

Change-Id: I2a673d4dc07b45d1b7b829796ad57540a5e49c20
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-25 07:04:52 +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
0d74be319a Android: Pass context object to lambda connections
Remove some unneeded lambda () brackets.

Change-Id: Id00e2bc736683bb844cc7ba936ac9d21aa204416
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-07 16:30:13 +00:00
Marcus Tillmanns
bb3e9c44be Android: Fix reference to out of scope variable
Change-Id: I49ea5c059ed68230e368d8de2aaddca979019bfa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-08 11:37:26 +00:00
Leena Miettinen
7c9d1ef516 UI text: Fix UI text to follow the guidelines
- Fix typos
- Replace "options" with "preferences"
- Fix capitalization
- Remove "please"
- Do not use contractions

Task-number: QTCREATORBUG-28334
Change-Id: Ie029eae435634aa2fb354e173fa107af72f7b025
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-20 07:38:32 +00:00
Alessandro Portale
5c65115271 Android: Convert to using Tr::tr
Change-Id: Ie9110093101b0f49808b4da7b13ac3f47c3bb994
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 10:24:32 +00:00
Eike Ziller
55c627efef Android: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I159fb6928954240af742708efbd6776104c4631b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-29 09:12:37 +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
072489829d Utils: Make port.h slimmer
Fix the fallout. Also make comparisons hidden friends.

Change-Id: Ib16a294391f5732f94f9f411a48220b497691de2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-27 12:07:59 +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
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
4297b9f289 Android: Avoid one use of ProcessArgs::splitArgs()
Replaced by the more harmless joinArgs in a compatibility settings
code path for now.

Change-Id: Id6d94faea26002f4a2641b5824d97e09a783b720
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-22 14:21:09 +00:00
Jarek Kobus
097b862712 AndroidDeviceManager: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals.
Make some cleanup in usages of Utils:: namespace.

Change-Id: I5d784d1938d6aac1dd760c663b60c23378318096
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-06 15:48:15 +00:00
Jarek Kobus
9f3941cda3 AndroidDeviceManager: Remove the instance from plugin destructor
Delete the AndroidDeviceManager instance on shutdown from inside
android plugin destructor.

Implement AndroidDeviceManager destructor and wait for
futures currently running to finish. Don't do any special
handling for possibly still running m_adbDeviceWatcherProcess,
as it will be deleted automatically by the std::unique_ptr
and this will automatically initiate a proper termination of the
process running.

Change-Id: I5aad6f4fcfca23a0a37c3709efcdffad43a88203
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-28 11:54:51 +00:00
Assam Boudjelthia
20c0d93f7d Android: add option to connect physical device over wifi
Android's ADB allows connections over wifi, firstly, a port needs
to be opened from the device, then adb commands can be used to
connect the host to the device over an ip and port. Afer that,
a device can be disconnected from USB and the wifi connection
could be used to do all jobs that were done over USB.

The setup operation require the device to be connected via USB.
This can replace the manual process of dealing with ADB commands
to prepare the connection.

The "Setup Wifi" action is only added to Hardware USB devices,
and not AVDs nor physical devices that are already connected over
WiFi.

Change-Id: I37897a528b45cdeee2764071ec45ec1b3316cdbb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-25 09:23:12 +00:00
Jarek Kobus
2d33425cd5 Revert "Android: Make the device watcher process terminate on shutdown"
This reverts commit e45e16d904.

Reason for revert: This one should look different in master

Change-Id: I4fbf3a9d046e5fe5a6a45d5ba93b685f5967498c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-03-18 08:13:25 +00:00
Eike Ziller
e914f42458 Merge remote-tracking branch 'origin/7.0'
Change-Id: I9c4ef46084fd392663c7c21c4ecdbc578ea28577
2022-03-18 08:42:02 +01:00
Alessandro Portale
e45e16d904 Android: Make the device watcher process terminate on shutdown
Terminate on IPlugin::aboutToShutdown instead of
QCoreApplication::aboutToQuit. If needed synchronously.

Added "ADB device watcher started" logging.

Fixes: QTCREATORBUG-27118
Change-Id: I483659b018c74d179b64a5a4f17cc2c27c9598a8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-03-17 15:12:55 +00:00
Eike Ziller
9fd2a059f6 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/android/androiddevice.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: Id16ba0d9993c9f608242622aceae0a2a6691e05e
2022-03-17 08:48:28 +01:00
Alessandro Portale
c170e4fa57 Android: Use const & in a range-based for loop
Change-Id: Ib769d5133383ed30717e479107b6a74c53b72a58
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-16 18:33:25 +00:00
Assam Boudjelthia
a141d56991 Android: Don't call getDeviceState() on empty serial number
Avoid calling getDeviceState() if the serial is empty, which
won't give any useful info for emulators. This will avoid
multiple state checks at QC start as well.

Also, set the default new AndroidDevice state as Disconnected,
which reflects better the state of an empty newsly constructed
device which we don't know the state of.

Change-Id: I854e95e28b150f09c3eff6b8a75b2df6bd4aa1ce
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-15 09:03:49 +00:00
Assam Boudjelthia
851171f772 Android: rename avdname to avdName in AndroidDeviceInfo
Change-Id: I9f4743b0d9f953f1fa407acfea41345571cb9998
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-14 17:48:31 +00:00
Assam Boudjelthia
e5ce9e9e76 Android: Get rid of the avd info fields in AndroidDeviceInfo
The AVD specific fields don't need to be carried out by QtC settings,
these can be read from the AVD's config file when they are needed.

This also is good because those values can change at any time,
either manually or by some other IDE like Android Studio, and thus
we don't really need to manage them ourselves.

The fields in question are: skin name, target name, sdcard size,
openGL status.

Change-Id: I86163500ec2fed035e32ec02ed17e182778db4a7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-14 17:47:55 +00:00
Assam Boudjelthia
0586418f83 Android: Differentiate between same devices connected via usb and wifi
ADB allows connecting the same device via USB or WiFi, so we need
to make sure the name of the wifi which appears as a different device,
make sure it does mean something instead of "Name2" as proposed by
default by QC. So this adds the term wifi to the name to make it clear.

Change-Id: I5923ca2430c8b51ae2525744dcc1f803ab976b35
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-23 17:21:36 +00:00
Eike Ziller
fff5944e65 Fix lupdate issues
When updating translations with
cmake --build . --target ts_de
(or other language ID)

- Qualifying with unknown namespace/class ::PluginSpecPrivate
- <class> lacks Q_OBJECT macro

Change-Id: Ic42d8dffea935e6b10e59223bdedb9a8a4dcf446
Reviewed-by: hjk <hjk@qt.io>
2022-02-23 16:53:00 +00:00
Christian Kandeler
52e26a360b Fix newly introduced warnings
Change-Id: I0b9cf3496d536e1173fbd6587e5b491305eb876c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-23 15:26:31 +00:00
Alessandro Portale
477ebd3b61 Android: Fix crash on exit
m_adbDeviceWatcherProcess can be 0 if Android is not set up.

Amends: c43ba1ae32

Change-Id: I90aef197c098f279a6bd3adb0485df74b8be1961
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-23 09:03:16 +00:00
Assam Boudjelthia
c43ba1ae32 Monitor Android devices in non-polling method
Use ADB's track-devices command to watch for device
events which would replace the current polling method
with a timer. For AVDs, a QFileSystemWatcher is used
to watch for changes in the AVDs home folder which
would allow updating the AVDs only when a change is done
like edition, deletion, start, stop, even from outside
Qt Creator.

This method would also make device updates faster,
instead of unexpected waits due to timer use.

Task-number: QTCREATORBUG-23991
Change-Id: I08a92252c99c02bc111e597d671f2350817458c7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-22 21:21:53 +00:00
hjk
75ef67615d ProjectExplorer: Remove IDeviceFactory::setCanCreate
That's implicit now by using setCreator()

The Android case looks odd as this is (and was) effectively static
information at startup. This will be addressed in a follow-up patch,
for now keep it functionally equivalent.

Change-Id: I4e6082f88dcd21379186340189acb581caef172a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-02-04 12:10:07 +00:00
hjk
2b6f26dee2 ProjectExplorer: Use a lambda for DeviceFactory::create()
Somewhat slimmer interface on the user code side and follows
existing practice.

Change-Id: I20ed8f5a00591265d32ea9ce93e1f1bbc76d2437
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-26 14:51:09 +00:00
Alessandro Portale
9c7b1d39d3 Android: Fix compatibility check in AndroidDevice::canSupportAbis
A typo prevented to check whether a non-armeabi device supports running
armeabi applications.

Change-Id: Ibfdf76f69c1bdf5f4dc1ba73147328a8f7f6ae3f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-01-15 12:08:18 +00:00
Alessandro Portale
1e693bcc67 Android: Skip device list update no Android Kit is active
This adds workaround to reduce the load added by the update of the
Android device list, which currently happens in a polling style. Skip
an update if (*):
- The current open project is configured with a non-Android kit
- No project is open
- the current project target is null

To summarize the timeline of the timer used here:
- AndroidDeviceManager::setupDevicesWatcher() is called when Creator
is started or when settings are changed. The setup makes the connections
for the timeout and for AVD list future watcher. This will be done once.
If the timer is active it won't be done again, so no duplicate
connections.
- In the setup, the list of devices in updated once.
- On timer timeout, we attempt to update the list, however with
conditions listed in (*) as well as only when an Android adb path is
found.

Fixes: QTCREATORBUG-26547
Change-Id: I13312c4b507ce4e4064adb1c1342f4648f915394
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-11 22:31:46 +00:00
Assam Boudjelthia
0079b64b69 Android: don't recreate a new AvdManger
Change-Id: Icc4f2bb2df34aa3497441d6fbd64c6c8fe1394b3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-09 13:16:48 +00:00
Eike Ziller
1a00bb50d4 Android: Fix lupdate issues
Change-Id: I08bdc81eabb082a091f27d2dea44369573946c49
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-10-28 09:41:08 +00:00
Assam Boudjelthia
d5a3435798 Android: drop const from AndroidConfigurations::currentConfig()
Since the config can be expected to modify configuration values
(e.g. setEmulatorArgs()) it shouldn't be const, but can be set
to const whenever creating a reference that is not meant for
modifying the config.

Change-Id: I8c816a5422d4d57afa158c723d908e3a9a9a0db8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-26 18:34:58 +00:00
Assam Boudjelthia
f4db436a7b Android: remove Virtual from the AndroidDeviceFactory
Keep it only Android Device since this title is used in many places
around Qt Creator in different contexts it is better to make it
"Android Device" to not give any unintentional hint that only virtual
devices are covered. Such cases are the project creation wizard and the
kit target device settings.

Task-number: QTCREATORBUG-26477
Change-Id: I8c7224243aec6b8f5b5bf95db8d23b9aecbafca6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 10:31:18 +00:00
Assam Boudjelthia
43f759a6b0 Android: remove unauthorized field form AndroidDeviceInfo
This is not really needed anymore, it was mainly used for physical
devices to report whether they need user authorization to be used
via adb. This is now handled by IDevice::DeviceState, where a
Connected device is unauthorized, otherwise any physical device is
ReadyToUse if authorization is good.

Change-Id: If5c1e49b98063eabe4205cd8adb5b11515e1e1de
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 09:22:08 +00:00
Assam Boudjelthia
ec55b1a483 Android: remove AndroidDeviceType and State from AndroidDeviceInfo
No need to have these enums which are now only a duplication of
IDevice::MachineType and IDevice::DeviceState.

Change-Id: Icc3f112f2670c7354bb282b36fad0f0631b9e047
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-25 09:21:37 +00:00
Assam Boudjelthia
affe3ccf51 Android: Make refresh action device specific
Change-Id: I18386ad88e04696068f5f127cadb7ffcc6f25a56
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-25 09:21:22 +00:00
Assam Boudjelthia
6e4d829a40 Android: handle return correct serialNumber for a running avd
AVDs don't get a serial number until they are started, and avdmanager
don't make it easy to get their serial either, so we need to check
the running devices with adb "emu avd name" command and compare.

Change-Id: I3253d25a3461a36eb9918b3c796062bf9e82e0c6
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 14:58:27 +00:00