+ // Fall through to the next case.
+ [[fallthrough]];
+ }
+
+ // Upgrade from schema version 5 to schema version 6.
+ case 5:
+ {
+ // Instantiate a spinner query.
+ QSqlQuery spinnerQuery(domainsDatabase);
+
+ // Set the query to be forward only (increases performance while iterating over the query).
+ spinnerQuery.setForwardOnly(true);
+
+ // Prepare the query.
+ spinnerQuery.prepare("SELECT " + ID + "," + JAVASCRIPT + "," + LOCAL_STORAGE + "," + DOM_STORAGE + " FROM " + DOMAINS_TABLE);
+
+ // Execute the query.
+ spinnerQuery.exec();
+
+ // Update the spinner values so that enabled is 1 and disabled is 2.
+ while (spinnerQuery.next())
+ {
+ // Initialize the new spinner values.
+ int newJavaScriptValue = SYSTEM_DEFAULT;
+ int newLocalStorageValue = SYSTEM_DEFAULT;
+ int newDomStorageValue = SYSTEM_DEFAULT;
+
+ // Update the new JavaScript value if needed.
+ switch (spinnerQuery.value(JAVASCRIPT).toInt())
+ {
+ // Disabled used to be 1.
+ case 1:
+ {
+ // Update the value to be 2.
+ newJavaScriptValue = DISABLED;
+
+ break;
+ }
+
+ // Enabled used to be 2.
+ case 2:
+ {
+ // Update the new value to be 1.
+ newJavaScriptValue = ENABLED;
+
+ break;
+ }
+ }
+
+ // Update the new local storage value if needed.
+ switch (spinnerQuery.value(LOCAL_STORAGE).toInt())
+ {
+ // Disabled used to be 1.
+ case 1:
+ {
+ // Update the new value to be 2.
+ newLocalStorageValue = DISABLED;
+
+ break;
+ }
+
+ // Enabled used to be 2.
+ case 2:
+ {
+ // Update the new value to be 1.
+ newLocalStorageValue = ENABLED;
+
+ break;
+ }
+ }
+
+ // Update the new DOM storage value if needed.
+ switch (spinnerQuery.value(DOM_STORAGE).toInt())
+ {
+ // Disabled used to be 1.
+ case 1:
+ {
+ // Update the new value to be 2.
+ newDomStorageValue = DISABLED;
+
+ break;
+ }
+
+ // Enabled used to be 2.
+ case 2:
+ {
+ // Update the new value to be 1.
+ newDomStorageValue = ENABLED;
+
+ break;
+ }
+ }
+
+ // Create an update spinner query.
+ QSqlQuery updateSpinnerQuery(domainsDatabase);
+
+ // Prepare the update spinner query.
+ updateSpinnerQuery.prepare("UPDATE " + DOMAINS_TABLE + " SET " +
+ JAVASCRIPT + " = :javascript , " +
+ LOCAL_STORAGE + " = :local_storage , " +
+ DOM_STORAGE + " = :dom_storage " +
+ " WHERE " + ID + " = :id");
+
+ // Bind the values.
+ updateSpinnerQuery.bindValue(":javascript", newJavaScriptValue);
+ updateSpinnerQuery.bindValue(":local_storage", newLocalStorageValue);
+ updateSpinnerQuery.bindValue(":dom_storage", newDomStorageValue);
+ updateSpinnerQuery.bindValue(":id", spinnerQuery.value(ID));
+
+ // Execute the query.
+ updateSpinnerQuery.exec();
+ }
+
+ // Fall through to the next case.