1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Mildly circuitously, accept ROM images.

This commit is contained in:
Thomas Harte 2023-12-29 22:38:08 -05:00
parent 09059ab869
commit 134a11b948
2 changed files with 3 additions and 5 deletions

View File

@ -758,12 +758,13 @@ void MainWindow::dropEvent(QDropEvent* event) {
QString unusedRoms; QString unusedRoms;
for(const auto &url: event->mimeData()->urls()) { for(const auto &url: event->mimeData()->urls()) {
const char *const name = url.toLocalFile().toUtf8(); const std::string name = url.toLocalFile().toStdString();
FILE *const file = fopen(name, "rb"); FILE *const file = fopen(name.c_str(), "rb");
if(!file) continue; if(!file) continue;
const auto contents = fileContentsAndClose(file); const auto contents = fileContentsAndClose(file);
if(!contents) continue; if(!contents) continue;
CRC::CRC32 generator; CRC::CRC32 generator;
const uint32_t crc = generator.compute_crc(*contents); const uint32_t crc = generator.compute_crc(*contents);

View File

@ -1170,9 +1170,6 @@
</item> </item>
<item> <item>
<widget class="QPlainTextEdit" name="missingROMsBox"> <widget class="QPlainTextEdit" name="missingROMsBox">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>