Commit Graph

69 Commits

Author SHA1 Message Date
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
aed29ad8c3 Core: Remove #include <QMainWindow> from icore.h
Adapt users; also use dialogParent() instead of mainWindow() were
appropriate.

Change-Id: Ib60b118f05c986a70657446c5b2937074243bb5c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-22 14:11:46 +00:00
Eike Ziller
3ec87e37ee Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/todo/optionsdialog.cpp
	src/plugins/todo/todoprojectsettingswidget.cpp

Change-Id: I24ca90c2fc2cd707df901d42694df6d0e27d696d
2022-07-20 12:03:40 +02:00
Alessandro Portale
8ad4acdd30 Android: Don't quote log lines with path names
Change-Id: I70f23af46bd6c8318971b20727e4010889bdcebc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-07-17 11:11:45 +00:00
Eike Ziller
4adf6c833d Android: Don't show message boxes in non-GUI thread
Delay them to the GUI thread.

Task-number: QTCREATORBUG-27369
Change-Id: I2879de69ec1756ad55d3ae3aba8e233138bf3ed1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-14 10:45:41 +00:00
Artem Sokolovskii
bef1bd18f7 Android: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I2530688c44735bc4c69d57f9e8f392867be316f0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-05 11:00:36 +00:00
hjk
aa3bdcb427 Utils: Add a QString-based write to QtcProcess
Centralize some boiler plate and warn about best-guessed cases.

Keep the QByteArray based access as writeRaw()

Fixes: QTCREATORBUG-27445
Change-Id: I948d80fba78b36cf85cc73664175ab05eb7707d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-28 08:20:11 +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
35b654f69b AndroidAvdManager: Connect to QtcProcess::done() signal
Instead of connecting to finished() signal.
Simplify implementation a bit.

Change-Id: Icf000ab0a5b06e14e301daed33f7b0109315d9a5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-14 07:09:44 +00:00
Jarek Kobus
65f5fde2e6 AndroidAvdManager: Get rid of no-op call to QtcProcess::terminate()
Calling QtcProcess::terminate() is a task for implicit ProcessReaper.
Delete the process instead.

Change-Id: I92fe34a18e15ca95f6bab2b7932faeee8b92621d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-28 07:46:00 +00:00
Jarek Kobus
1b5c4504af Get rid of no-op calls to QtcProcess::kill()
Leave the work for implicit ProcessReaper.

Change-Id: Ie01c4e996fda18b7cee77851394174556c6f3857
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-03-24 08:53:59 +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
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
hjk
e2cb64471a Utils: Move QtcProcess constructor setup data to shared setup data
This includes replacing DeviceProcess terminal handling with base
member.

Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-11 17:33:48 +00:00
hjk
e64ce914f9 Utils/Ssh: Move SshRemoteProces::isRunning() to QtcProcess base
... and use it on a few places.

Change-Id: Id2cea709e355a46821a720e593740ac032888ced
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-12-06 13:44:23 +00:00
Jarek Kobus
17fbbf7cb9 Use QtcProcess in startAvdAsync()
Change-Id: I47d6522f944ffe95a047e22971e94bba4fc93e2a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-08 12:27:53 +00:00
Jarek Kobus
b729a6cee2 Use QtcProcess in createAvdCommand()
Change-Id: Ic90bb732814de11dbb17d43649f464fabd671d21
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-05 11:36:15 +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
1e765e5963 Android: add environment to removeAvd()
Valid for windows hosts, otherwise, the command might fail.

Change-Id: I3e759c74ea0a785fd226cda08f301f0cce17c9b7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-06 18:50:55 +00:00
Alessandro Portale
ebc6e1fc62 Android: Use Android tools environment for avdmanager call
Otherwise AVD creation fails (on Windows).

Change-Id: Iff11c2cd96c214b40b714b6b1248adede54da343
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-28 10:14:59 +00:00
Eike Ziller
0777b65db3 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	src/plugins/android/androidconfigurations.cpp

Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
2021-08-26 11:09:08 +02:00
Alessandro Portale
bf2088075d Android: Don't crash in AndroidAvdManager
cancelChecker is an optional parameter.

Change-Id: Ie47ae834a34f8ebf8c901e4dcaf7a9c3af5c0ce4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 09:21:20 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
e2cf0b52a7 Android: Don't check QtcProcess exit code
This is already baked into QtcProcess::Result.

Change-Id: I02b017c7d26b5c42ea4e00cea5c3b393274edfdc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-02 14:21:23 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
Assam Boudjelthia
1372dfdf7f Android: Fix multiple clang clazy warnings
Change-Id: I2ea6cebd16c09a8a4502f4719d99a9d85e5e7d02
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-01 08:11:56 +00:00
hjk
90ad902486 Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}
Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 13:01:51 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
Eike Ziller
c213b93aff Android: Make avd output parsing testable
And add some tests

Change-Id: Ife0e0c60f55251a1ac23215055ece8fb01478d59
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-10 09:47:04 +00:00
hjk
5813c7e8c2 Utils: Make SynchronousProcess use Utils::Environment for environments
Makes the interface more similar to QtcProcess.

Change-Id: I58e57d9fdb7c37eb0d2a5c5eef8643d6be97c3cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-05-05 12:14:31 +00:00
Alessandro Portale
670616c6f9 Android: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I1242a5c62a27b7b8f30bb7b43ff406eceb4135f7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-23 10:51:37 +00:00
Alessandro Portale
323f353c6c Android: Replace AVD partition-size spinbox with emulator args input
The android emulator supports many more command-line startup options
than "-partition-size". Let's allow the user to take advantage of the
full functionalty, by providing a free-text input field for the options.

A link to the online documentation is also provided.

As a side-effect, the issue that an overridden parition size can cause
the "Cold Boot: different AVD configuration" warning is solved by not
having -partition-size by default.

Task-number: QTCREATORBUG-24735
Change-Id: I41d7b826133708c7ff447c1e257f62368745dea1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-07 11:25:28 +00:00
Alessandro Portale
7b6d44a90a Android: Introduce constants for Android ABIs
Avoiding string duplication prevents typo-related runtime errors and
allows an IDE to use find symbol rather than plain text search.

Change-Id: I7fba7c7c5cf90c0b371efce3b575537b2708dd0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-26 05:49:49 +00:00
Assam Boudjelthia
f936e7c10d Android: rephrase few logs
Change-Id: If03a15c88caab210fd07c61312757317ea86af2f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 20:10:16 +00:00
Assam Boudjelthia
0cfb9e2bce Android: remove old android tool
Follows af7c218d95, the old android
tool is not useful anymore.

Change-Id: I126ecc24622f2e90465440c86b84cdfb30c103e1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 13:24:38 +00:00
Assam Boudjelthia
af7c218d95 Android: remove native sdk and avd manager buttons
The native SDK and AVD manager buttons are no longer useful, since the
original, visual Java-basd tool for managing SDK and AVDs were removed
from Google's offering. The replacement is a set of command line tools
and a visual tool within Android Studio, which can not directly be
launched from Qt Creator.

Qt Creator has it's UI on top of the command line tools.

Change-Id: If660d7f566c173f46d9b2a97c9204746d33270e6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-26 07:15:07 +00:00
Christian Kandeler
f4f9d9cdbb Android: Remove some unused variables
Change-Id: Id6d8f0735c410a331c406a3f3a094aac5f03f5a9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-04-23 09:20:17 +00:00
Assam Boudjelthia
2555f4b8dd Android: Fix UNINIT_CTOR and PASS_BY_VALUE issues
Change-Id: Ie77e69226769d9ea0440611f2f5985c5ec08beaa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-11 08:52:48 +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
Alessandro Portale
ae79b40561 Android: Fix AVD info parsing for renamed instances
Android Studio's AVD manager renames the AVD info file to match the
instance ID.

Task-number: QTCREATORBUG-23448
Change-Id: Id8ff0a53ae93b168c55442166072d14c5c84d2e0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-14 21:19:56 +00:00
Alessandro Portale
e25212e2c5 Android: Log various avdmanager invocations
... in order to to understand what Qt Creator does when creating,
deleting or launching AVDs.

Change-Id: Iebcc9273746ad89069870ee09dab67c127b10be9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-14 08:11:15 +00:00
Assam Boudjelthia
d4ce0b6cfe Android: Remove unnecessary block of code from AndroidDeviceInfoList
Task-number: QTCREATORBUG-23284
Change-Id: I006ed8b63e979b4e3b27035f3b6838870ea7a11b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-14 08:10:49 +00:00
Assam Boudjelthia
0df5d8c2e5 Android: Improve "Add new AVD" dialog
* Re-organize the implementation to create a new AVD
* Use SystemImage instead of SdKPlatform because now
an SdkPlatform can be installed partially with a SystemImage.
The current implementation does not consider the this case,
thus we end up with an uncomplete list of installed system images.
* Add Device definitions with categories (phone, tablet, tv, etc.)
to the creation process (check -d arg in avdmanager create avd).

Task-number: QTCREATORBUG-23284
Change-Id: Id02a71ad452fb423fa2781d06ef3fcf2afa328a9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-13 15:20:05 +00:00
Assam Boudjelthia
6a5b182706 Android: fix avdmanager parsing error for some new device types
Currently avdmanager tool can give an error
"Error: Google <device> no longer exists as a device", due to missing
definition for new devices in device.xml.

This change temporarily removes the tag "hw.device.manufacturer" to
parse successfully, then recover it back.

Task-number: QTCREATORBUG-23284
Change-Id: I9c6f4b432d7c5d16944c9b620c4a4ecda473d45a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-13 12:19:19 +00:00
Assam Boudjelthia
6d897c00f4 Android: Add more informative fields to AVD manager UI
Task-number: QTCREATORBUG-23284
Change-Id: Ic93de1c05731360b85925acd23bdca12edc56069
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-08 08:36:44 +00:00
Alessandro Portale
8e5b587b3d Android: Log invocations of avdmanager
Change-Id: I32e4fe3d837adcb6860247f45757187902566934
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-08 05:48:40 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +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