forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -30,10 +30,10 @@
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asynctask.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/runextensions.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QFileDialog>
|
||||
@@ -401,16 +401,16 @@ void AndroidDeployQtStep::slotAskForUninstall(DeployErrorCode errorCode)
|
||||
m_askForUninstall = button == QMessageBox::Yes;
|
||||
}
|
||||
|
||||
void AndroidDeployQtStep::runImpl(QFutureInterface<bool> &fi)
|
||||
void AndroidDeployQtStep::runImpl(QPromise<bool> &promise)
|
||||
{
|
||||
if (!m_avdName.isEmpty()) {
|
||||
const QString serialNumber = AndroidAvdManager().waitForAvd(m_avdName,
|
||||
QFuture<void>(fi.future()));
|
||||
QFuture<void>(promise.future()));
|
||||
qCDebug(deployStepLog) << "Deploying to AVD:" << m_avdName << serialNumber;
|
||||
if (serialNumber.isEmpty()) {
|
||||
reportWarningOrError(Tr::tr("The deployment AVD \"%1\" cannot be started.")
|
||||
.arg(m_avdName), Task::Error);
|
||||
fi.reportResult(false);
|
||||
promise.addResult(false);
|
||||
return;
|
||||
}
|
||||
m_serialNumber = serialNumber;
|
||||
@@ -446,7 +446,7 @@ void AndroidDeployQtStep::runImpl(QFutureInterface<bool> &fi)
|
||||
reportWarningOrError(error, Task::Error);
|
||||
}
|
||||
}
|
||||
fi.reportResult(returnValue == NoError);
|
||||
promise.addResult(returnValue == NoError);
|
||||
}
|
||||
|
||||
void AndroidDeployQtStep::gatherFilesToPull()
|
||||
@@ -486,7 +486,7 @@ void AndroidDeployQtStep::doRun()
|
||||
emit finished(success);
|
||||
watcher->deleteLater();
|
||||
});
|
||||
auto future = Utils::runAsync(&AndroidDeployQtStep::runImpl, this);
|
||||
auto future = Utils::asyncRun(&AndroidDeployQtStep::runImpl, this);
|
||||
watcher->setFuture(future);
|
||||
m_synchronizer.addFuture(future);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user