MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / bootImageImport

Method bootImageImport

gui/qt/settings.cpp:234–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234bool MainWindow::bootImageImport(const QString &bootImagePath) {
235 QString newConfigPath = configPath + SETTING_DEFAULT_CONFIG_FILE;
236 QString romPath = configPath + SETTING_DEFAULT_ROM_FILE;
237 QFile bootFile(bootImagePath);
238 QFile romFile(romPath);
239 romFile.remove();
240 if (!romFile.open(QIODevice::WriteOnly)) { return false; }
241 QFile settingsFile(newConfigPath);
242 settingsFile.remove();
243 if (!settingsFile.open(QIODevice::WriteOnly)) { return false; }
244 bootFile.open(QIODevice::ReadOnly);
245 QByteArray romData = bootFile.read(0x400000);
246 QByteArray settingsData = bootFile.readAll();
247 romFile.write(romData);
248 settingsFile.write(settingsData);
249 romFile.close();
250 settingsFile.close();
251 bootFile.close();
252 m_pathConfig = newConfigPath;
253 return true;
254}
255
256void MainWindow::bootImageExport() {
257 QMessageBox::information(this, MSG_INFORMATION, tr("A bootable image can be used to start CEmu with predefined configurations, without the need for any extra setup."

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected