Commit Graph

2 Commits

Author SHA1 Message Date
Jarek Kobus
69b3c6c1fd Use Utils::FutureSynchronizer in IosSimulatorToolHandlerPrivate
Add a new method: void FutureSynchronizer::cancelAllFutures().

Change-Id: I5a4e1ea3230ac3c0ce9d3f26b751b2c05fe3dfd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 10:13:11 +00:00
Jarek Kobus
c4236da9d1 Introduce Utils::FutureSynchronizer
The API is nearly the same as QFutureSynchronizer.

The differences are:
1. We don't make this class a template class, however,
   we are leaving some template methods, like addFuture().
   For the scope of future synchronizing there is no need
   for QFuture<T> API, the QFuture<void> is sufficient.
2. Renamed cancelOnWait() getter to isCancelOnWait()
   in order to conform more to Qt API naming rules.
3. Removed futures() getter and provided isEmpty() instead.
4. Removed c'tor that takes a future and setFuture().
   These 2 methods were superfluous and may easily be
   substituted with other methods from the existing API.

The additional feature is about flushing finished futures.
This can be done on demand by a call to flushFinishedFutures(),
or is done automatically on every call to addFuture().

Change-Id: I6a323c9481eeeea9235e6b6e3048cef02873da08
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-12 11:06:42 +00:00