Index: sources/update/UiProtocol.h =================================================================== diff -u -r7cf31f6cfef97bb564a103c263821a3b722c8a2b -r8ed1ad9f8c2de2ea19dd455cf59b648061c0a998 --- sources/update/UiProtocol.h (.../UiProtocol.h) (revision 7cf31f6cfef97bb564a103c263821a3b722c8a2b) +++ sources/update/UiProtocol.h (.../UiProtocol.h) (revision 8ed1ad9f8c2de2ea19dd455cf59b648061c0a998) @@ -261,10 +261,14 @@ * \return True on started ok. */ void setup( - std::vector& targets) { + std::vector& targets) { std::lock_guard lockApi(_apiMutex); - _targets = targets; + // Copy. + + for (DataProvider_File* p : targets) { + _targets.emplace_back(DataProvider_File(*p)); + } // So UI threads can get transfer status asynchronously // once we start, save off the transfer max in number of files. @@ -273,6 +277,7 @@ // Copy the key info in. _desired = Complete; _lastState = None; + _state = Starting; } /*! @@ -283,9 +288,9 @@ // In theory this is fast, so "status" is about number of files copied. bool ok = true; - for (IDataProvider* p : _targets) { + for (IDataProvider& p : _targets) { if (_desired == Complete) { - ok = p->copyFile(); + ok = p.copyFile(); } else { break; @@ -300,7 +305,7 @@ } protected: - std::vector _targets; ///< File targets to copy. + std::vector _targets; ///< File targets to copy. }; } // namespace::SwUpdate