| 1330 | } |
| 1331 | |
| 1332 | void Config::upgradeToLatestVersion() noexcept |
| 1333 | { |
| 1334 | const auto wasVersion = m_impl->m_majorVersion; |
| 1335 | if (wasVersion != LastSupportedMajorVersion) |
| 1336 | { |
| 1337 | if (wasVersion == 1) |
| 1338 | { |
| 1339 | UpdateFileRulesFromV1ToV2(*this, m_impl->m_fileRules); |
| 1340 | |
| 1341 | // The instance version is now 2.0 |
| 1342 | m_impl->m_majorVersion = 2; |
| 1343 | m_impl->m_minorVersion = 0; |
| 1344 | } |
| 1345 | |
| 1346 | static_assert(LastSupportedMajorVersion == 2, "Config: Handle newer versions"); |
| 1347 | setMajorVersion(LastSupportedMajorVersion); |
| 1348 | setMinorVersion(LastSupportedMinorVersion[LastSupportedMajorVersion - 1]); |
| 1349 | } |
| 1350 | } |
| 1351 | |
| 1352 | ConfigRcPtr Config::createEditableCopy() const |
| 1353 | { |