SimulatorOperationDialog: Avoid using sender()

Change-Id: Ib45839bfa7b5e62a9546643a4a94c975884ce8cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-07-20 14:03:13 +02:00
parent 2da897f60b
commit aabf9e4fef
2 changed files with 5 additions and 11 deletions

View File

@@ -76,8 +76,11 @@ void SimulatorOperationDialog::addFutures(const QList<QFuture<void> > &futureLis
for (auto future : futureList) { for (auto future : futureList) {
if (!future.isFinished() || !future.isCanceled()) { if (!future.isFinished() || !future.isCanceled()) {
auto watcher = new QFutureWatcher<void>; auto watcher = new QFutureWatcher<void>;
connect(watcher, &QFutureWatcher<void>::finished, connect(watcher, &QFutureWatcherBase::finished, this, [this, watcher] {
this, &SimulatorOperationDialog::futureFinished); m_futureWatchList.removeAll(watcher);
watcher->deleteLater();
updateInputs();
});
watcher->setFuture(future); watcher->setFuture(future);
m_futureWatchList << watcher; m_futureWatchList << watcher;
} }
@@ -108,14 +111,6 @@ void SimulatorOperationDialog::addMessage(const SimulatorInfo &siminfo,
} }
} }
void SimulatorOperationDialog::futureFinished()
{
auto watcher = static_cast<QFutureWatcher<void> *>(sender());
m_futureWatchList.removeAll(watcher);
watcher->deleteLater();
updateInputs();
}
void SimulatorOperationDialog::updateInputs() void SimulatorOperationDialog::updateInputs()
{ {
bool enableOk = m_futureWatchList.isEmpty(); bool enableOk = m_futureWatchList.isEmpty();

View File

@@ -54,7 +54,6 @@ public:
const QString &context); const QString &context);
private: private:
void futureFinished();
void updateInputs(); void updateInputs();
private: private: