MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / preset_get_folder

Function preset_get_folder

gtk/src/presets.c:2024–2050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2022}
2023
2024static hb_preset_index_t *
2025preset_get_folder (signal_user_data_t *ud, const char *name, int type)
2026{
2027 hb_preset_index_t *folder_path = hb_preset_search_index(name, 0, type);
2028 if (folder_path->depth <= 0)
2029 {
2030 GhbValue * new_folder;
2031 new_folder = ghb_dict_new();
2032 ghb_dict_set_string(new_folder, "PresetName", name);
2033 ghb_dict_set(new_folder, "ChildrenArray", ghb_array_new());
2034 ghb_dict_set_int(new_folder, "Type", HB_PRESET_TYPE_CUSTOM);
2035 ghb_dict_set_bool(new_folder, "Folder", TRUE);
2036 int index = hb_preset_append(folder_path, new_folder);
2037 if (index >= 0)
2038 {
2039 folder_path->index[folder_path->depth++] = index;
2040 presets_list_append(ud, folder_path);
2041 }
2042 else
2043 {
2044 ghb_log("Failed to create category (%s)...", name);
2045 return NULL;
2046 }
2047 ghb_value_free(&new_folder);
2048 }
2049 return folder_path;
2050}
2051
2052static void
2053settings_save(signal_user_data_t *ud, const char * category,

Callers 2

settings_saveFunction · 0.85

Calls 7

hb_preset_search_indexFunction · 0.85
ghb_dict_set_stringFunction · 0.85
ghb_dict_set_intFunction · 0.85
ghb_dict_set_boolFunction · 0.85
hb_preset_appendFunction · 0.85
presets_list_appendFunction · 0.85
ghb_logFunction · 0.85

Tested by

no test coverage detected