Fix Windows CMake build errors

Lambda expressions with uncaptured constants were leading to errors,
and there were also some warnings about deprecated functions
(QFontMetrics::width and inet_ntoa).
This commit is contained in:
JosJuice
2020-05-02 19:01:11 +02:00
parent 47d1dec723
commit bf57abc0d5
4 changed files with 48 additions and 29 deletions

View File

@ -139,26 +139,26 @@ void VerifyWidget::Verify()
progress.GetRaw()->setMinimumDuration(500);
progress.GetRaw()->setWindowModality(Qt::WindowModal);
auto future =
std::async(std::launch::async,
[&verifier, &progress]() -> std::optional<DiscIO::VolumeVerifier::Result> {
progress.SetValue(0);
verifier.Start();
while (verifier.GetBytesProcessed() != verifier.GetTotalBytes())
{
progress.SetValue(static_cast<int>(verifier.GetBytesProcessed() / DIVISOR));
if (progress.WasCanceled())
return std::nullopt;
auto future = std::async(
std::launch::async,
[&verifier, &progress, DIVISOR]() -> std::optional<DiscIO::VolumeVerifier::Result> {
progress.SetValue(0);
verifier.Start();
while (verifier.GetBytesProcessed() != verifier.GetTotalBytes())
{
progress.SetValue(static_cast<int>(verifier.GetBytesProcessed() / DIVISOR));
if (progress.WasCanceled())
return std::nullopt;
verifier.Process();
}
verifier.Finish();
verifier.Process();
}
verifier.Finish();
const DiscIO::VolumeVerifier::Result result = verifier.GetResult();
progress.Reset();
const DiscIO::VolumeVerifier::Result result = verifier.GetResult();
progress.Reset();
return result;
});
return result;
});
progress.GetRaw()->exec();
std::optional<DiscIO::VolumeVerifier::Result> result = future.get();