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) {
|
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();
|
||||||
|
@@ -54,7 +54,6 @@ public:
|
|||||||
const QString &context);
|
const QString &context);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void futureFinished();
|
|
||||||
void updateInputs();
|
void updateInputs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user