progress_dialog fixes

This commit is contained in:
Megamouse 2021-04-06 18:43:10 +02:00 committed by Ivan
parent 5ddb1d6649
commit 497fbb17a8
1 changed files with 13 additions and 13 deletions

View File

@ -425,19 +425,6 @@ namespace
{
const auto text_new = g_progr.load();
if (!text_new)
{
// Close dialog
break;
}
if (skip_this_one)
{
// Do nothing
std::this_thread::sleep_for(10ms);
continue;
}
const u32 ftotal_new = g_progr_ftotal;
const u32 fdone_new = g_progr_fdone;
const u32 ptotal_new = g_progr_ptotal;
@ -451,6 +438,19 @@ namespace
pdone = pdone_new;
text1 = text_new;
if (!text_new)
{
// Close dialog
break;
}
if (skip_this_one)
{
// Do nothing
std::this_thread::sleep_for(10ms);
continue;
}
// Compute new progress in percents
// Assume not all programs were found if files were not compiled (as it may contain more)
const u64 total = std::max<u64>(ptotal, 1) * std::max<u64>(ftotal, 1);