| 100 | } |
| 101 | |
| 102 | void Settings::processUpdates(const QVersionNumber& currentVersion, |
| 103 | const QVersionNumber& lastVersion) |
| 104 | { |
| 105 | if (firstStart()) { |
| 106 | set(m_Settings, "General", "version", currentVersion.toString()); |
| 107 | return; |
| 108 | } |
| 109 | |
| 110 | if (currentVersion == lastVersion) { |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | log::info("updating from {} to {}", lastVersion.toString(), |
| 115 | currentVersion.toString()); |
| 116 | |
| 117 | auto version = [&](const QVersionNumber& v, auto&& f) { |
| 118 | if (lastVersion < v) { |
| 119 | log::debug("processing updates for {}", v.toString()); |
| 120 | f(); |
| 121 | } |
| 122 | }; |
| 123 | |
| 124 | version({2, 2, 0}, [&] { |
| 125 | remove(m_Settings, "Settings", "steam_password"); |
| 126 | remove(m_Settings, "Settings", "nexus_username"); |
| 127 | remove(m_Settings, "Settings", "nexus_password"); |
| 128 | remove(m_Settings, "Settings", "nexus_login"); |
| 129 | remove(m_Settings, "Settings", "nexus_api_key"); |
| 130 | remove(m_Settings, "Settings", "ask_for_nexuspw"); |
| 131 | remove(m_Settings, "Settings", "nmm_version"); |
| 132 | |
| 133 | removeSection(m_Settings, "Servers"); |
| 134 | }); |
| 135 | |
| 136 | version({2, 2, 1}, [&] { |
| 137 | remove(m_Settings, "General", "mod_info_tabs"); |
| 138 | remove(m_Settings, "General", "mod_info_conflict_expanders"); |
| 139 | remove(m_Settings, "General", "mod_info_conflicts"); |
| 140 | remove(m_Settings, "General", "mod_info_advanced_conflicts"); |
| 141 | remove(m_Settings, "General", "mod_info_conflicts_overwrite"); |
| 142 | remove(m_Settings, "General", "mod_info_conflicts_noconflict"); |
| 143 | remove(m_Settings, "General", "mod_info_conflicts_overwritten"); |
| 144 | }); |
| 145 | |
| 146 | version({2, 2, 2}, [&] { |
| 147 | // log splitter is gone, it's a dock now |
| 148 | remove(m_Settings, "General", "log_split"); |
| 149 | |
| 150 | // moved to widgets |
| 151 | remove(m_Settings, "General", "mod_info_conflicts_tab"); |
| 152 | remove(m_Settings, "General", "mod_info_conflicts_general_expanders"); |
| 153 | remove(m_Settings, "General", "mod_info_conflicts_general_overwrite"); |
| 154 | remove(m_Settings, "General", "mod_info_conflicts_general_noconflict"); |
| 155 | remove(m_Settings, "General", "mod_info_conflicts_general_overwritten"); |
| 156 | remove(m_Settings, "General", "mod_info_conflicts_advanced_list"); |
| 157 | remove(m_Settings, "General", "mod_info_conflicts_advanced_options"); |
| 158 | remove(m_Settings, "General", "mod_info_tab_order"); |
| 159 | remove(m_Settings, "General", "mod_info_dialog_images_show_dds"); |
nothing calls this directly
no test coverage detected