Fix more clang issues

It doesn't seem to like capturing structured bindings, even though they are tuple-like
This commit is contained in:
zhupengfei
2020-06-20 23:16:19 +08:00
parent e9d7ec7244
commit f009574b1e
3 changed files with 21 additions and 18 deletions
+2 -2
View File
@@ -33,8 +33,8 @@ void ImportJob::run() {
for (const auto& content : contents) {
emit NextContent(size_imported, count + 1, content, eta);
const auto callback = [this, total_size, size_imported, &eta,
&UpdateETA](std::size_t current_size, std::size_t /*total_size*/) {
const auto callback = [this, size_imported, &eta, &UpdateETA](std::size_t current_size,
std::size_t /*total_size*/) {
UpdateETA(size_imported + current_size);
emit ProgressUpdated(size_imported + current_size, current_size, eta);
};
+1 -1
View File
@@ -632,7 +632,7 @@ void ImportDialog::StartDumpingCXI(const Core::ContentSpecifier& specifier) {
});
connect(job, &ProgressiveJob::Completed, this,
[dialog] { dialog->setValue(dialog->maximum()); });
connect(dialog, &QProgressDialog::canceled, this, [this, job] { job->Cancel(); });
connect(dialog, &QProgressDialog::canceled, this, [job] { job->Cancel(); });
job->start();
}
+18 -15
View File
@@ -164,10 +164,11 @@ void UtilitiesDialog::SDDecryptionTool() {
return;
}
// TODO: Add Progress reporting
ShowProgressDialog([sdmc_root, relative_source, destination] {
Core::SDMCDecryptor decryptor(sdmc_root);
return decryptor.DecryptAndWriteFile(relative_source, destination.toStdString());
});
ShowProgressDialog(
[sdmc_root = sdmc_root, relative_source = relative_source, destination = destination] {
Core::SDMCDecryptor decryptor(sdmc_root);
return decryptor.DecryptAndWriteFile(relative_source, destination.toStdString());
});
}
void UtilitiesDialog::SaveDataExtractionTool() {
@@ -187,7 +188,8 @@ void UtilitiesDialog::SaveDataExtractionTool() {
}
// TODO: Add Progress reporting
ShowProgressDialog([sdmc_root, relative_source, source, destination] {
ShowProgressDialog([sdmc_root = sdmc_root, relative_source = relative_source,
source = source, destination = destination] {
const auto size = FileUtil::GetSize(source.toStdString());
std::vector<u8> data(size);
Core::SDMCFile file(sdmc_root, relative_source, "rb");
@@ -214,7 +216,7 @@ void UtilitiesDialog::SaveDataExtractionTool() {
});
} else {
// TODO: Add Progress reporting
ShowProgressDialog([source, destination] {
ShowProgressDialog([source = source, destination = destination] {
const auto size = FileUtil::GetSize(source.toStdString());
std::vector<u8> data(size);
FileUtil::IOFile file(source.toStdString(), "rb");
@@ -256,15 +258,16 @@ void UtilitiesDialog::ExtdataExtractionTool() {
return;
}
// TODO: Add Progress reporting
ShowProgressDialog([sdmc_root, relative_source, destination] {
Core::SDMCDecryptor decryptor(sdmc_root);
Core::SDExtdata extdata(relative_source, decryptor);
if (!extdata.IsGood()) {
return false;
}
ShowProgressDialog(
[sdmc_root = sdmc_root, relative_source = relative_source, destination = destination] {
Core::SDMCDecryptor decryptor(sdmc_root);
Core::SDExtdata extdata(relative_source, decryptor);
if (!extdata.IsGood()) {
return false;
}
return extdata.Extract(destination.toStdString());
});
return extdata.Extract(destination.toStdString());
});
}
void UtilitiesDialog::RomFSExtractionTool() {
@@ -273,7 +276,7 @@ void UtilitiesDialog::RomFSExtractionTool() {
return;
}
ShowProgressDialog([source, destination] {
ShowProgressDialog([source = source, destination = destination] {
const auto size = FileUtil::GetSize(source.toStdString());
std::vector<u8> data(size);
FileUtil::IOFile src_file(source.toStdString(), "rb");