void ProfileUpdater::updateProfile(const QString ¤t, const QString &profile) { if (current == profile) { return; } // Updater::Version currentVersion = Updater::parseVersionFromString(current); Updater::Version profileVersion = Updater::parseVersionFromString(profile); if (profileVersion == Updater::parseVersionFromString("1.0.0-b4")) { update100b4(); update100rc1(); update100(); update118(); return; } if (profileVersion == Updater::parseVersionFromString("1.0.0-rc1")) { update100rc1(); update100(); update118(); return; } if (profileVersion == Updater::parseVersionFromString("1.0.0")) { update100(); update118(); return; } if (profileVersion == Updater::parseVersionFromString("1.1.0")) { // Do nothing, nothing changed return; } if (profileVersion == Updater::parseVersionFromString("1.1.5")) { // Do nothing, nothing changed return; } if (profileVersion == Updater::parseVersionFromString("1.1.8")) { update118(); return; } std::cout << "QupZilla: Incompatible profile version detected, overwriting profile data..." << std::endl; copyDataToProfile(); }
void ProfileManager::updateProfile(const QString ¤t, const QString &profile) { if (current == profile) { return; } Updater::Version prof(profile); if (prof == Updater::Version("1.0.0")) { update100(); return; } if (prof == Updater::Version("1.1.0") || prof == Updater::Version("1.1.5") || prof == Updater::Version("1.1.8")) { update118(); return; } if (prof == Updater::Version("1.2.0")) { update120(); return; } if (prof == Updater::Version("1.3.0") || prof == Updater::Version("1.3.1")) { update130(); return; } if (prof >= Updater::Version("1.4.0") && prof <= Updater::Version("1.5.0")) { update140(); return; } if (prof >= Updater::Version("1.6.0") && prof < Updater::Version("1.8.0")) { update160(); return; } if (prof >= Updater::Version("1.8.0") && prof < Updater::Version("1.9.0")) { // do nothing return; } std::cout << "QupZilla: Incompatible profile version detected (" << qPrintable(profile) << "), overwriting profile data..." << std::endl; copyDataToProfile(); }