Skip to content
Permalink
Browse files

Merge pull request #8306 from JosJuice/volumeverifier-dialog

VolumeVerifier: Allocate QProgressDialog on stack
  • Loading branch information...
stenzek committed Aug 9, 2019
2 parents e87a3f9 + cd02ca1 commit 7c1ca1fda1af35e31bf66dee3cbb533d7b122bb3
Showing with 9 additions and 9 deletions.
  1. +9 −9 Source/Core/DolphinQt/Config/VerifyWidget.cpp
@@ -98,26 +98,26 @@ void VerifyWidget::Verify()
// We have to divide the number of processed bytes with something so it won't make ints overflow
constexpr int DIVISOR = 0x100;

QProgressDialog* progress = new QProgressDialog(tr("Verifying"), tr("Cancel"), 0,
verifier.GetTotalBytes() / DIVISOR, this);
progress->setWindowTitle(tr("Verifying"));
progress->setWindowFlags(progress->windowFlags() & ~Qt::WindowContextHelpButtonHint);
progress->setMinimumDuration(500);
progress->setWindowModality(Qt::WindowModal);
QProgressDialog progress(tr("Verifying"), tr("Cancel"), 0, verifier.GetTotalBytes() / DIVISOR,
this);
progress.setWindowTitle(tr("Verifying"));
progress.setWindowFlags(progress.windowFlags() & ~Qt::WindowContextHelpButtonHint);
progress.setMinimumDuration(500);
progress.setWindowModality(Qt::WindowModal);

verifier.Start();
while (verifier.GetBytesProcessed() != verifier.GetTotalBytes())
{
progress->setValue(verifier.GetBytesProcessed() / DIVISOR);
if (progress->wasCanceled())
progress.setValue(verifier.GetBytesProcessed() / DIVISOR);
if (progress.wasCanceled())
return;

verifier.Process();
}
verifier.Finish();

DiscIO::VolumeVerifier::Result result = verifier.GetResult();
progress->reset();
progress.setValue(verifier.GetBytesProcessed() / DIVISOR);

m_summary_text->setText(QString::fromStdString(result.summary_text));

0 comments on commit 7c1ca1f

Please sign in to comment.
You can’t perform that action at this time.