Commit Graph

141 Commits

Author SHA1 Message Date
hjk
f49523029a Remove #include <utils/fileutils.h> from most header files
It has some platform specific warts, filepath.h is somewhat
cheaper and less ugly overall.

Partially clean up surroundings

Change-Id: Ida1fd470ec020f69c446109427f92a08e879789f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-07-26 10:41:16 +00:00
hjk
87280f25ce Utils: Use more views in Id setup
Since this means that StringBuilder expressions are not usable
as arguments anymore, use .withSuffix() more extensively.

This makes this "unusual" construction also a bit better findable.

No measurable performance gain or loss in either direction.

Change-Id: I04508e77764455bd9d3a21eda63bc6de01508e4b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-26 08:00:00 +00:00
Jarek Kobus
2d480f45da Android: Use task tree for startAvd() action
As a drive-by, lower some timeouts from 2s into 1s.

Change-Id: I495ad20058b0f97b6cdd5271a390b779c66b4864
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-10 16:14:20 +00:00
Jarek Kobus
779390829c TaskTree: Introduce For element
Improve code readability by requiring iteratable Group
to be named For.

The For's c'tor requires an iterator element as a first arg.

The For's c'tor allows for passing exactly one iterator element.

It's not possible to place iterators inside Group element anymore.

Change-Id: I9dfe2c0da058abac161f66c4e336da2417c383f1
Reviewed-by: hjk <hjk@qt.io>
2024-07-10 13:39:40 +00:00
Jarek Kobus
057a54364d Android: Synchronize startAvd()'s future
This change fixes a possible deadlock on Creator shutdown
after clicking "Start AVD" button from the Android device
settings dialog, and quickly closing the started emulator
window, the settings dialog and Creator (within 2 seconds).

In case of no synchronization we may be starting
new processes in separate thread after the QApplication
has already been destroyed. Blocking run of processes
requires constructing an event loop, which ends up with
the following warnings (and a deadlock):
"QEventLoop: Cannot be used without QApplication"
"QObject::setParent: Cannot set parent,
 new parent is in a different thread".

Add returned future to the global future synchronizer.
Avoid long synchronization of startAvd() on shutdown
by adding an optional future argument to the startAvd() and
pass it to the waitForAvd(). Otherwise, we would need to wait
up to 2 minutes for synchronization to finish.

Change-Id: Ia1d71d309cb2dcdb5e31decfdfdea6df9a117ed5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-02 13:55:57 +00:00
Jarek Kobus
99acc4440a Android: Provide more info when createAvd failed
Fixes: QTCREATORBUG-30852
Change-Id: I9334a25c6e15a615dbf52736c9369821ba0ff8b9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-24 05:49:24 +00:00
Jarek Kobus
c40dceced7 Android: Introduce devicesCommandOutput() helper and reuse it
Change-Id: I098aa17328efcf66a3fb80416e65a2f82d190edc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 15:42:59 +00:00
Jarek Kobus
f450610a6f Android: Transform AndroidDeviceManager into namespace
Change-Id: I92f5ea325dfcb2a11b0fde14b797c5d40bf47d0b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 15:38:37 +00:00
Jarek Kobus
ccd6872608 Android: Hide AndroidDeviceManager methods in cpp
Change-Id: I871b1126d36367b3716ed988f581a8b5bca68693
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 15:38:28 +00:00
Jarek Kobus
4ca1edc080 Android: Avoid using connectedDevices() in getRunningAvdsSerialNumber()
The connectedDevices() constructs the full list of
AndroidDeviceInfo with details not needed by
getRunningAvdsSerialNumber(). These details were generated by
using 2 excessive process runs. Get rid of them, and deliver
result as soon as the matching device if found.

Change-Id: Idc3d9d3321e471f8eaa0d69287f5e748813fc427
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 15:38:08 +00:00
Jarek Kobus
c9fac8ca2e Android: Transform AndroidConfig into namespace
Change-Id: I1926758f3dcaffb4de11a85c0873eec7bd2d223c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-28 22:18:12 +00:00
Jarek Kobus
2e7da60b6c Android: Use more AndroidConfig specifiers for static method calls
There is no need to operate on AndroidConfig instance.

Change-Id: Ie58f8e5aca8214efe0bb857b3d62a137f42a918c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-23 14:23:31 +00:00
Jarek Kobus
22435ba7fb Android: Hide displayNameFromInfo() in cpp
Change-Id: Iaec548c4b2b56c7515ccf945234f4f59367b006b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-23 14:11:33 +00:00
Jarek Kobus
af3ab760ad Android: Transform AndroidAvdManager class into namespace
Hide waitForBooted() in cpp.
Move avdManagerCommand() into avddialog.cpp, as it's the only
one usage of this method.

Change-Id: Id88ecbb5532a7d2594c65dddc8245573efd41018
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-23 12:52:54 +00:00
Jarek Kobus
f0eeb67975 Android: Employ TaskTree for running avdList command
Run the command from the caller thread.

Change-Id: I710c41c6da93e27d79c351e1dc5e7f9f01d6cc51
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-23 05:46:36 +00:00
Jarek Kobus
982ad24243 CommandLine: Reuse new c'tor
Change-Id: Id154881b4f5d8c488e5c1f5e0f843d36bf838759
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-22 09:13:41 +00:00
Jarek Kobus
60f4822d5f Android: Supply newly created device with path
Otherwise, the newly created device is going to be removed
and recreated on subsequent HandleAvdsListChange()
causing flickering of the devices combobox in settings.

Change-Id: Idcf58f24eb7f4d4200881cfa912d0866f54d362a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-21 08:58:54 +00:00
Jarek Kobus
1ddcd8ad70 Android: Add locking mechanism when creating avd
Lock avd file system watcher changes when executing create avd command.
Otherwise the avd file system watcher sends notifications during
create avd command execution and subsequent avd list command
doesn't report the device which is being added, yet.

Change-Id: I1a0123d1bf14cf76e3a90e7f19416eb634e9c4a6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-16 13:39:07 +00:00
Jarek Kobus
bee7cdfd1e Android: Add AndroidDeviceManager::createAvd()
The createAvd() command is going to turn off the
avd file system watcher during execution, so this needs to be
a part of AndroidDeviceManager.

Change-Id: Ic8038be53d2be34136649b6b8a44435a4fc87a9f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-16 09:56:06 +00:00
Jarek Kobus
3fc5551465 Android: Use QList instead of QVector
Change-Id: If4e163716e8ad5eac782d4b023dcb88fca0f8414
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-24 17:24:50 +00:00
Alessandro Portale
19feaad265 Android: Register AndroidDevice creator regardless of SDK state
The AndroidDeviceFactory only registered the AndroidDevice creator
function if the Android SDK was correctly set up. That check occurred
only once during the Qt Creator start up sequence.

As a consequence, Qt Creator had to be restarted after an initial set up
of the Android SDK. Users are not notified of such requirement, and we
actually don't want to enforce a restart.

With this change, the AndroidDevice creator function is always
registered, and the "Add Android Device" wizard always selectable. Users
who try to add an Android device without having set up Android before
get to see an info message box.

Change-Id: I0600e36575c2dd075af9398597c3c8dab3bb243d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-03-06 15:28:53 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
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>
2024-02-28 08:09:05 +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
hjk
d89bb4ef1e Android: Remove two now unneded lambda captures
Change-Id: I46647daf2a0edbb4cb1b062989631b83dd5b42c5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-02-01 17:32:23 +00:00
hjk
2beaba4627 Android: Use more direct access to current config singleton
Change-Id: Ica5ba556ac022fe39ed4439d023cda1742344eed
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-24 13:41:13 +00:00
Jarek Kobus
7fc991ac8e Process: Remove no-op calls to setTimeoutS()
The timeout is only used with runBlocking(), otherwise it's no-op.

Change-Id: I7d81e4a73c7182bd19c435c112a2d64c3f40ba2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 10:14:07 +00:00
hjk
9b2cbe9b71 Android: New setup for AndroidDeviceManager
Also remove the now-unneeded plugin pimpl.

Change-Id: I37eaa91a2756e823d07323b54695e19860cb16ab
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-24 10:26:01 +00:00
hjk
353c3cc930 Android: Use new setup for more plugin items
Change-Id: Id5ff09813ab7b4be425d007abd4cc04d9c9472c1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-24 10:25:51 +00:00
Jarek Kobus
fbe23282fc AndroidDeviceManager: Execute avd removal in main thread
Instead of executing it blocking in a separate thread.

Change-Id: I0d847f22917edc9782467f173728c13287844acb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-06 15:27:28 +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
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
68c3103f76 Android: Use a more direct access to the tools' path
Change-Id: I49c574144fd4d6b2edd829538c424465c1fe7f05
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-07-27 13:03:41 +00:00
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