diff options
author | Jarek Kobus <[email protected]> | 2023-03-03 23:59:37 +0100 |
---|---|---|
committer | Jarek Kobus <[email protected]> | 2023-03-10 15:36:06 +0000 |
commit | 2f5aad0cdb56c0984dce1614ca55fc6fd58ed1db (patch) | |
tree | 2bc3535705174bbc9c324da85de41a113d1a7a56 /src/plugins/android/androiddevice.cpp | |
parent | c2d6501e640f8f68d1f1767f427435642a857de0 (diff) |
Android: Use QtConcurrent invocation for async run
Change-Id: I275af7c52197ecdb0c02e2e1039b37bd8c9bb1c1
Reviewed-by: Alessandro Portale <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: <[email protected]>
Diffstat (limited to 'src/plugins/android/androiddevice.cpp')
-rw-r--r-- | src/plugins/android/androiddevice.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/android/androiddevice.cpp b/src/plugins/android/androiddevice.cpp index 1902631fd6b..be5f3071242 100644 --- a/src/plugins/android/androiddevice.cpp +++ b/src/plugins/android/androiddevice.cpp @@ -21,9 +21,9 @@ #include <projectexplorer/projectmanager.h> #include <projectexplorer/target.h> +#include <utils/asynctask.h> #include <utils/qtcassert.h> #include <utils/qtcprocess.h> -#include <utils/runextensions.h> #include <utils/url.h> #include <QEventLoop> @@ -454,7 +454,7 @@ void AndroidDeviceManager::startAvd(const ProjectExplorer::IDevice::Ptr &device, const AndroidDevice *androidDev = static_cast<const AndroidDevice *>(device.data()); const QString name = androidDev->avdName(); qCDebug(androidDeviceLog, "Starting Android AVD id \"%s\".", qPrintable(name)); - runAsync([this, name, device] { + auto future = Utils::asyncRun([this, name, device] { const QString serialNumber = m_avdManager.startAvd(name); // Mark the AVD as ReadyToUse once we know it's started if (!serialNumber.isEmpty()) { @@ -462,6 +462,7 @@ void AndroidDeviceManager::startAvd(const ProjectExplorer::IDevice::Ptr &device, devMgr->setDeviceState(device->id(), IDevice::DeviceReadyToUse); } }); + // TODO: use future! } void AndroidDeviceManager::eraseAvd(const IDevice::Ptr &device, QWidget *parent) @@ -479,7 +480,7 @@ void AndroidDeviceManager::eraseAvd(const IDevice::Ptr &device, QWidget *parent) return; qCDebug(androidDeviceLog) << QString("Erasing Android AVD \"%1\" from the system.").arg(name); - m_removeAvdFutureWatcher.setFuture(runAsync([this, name, device] { + m_removeAvdFutureWatcher.setFuture(Utils::asyncRun([this, name, device] { QPair<IDevice::ConstPtr, bool> pair; pair.first = device; pair.second = false; |