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

Method optLoadFiles

gui/qt/mainwindow.cpp:1175–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1173}
1174
1175void MainWindow::optLoadFiles(CEmuOpts &o) {
1176 if (o.romFile.isEmpty()) {
1177 if (m_loadedBootImage) {
1178 m_pathRom = configPath + SETTING_DEFAULT_ROM_FILE;
1179 m_config->setValue(SETTING_ROM_PATH, m_pathRom);
1180 } else {
1181 const QString path = m_config->value(SETTING_ROM_PATH, QString()).toString();
1182 if (path.isEmpty()) {
1183 m_pathRom.clear();
1184 } else {
1185 m_pathRom = QDir::cleanPath(appDir().absoluteFilePath(path));
1186 }
1187 }
1188 } else {
1189 m_pathRom = QDir::cleanPath(o.romFile);
1190 if (!m_config->contains(SETTING_ROM_PATH)) {
1191 m_config->setValue(SETTING_ROM_PATH, m_pathRom);
1192 }
1193 }
1194
1195 if (!o.imageFile.isEmpty()) {
1196 if (fileExists(o.imageFile)) {
1197 m_pathImage = QDir::cleanPath(QFileInfo(o.imageFile).absoluteFilePath());
1198 }
1199 }
1200}
1201
1202void MainWindow::optAttemptLoad(CEmuOpts &o) {
1203 if (!fileExists(m_pathRom)) {

Callers

nothing calls this directly

Calls 4

QStringClass · 0.85
appDirFunction · 0.85
fileExistsFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected