summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-03-21 10:40:03 -0600
committerJohn Stebbins <[email protected]>2016-03-21 10:40:03 -0600
commitaf1a27928318cc377562ec4026a2cbbfad83cbca (patch)
treea2a7e70f2a074c9bbac4f39b0148b726765c4335 /gtk/src
parenta3e695dd5c0d23692ed0e99624723e39305cdd8d (diff)
presets: fix import of old version-less preset files
The version number was not added after import causing an attempt to do import conversions twice. The second conversion breaks values.
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/presets.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index 00454d865..167356690 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -685,8 +685,8 @@ presets_add_config_file(const gchar *name)
return -2;
}
- hb_value_t *backup = hb_value_dup(preset);
- int result = hb_presets_import(preset);
+ hb_value_t *imported;
+ int result = hb_presets_import(preset, &imported);
if (result)
{
// hb_presets_import modified the preset. So make a backup
@@ -694,19 +694,19 @@ presets_add_config_file(const gchar *name)
config = ghb_get_user_config_dir(NULL);
path = g_strdup_printf ("%s/presets.%d.%d.%d.json",
config, major, minor, micro);
- hb_value_write_json(backup, path);
+ hb_value_write_json(preset, path);
g_free(config);
g_free(path);
}
- hb_value_free(&backup);
- hb_presets_add(preset);
+ hb_presets_add(imported);
if (major != hb_major || minor != hb_minor || micro != hb_micro)
{
// Reload hb builtin presets
hb_presets_builtin_update();
store_presets();
}
+ hb_value_free(&imported);
hb_value_free(&preset);
return 0;
}