summaryrefslogtreecommitdiffstats
path: root/gtk/src/values.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-05-14 17:11:48 +0000
committerjstebbins <[email protected]>2015-05-14 17:11:48 +0000
commit9ae7e30dc8daace92d17ea36a4f0bdede00b9471 (patch)
tree9485255c993389a6740b833e7aa30c5b5b2622aa /gtk/src/values.c
parent90cafad3e4c610b8b009769f922fabc283979231 (diff)
lingui: use libhb preset management from linux gui
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7179 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/values.c')
-rw-r--r--gtk/src/values.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk/src/values.c b/gtk/src/values.c
index b413250cc..a1206d9d0 100644
--- a/gtk/src/values.c
+++ b/gtk/src/values.c
@@ -224,3 +224,32 @@ ghb_dict_get_string_xform(const GhbValue *dict, const gchar *key)
return ghb_value_get_string_xform(value);
}
+void
+ghb_dict_copy(GhbValue *dst, const GhbValue *src)
+{
+ GhbDictIter iter;
+ const char *key;
+ GhbValue *val, *dst_val;
+
+ iter = ghb_dict_iter_init(src);
+ while (ghb_dict_iter_next(src, &iter, &key, &val))
+ {
+ dst_val = ghb_dict_get(dst, key);
+ if (ghb_value_type(val) == GHB_DICT)
+ {
+ if (dst_val == NULL || ghb_value_type(dst_val) != GHB_DICT)
+ {
+ dst_val = ghb_value_dup(val);
+ ghb_dict_set(dst, key, dst_val);
+ }
+ else if (ghb_value_type(dst_val) == GHB_DICT)
+ {
+ ghb_dict_copy(dst_val, val);
+ }
+ }
+ else
+ {
+ ghb_dict_set(dst, key, ghb_value_dup(val));
+ }
+ }
+}