Handle db upgrades and prepare work for old profiles deprecation.

This commit is contained in:
Filippo Scognamiglio
2018-11-18 23:24:42 +01:00
parent 8124d101ad
commit 6fb8ceb501
2 changed files with 42 additions and 3 deletions

View File

@@ -24,7 +24,9 @@ import QtQuick.Controls 1.0
import "utils.js" as Utils
QtObject{
property string version: "1.0.1"
readonly property string version: "1.0.1"
readonly property int profileVersion: 2
// STATIC CONSTANTS ////////////////////////////////////////////////////////
@@ -109,6 +111,8 @@ QtObject{
signal initializedSettings()
signal showErrorMessage(string message)
property Loader fontManager: Loader{
states: [
State { when: rasterization == no_rasterization
@@ -331,6 +335,17 @@ QtObject{
burnInQuality = settings.burnInQuality !== undefined ? settings.burnInQuality : burnInQuality;
}
function userLoadProfileString(profileString) {
var profile = JSON.parse(profileString);
var version = profile.version !== undefined ? profile.version : 1;
if (version === profileVersion) {
loadProfileString(profileString);
} else {
showErrorMessage("This profile is not supported on this version of CRT.")
}
}
function loadProfileString(profileString){
var settings = JSON.parse(profileString);