| 1173 | } |
| 1174 | |
| 1175 | void 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 | |
| 1202 | void MainWindow::optAttemptLoad(CEmuOpts &o) { |
| 1203 | if (!fileExists(m_pathRom)) { |
nothing calls this directly
no test coverage detected