As a drive-by, lower some timeouts from 2s into 1s.
Change-Id: I495ad20058b0f97b6cdd5271a390b779c66b4864
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The timeout is only used with runBlocking(), otherwise it's no-op.
Change-Id: I7d81e4a73c7182bd19c435c112a2d64c3f40ba2e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
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>
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>
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>
... 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>
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>
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>
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>
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>