prop_t * settings_add_dir_cstr(prop_t *parent, const char *title, const char *subtype, const char *icon, const char *shortdesc, const char *url) { prop_t *p = setting_add_cstr(parent, title, "settings", 0); prop_t *metadata = prop_create(p, "metadata"); prop_set_string(prop_create(metadata, "shortdesc"), shortdesc); settings_add_dir_sup(p, url, icon, subtype); return p; }
prop_t * settings_add_dir_cstr(prop_t *parent, const char *title, const char *subtype, const char *icon, const char *shortdesc) { char url[100]; prop_t *p = setting_add_cstr(parent ? prop_create(parent, "model") : NULL, title, "settings"); prop_t *model = prop_create(p, "model"); prop_t *metadata = prop_create(model, "metadata"); backend_prop_make(model, url, sizeof(url)); prop_set_string(prop_create(p, "url"), url); if(icon != NULL) prop_set_string(prop_create(metadata, "icon"), icon); prop_set_string(prop_create(metadata, "shortdesc"), shortdesc); return p; }