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

Method checkVersion

gui/qt/settings.cpp:1198–1240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1196}
1197
1198void MainWindow::checkVersion() {
1199 bool ask = false;
1200
1201 if (isFirstRun()) {
1202 setVersion();
1203 return;
1204 }
1205
1206 if (m_config->contains(SETTING_VERSION)) {
1207 if (m_config->value(SETTING_VERSION, QStringLiteral(CEMU_VERSION)).toString().compare(QStringLiteral(CEMU_VERSION))) {
1208 ask = true;
1209 }
1210 } else {
1211 ask = true;
1212 }
1213
1214 if (ask) {
1215 if (CEMU_RELEASE) {
1216 setAutoUpdates(true);
1217 }
1218
1219 m_keepSetup = true;
1220 QCheckBox *cb = new QCheckBox(tr("Keep migratable settings"));
1221 cb->setChecked(true);
1222 QMessageBox msgbox;
1223 msgbox.setText(tr("This version of CEmu is not compatible with your settings, probably made by an older version. "
1224 "Would you like to erase them to prevent any unexpected behavior?"));
1225 msgbox.setIcon(QMessageBox::Icon::Question);
1226 msgbox.addButton(QMessageBox::Yes);
1227 msgbox.addButton(QMessageBox::No);
1228 msgbox.setDefaultButton(QMessageBox::Yes);
1229 msgbox.setCheckBox(cb);
1230
1231 connect(cb, &QCheckBox::stateChanged, [this](int state) {
1232 m_keepSetup = static_cast<Qt::CheckState>(state) == Qt::CheckState::Checked;
1233 });
1234
1235 if (msgbox.exec() == QMessageBox::Yes) {
1236 resetCEmu();
1237 }
1238 setVersion();
1239 }
1240}
1241
1242void MainWindow::saveDebug() {
1243 if (m_config->value(SETTING_DEBUGGER_SAVE_ON_CLOSE, false).toBool()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected