diff options
author | John Stebbins <[email protected]> | 2016-03-27 10:30:46 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-03-27 10:30:46 -0700 |
commit | 033fda8f6879af30cc872e87a612e35ba0a3113f (patch) | |
tree | fedae5a26f1362559d8347e3a576d724bbe49149 | |
parent | 136f6bdf0a71a37b24b21501a66dc307b39487ef (diff) |
LinGui: fix saving default preset
The default flag was getting lost
-rw-r--r-- | gtk/src/presets.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c index dd1676b1f..69d02922e 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -1608,7 +1608,7 @@ static void settings_save(signal_user_data_t *ud, hb_preset_index_t *path, const char *name) { GhbValue *dict; - gboolean replace = FALSE; + gboolean replace = FALSE, def = FALSE; dict = hb_preset_get(path); if (dict != NULL) @@ -1617,6 +1617,7 @@ settings_save(signal_user_data_t *ud, hb_preset_index_t *path, const char *name) int type; const char *s; + def = ghb_dict_get_bool(dict, "Default"); is_folder = ghb_dict_get_bool(dict, "Folder"); type = ghb_dict_get_int(dict, "Type"); s = ghb_dict_get_string(dict, "PresetName"); @@ -1670,6 +1671,8 @@ settings_save(signal_user_data_t *ud, hb_preset_index_t *path, const char *name) free(new_name); if (replace) { + // If we are replacing the default preset, re-mark it as default + ghb_dict_set_bool(dict, "Default", def); // Already exists, update its description if (hb_preset_set(path, dict) >= 0) { |