ios: Remove foreach / Q_FOREACH usage

Task-number: QTCREATORBUG-27464
Change-Id: If29d2960692c42456967025d60e6d6d7ddd09928
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-05-31 16:21:46 +02:00
parent 37bf11550e
commit 1241761035
9 changed files with 34 additions and 26 deletions

View File

@@ -54,13 +54,14 @@ SimulatorOperationDialog::SimulatorOperationDialog(QWidget *parent) :
SimulatorOperationDialog::~SimulatorOperationDialog()
{
// Cancel all pending futures.
foreach (auto watcher, m_futureWatchList) {
const auto futureWatchList = m_futureWatchList;
for (auto watcher : futureWatchList) {
if (!watcher->isFinished())
watcher->cancel();
}
// wait for futures to finish
foreach (auto watcher, m_futureWatchList) {
for (auto watcher : futureWatchList) {
if (!watcher->isFinished())
watcher->waitForFinished();
delete watcher;
@@ -72,7 +73,7 @@ SimulatorOperationDialog::~SimulatorOperationDialog()
void SimulatorOperationDialog::addFutures(const QList<QFuture<void> > &futureList)
{
foreach (auto future, futureList) {
for (auto future : futureList) {
if (!future.isFinished() || !future.isCanceled()) {
auto watcher = new QFutureWatcher<void>;
connect(watcher, &QFutureWatcher<void>::finished,