diff options
author | jstebbins <[email protected]> | 2015-04-03 17:44:19 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-04-03 17:44:19 +0000 |
commit | a80e6ccc6eea8bae648e5a6cf1573361335296f2 (patch) | |
tree | 1f7f3745f7ed1251a53f7b9ffbec668317a9ebcf /gtk/src/plist.c | |
parent | 5efc8273df8372d36819391a1700314bd052ce2c (diff) |
LinGui: refactor dict values
makes most dict methods a simple passthru to hb_dict
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7046 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/plist.c')
-rw-r--r-- | gtk/src/plist.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gtk/src/plist.c b/gtk/src/plist.c index 51430cc5b..2507a67a6 100644 --- a/gtk/src/plist.c +++ b/gtk/src/plist.c @@ -118,12 +118,12 @@ start_element( } break; case P_DICT: { - gval = ghb_dict_value_new(); + gval = ghb_dict_new(); g_queue_push_head(pd->stack, gval); } break; case P_ARRAY: { - gval = ghb_array_value_new(128); + gval = ghb_array_new(); g_queue_push_head(pd->stack, gval); } break; case P_INTEGER: @@ -166,11 +166,11 @@ start_element( if (pd->key == NULL) { g_warning("No key for dictionary item"); - ghb_value_free(gval); + ghb_value_free(&gval); } else { - ghb_dict_insert(current, pd->key, gval); + ghb_dict_set(current, pd->key, gval); } } else @@ -243,7 +243,7 @@ end_element( case P_INTEGER: { gint64 val = g_strtod(pd->value, NULL); - gval = ghb_int64_value_new(val); + gval = ghb_int_value_new(val); } break; case P_REAL: { @@ -256,11 +256,11 @@ end_element( } break; case P_TRUE: { - gval = ghb_boolean_value_new(TRUE); + gval = ghb_bool_value_new(TRUE); } break; case P_FALSE: { - gval = ghb_boolean_value_new(FALSE); + gval = ghb_bool_value_new(FALSE); } break; default: { @@ -287,11 +287,11 @@ end_element( if (pd->key == NULL) { g_warning("No key for dictionary item"); - ghb_value_free(gval); + ghb_value_free(&gval); } else { - ghb_dict_insert(current, pd->key, gval); + ghb_dict_set(current, pd->key, gval); } } else @@ -431,7 +431,7 @@ gval_write(FILE *file, GhbValue *gval) count = ghb_array_len(gval); for (ii = 0; ii < count; ii++) { - val = ghb_array_get_nth(gval, ii); + val = ghb_array_get(gval, ii); gval_write(file, val); } indent--; @@ -446,7 +446,7 @@ gval_write(FILE *file, GhbValue *gval) indent_fprintf(file, indent, "<dict>\n"); indent++; - ghb_dict_iter_init(gval, &iter); + iter = ghb_dict_iter_init(gval); while (ghb_dict_iter_next(gval, &iter, &key, &val)) { indent_fprintf(file, indent, "<key>%s</key>\n", key); @@ -459,7 +459,7 @@ gval_write(FILE *file, GhbValue *gval) else if (gtype == GHB_BOOL) { gchar *tag; - if (ghb_value_boolean(gval)) + if (ghb_value_get_bool(gval)) { tag = "true"; } @@ -471,17 +471,17 @@ gval_write(FILE *file, GhbValue *gval) } else if (gtype == GHB_DOUBLE) { - gdouble val = ghb_value_double(gval); + gdouble val = ghb_value_get_double(gval); indent_fprintf(file, indent, "<real>%.17g</real>\n", val); } else if (gtype == GHB_INT) { - gint64 val = ghb_value_int64(gval); + gint64 val = ghb_value_get_int(gval); indent_fprintf(file, indent, "<integer>%"PRId64"</integer>\n", val); } else if (gtype == GHB_STRING) { - const gchar *str = ghb_value_string(gval); + const gchar *str = ghb_value_get_string(gval); gchar *esc = g_markup_escape_text(str, -1); indent_fprintf(file, indent, "<string>%s</string>\n", esc); g_free(esc); |