Merge pull request #8930 from JosJuice/datel-scrub-ignored

DolphinQt: Fix scrubbing not being disabled for Datel discs
This commit is contained in:
Tilka 2020-07-04 14:49:34 +01:00 committed by GitHub
commit 4f98653ec6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -83,8 +83,6 @@ ConvertDialog::ConvertDialog(QList<std::shared_ptr<const UICommon::GameFile>> fi
m_scrub = new QCheckBox;
grid_layout->addWidget(new QLabel(tr("Remove Junk Data (Irreversible):")), 4, 0);
grid_layout->addWidget(m_scrub, 4, 1);
m_scrub->setEnabled(
std::none_of(m_files.begin(), m_files.end(), std::mem_fn(&UICommon::GameFile::IsDatelDisc)));
QPushButton* convert_button = new QPushButton(tr("Convert"));
@ -267,8 +265,12 @@ void ConvertDialog::OnFormatChanged()
m_block_size->setEnabled(m_block_size->count() > 1);
m_compression->setEnabled(m_compression->count() > 1);
m_scrub->setEnabled(format != DiscIO::BlobType::RVZ);
if (format == DiscIO::BlobType::RVZ)
const bool scrubbing_allowed =
format != DiscIO::BlobType::RVZ &&
std::none_of(m_files.begin(), m_files.end(), std::mem_fn(&UICommon::GameFile::IsDatelDisc));
m_scrub->setEnabled(scrubbing_allowed);
if (!scrubbing_allowed)
m_scrub->setChecked(false);
}