From 98ada2588a6648105f4c2f3f9ec7e4bc7ae353ec Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 6 Jun 2021 21:51:51 -0400 Subject: [PATCH] Resolve name confusion. --- OSBindings/Qt/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OSBindings/Qt/mainwindow.cpp b/OSBindings/Qt/mainwindow.cpp index 47d439e2a..a87b73da4 100644 --- a/OSBindings/Qt/mainwindow.cpp +++ b/OSBindings/Qt/mainwindow.cpp @@ -721,16 +721,16 @@ void MainWindow::dropEvent(QDropEvent* event) { CRC::CRC32 generator; const uint32_t crc = generator.compute_crc(*contents); - std::optional target = ROM::Description::from_crc(crc); - if(target) { + std::optional target_rom = ROM::Description::from_crc(crc); + if(target_rom) { // Ensure the destination folder exists. - const std::string path = appDataLocation + "/ROMImages/" + rom.machine_name; + const std::string path = appDataLocation + "/ROMImages/" + target_rom->machine_name; const QDir dir(QString::fromStdString(path)); if (!dir.exists()) dir.mkpath("."); // Write into place. - const std::string destination = QDir::toNativeSeparators(QString::fromStdString(path+ "/" + rom.file_name)).toStdString(); + const std::string destination = QDir::toNativeSeparators(QString::fromStdString(path+ "/" + target_rom->file_names[0])).toStdString(); FILE *const target = fopen(destination.c_str(), "wb"); fwrite(contents->data(), 1, contents->size(), target); fclose(target);