forked from qt-creator/qt-creator
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:
@@ -76,8 +76,11 @@ void SimulatorOperationDialog::addFutures(const QList<QFuture<void> > &futureLis
|
||||
for (auto future : futureList) {
|
||||
if (!future.isFinished() || !future.isCanceled()) {
|
||||
auto watcher = new QFutureWatcher<void>;
|
||||
connect(watcher, &QFutureWatcher<void>::finished,
|
||||
this, &SimulatorOperationDialog::futureFinished);
|
||||
connect(watcher, &QFutureWatcherBase::finished, this, [this, watcher] {
|
||||
m_futureWatchList.removeAll(watcher);
|
||||
watcher->deleteLater();
|
||||
updateInputs();
|
||||
});
|
||||
watcher->setFuture(future);
|
||||
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()
|
||||
{
|
||||
bool enableOk = m_futureWatchList.isEmpty();
|
||||
|
@@ -54,7 +54,6 @@ public:
|
||||
const QString &context);
|
||||
|
||||
private:
|
||||
void futureFinished();
|
||||
void updateInputs();
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user