From 134a11b948d0b241c592ea65da043ccc69b2d50e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 29 Dec 2023 22:38:08 -0500 Subject: [PATCH] Mildly circuitously, accept ROM images. --- OSBindings/Qt/mainwindow.cpp | 5 +++-- OSBindings/Qt/mainwindow.ui | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/OSBindings/Qt/mainwindow.cpp b/OSBindings/Qt/mainwindow.cpp index 900d29089..9a4d4aaf2 100644 --- a/OSBindings/Qt/mainwindow.cpp +++ b/OSBindings/Qt/mainwindow.cpp @@ -758,12 +758,13 @@ void MainWindow::dropEvent(QDropEvent* event) { QString unusedRoms; for(const auto &url: event->mimeData()->urls()) { - const char *const name = url.toLocalFile().toUtf8(); - FILE *const file = fopen(name, "rb"); + const std::string name = url.toLocalFile().toStdString(); + FILE *const file = fopen(name.c_str(), "rb"); if(!file) continue; const auto contents = fileContentsAndClose(file); if(!contents) continue; + CRC::CRC32 generator; const uint32_t crc = generator.compute_crc(*contents); diff --git a/OSBindings/Qt/mainwindow.ui b/OSBindings/Qt/mainwindow.ui index 4a0b1a731..ca366a9d4 100644 --- a/OSBindings/Qt/mainwindow.ui +++ b/OSBindings/Qt/mainwindow.ui @@ -1170,9 +1170,6 @@ - - true - true