| 216 | } |
| 217 | |
| 218 | void RomSelection::saveROMImage() { |
| 219 | FILE* saveRom; |
| 220 | |
| 221 | QFileDialog dialog(this); |
| 222 | |
| 223 | dialog.setFileMode(QFileDialog::AnyFile); |
| 224 | QString filename = dialog.getSaveFileName(this, tr("Save ROM"), m_dir.absolutePath(), tr("ROM Image (*.rom)")); |
| 225 | |
| 226 | m_dir = dialog.directory(); |
| 227 | |
| 228 | if (filename.isEmpty()) { return; } |
| 229 | |
| 230 | if (!filename.endsWith(QStringLiteral(".rom"), Qt::CaseInsensitive)) { |
| 231 | filename += QStringLiteral(".rom"); |
| 232 | } |
| 233 | |
| 234 | saveRom = fopen_utf8(filename.toStdString().c_str(), "wb"); |
| 235 | |
| 236 | if (saveRom) { |
| 237 | fwrite(m_array, 1, ROM_SIZE, saveRom); |
| 238 | fclose(saveRom); |
| 239 | m_rom = filename; |
| 240 | close(); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | QString RomSelection::getRomPath() { |
| 245 | return m_rom; |
nothing calls this directly
no test coverage detected