MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / processUpdates

Method processUpdates

src/mainwindow.cpp:2161–2202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2159}
2160
2161void MainWindow::processUpdates()
2162{
2163 auto& settings = m_OrganizerCore.settings();
2164 const auto earliest = QVersionNumber::fromString("2.1.2").normalized();
2165
2166 const auto lastVersion = settings.version().value_or(earliest);
2167 const auto currentVersion = m_OrganizerCore.getVersion().asQVersionNumber();
2168
2169 m_LastVersion = lastVersion;
2170
2171 settings.processUpdates(currentVersion, lastVersion);
2172
2173 if (!settings.firstStart()) {
2174 if (lastVersion < QVersionNumber(2, 1, 6)) {
2175 ui->modList->header()->setSectionHidden(ModList::COL_NOTES, true);
2176 }
2177
2178 if (lastVersion < QVersionNumber(2, 2, 1)) {
2179 // hide new columns by default
2180 for (int i = DownloadList::COL_MODNAME; i < DownloadList::COL_COUNT; ++i) {
2181 ui->downloadView->header()->hideSection(i);
2182 }
2183 }
2184
2185 if (lastVersion < QVersionNumber(2, 3)) {
2186 for (int i = 1; i < ui->dataTree->header()->count(); ++i)
2187 ui->dataTree->setColumnWidth(i, 150);
2188 }
2189 }
2190
2191 if (currentVersion < lastVersion) {
2192 const auto text =
2193 tr("Notice: Your current MO version (%1) is lower than the previously used one "
2194 "(%2). "
2195 "The GUI may not downgrade gracefully, so you may experience oddities. "
2196 "However, there should be no serious issues.")
2197 .arg(currentVersion.toString())
2198 .arg(lastVersion.toString());
2199
2200 log::warn("{}", text);
2201 }
2202}
2203
2204void MainWindow::storeSettings()
2205{

Callers

nothing calls this directly

Calls 6

firstStartMethod · 0.80
countMethod · 0.80
settingsMethod · 0.45
versionMethod · 0.45
getVersionMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected