Qt: Fix scan percent dropping back to 0% at end

This commit is contained in:
Stenzek 2024-07-19 14:56:24 +10:00
parent 6176a21ff1
commit a6cf320776
No known key found for this signature in database
2 changed files with 20 additions and 0 deletions

View File

@ -22,6 +22,23 @@ void AsyncRefreshProgressCallback::Cancel()
m_cancelled = true; m_cancelled = true;
} }
void AsyncRefreshProgressCallback::PushState()
{
ProgressCallback::PushState();
}
void AsyncRefreshProgressCallback::PopState()
{
ProgressCallback::PopState();
if (static_cast<int>(m_progress_range) == m_last_range && static_cast<int>(m_progress_value) == m_last_value)
return;
m_last_range = static_cast<int>(m_progress_range);
m_last_value = static_cast<int>(m_progress_value);
fireUpdate();
}
void AsyncRefreshProgressCallback::SetStatusText(const std::string_view text) void AsyncRefreshProgressCallback::SetStatusText(const std::string_view text)
{ {
const QString new_text = QtUtils::StringViewToQString(text); const QString new_text = QtUtils::StringViewToQString(text);

View File

@ -18,6 +18,9 @@ public:
void Cancel(); void Cancel();
void PushState() override;
void PopState() override;
void SetStatusText(const std::string_view text) override; void SetStatusText(const std::string_view text) override;
void SetProgressRange(u32 range) override; void SetProgressRange(u32 range) override;
void SetProgressValue(u32 value) override; void SetProgressValue(u32 value) override;