diff options
author | jstebbins <[email protected]> | 2009-02-11 00:34:03 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-02-11 00:34:03 +0000 |
commit | e6fa09bc4f3b7b093454e34805ae491d3f5ab71d (patch) | |
tree | da4518fbc26f7e2e27830d85f69455101f284472 /gtk/src | |
parent | ae6f965cd5438c9e9c09f3d6270ef811ecc94035 (diff) |
LinGui: fix problem with writing null values to presets file
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2137 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/presets.c | 39 | ||||
-rw-r--r-- | gtk/src/values.c | 38 | ||||
-rw-r--r-- | gtk/src/values.h | 2 |
3 files changed, 39 insertions, 40 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 5cbab837d..dd186f8da 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -139,37 +139,6 @@ ghb_preset_path_string(const GValue *path) return str; } -static void -debug_show_type(GType tp) -{ - const gchar *str = "unknown"; - if (tp == G_TYPE_STRING) - { - str ="string"; - } - else if (tp == G_TYPE_INT) - { - str ="int"; - } - else if (tp == G_TYPE_INT64) - { - str ="int64"; - } - else if (tp == G_TYPE_BOOLEAN) - { - str ="bool"; - } - else if (tp == ghb_array_get_type()) - { - str ="array"; - } - else if (tp == ghb_dict_get_type()) - { - str ="dict"; - } - g_message("Type: %s", str); -} - void dump_preset_path(const gchar *msg, const GValue *path) { @@ -1941,29 +1910,21 @@ export_value_xlat(GValue *dict) gval = export_value_xlat2(detel_xlat, lin_val, G_TYPE_INT); if (gval) ghb_dict_insert(dict, g_strdup(key), gval); - else - ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(lin_val)); key = "PictureDecomb"; lin_val = ghb_dict_lookup(dict, key); gval = export_value_xlat2(decomb_xlat, lin_val, G_TYPE_INT); if (gval) ghb_dict_insert(dict, g_strdup(key), gval); - else - ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(lin_val)); key = "PictureDeinterlace"; lin_val = ghb_dict_lookup(dict, key); gval = export_value_xlat2(deint_xlat, lin_val, G_TYPE_INT); if (gval) ghb_dict_insert(dict, g_strdup(key), gval); - else - ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(lin_val)); key = "PictureDenoise"; lin_val = ghb_dict_lookup(dict, key); gval = export_value_xlat2(denoise_xlat, lin_val, G_TYPE_INT); if (gval) ghb_dict_insert(dict, g_strdup(key), gval); - else - ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(lin_val)); key = "Subtitles"; lin_val = ghb_dict_lookup(dict, key); gval = export_subtitle_xlat2(lin_val); diff --git a/gtk/src/values.c b/gtk/src/values.c index ad723ee68..a888d0a50 100644 --- a/gtk/src/values.c +++ b/gtk/src/values.c @@ -77,7 +77,43 @@ debug_show_type(GType tp) { str ="dict"; } - g_debug("%s", str); + g_debug("Type %s", str); +} + +void +debug_show_value(GValue *gval) +{ + GType tp; + + tp = G_VALUE_TYPE(gval); + if (tp == G_TYPE_STRING) + { + g_message("Type %s value %s", "string", g_value_get_string(gval)); + } + else if (tp == G_TYPE_INT) + { + g_message("Type %s value %d", "int", g_value_get_int(gval)); + } + else if (tp == G_TYPE_INT64) + { + g_message("Type %s value %ld", "int64", g_value_get_int64(gval)); + } + else if (tp == G_TYPE_DOUBLE) + { + g_message("Type %s value %f", "double", g_value_get_double(gval)); + } + else if (tp == G_TYPE_BOOLEAN) + { + g_message("Type %s value %d", "boolean", g_value_get_boolean(gval)); + } + else if (tp == ghb_array_get_type()) + { + g_message("Type %s", "boolean"); + } + else if (tp == ghb_dict_get_type()) + { + g_message("Type %s", "dict"); + } } gint diff --git a/gtk/src/values.h b/gtk/src/values.h index ecf676cdd..d28727fcb 100644 --- a/gtk/src/values.h +++ b/gtk/src/values.h @@ -71,5 +71,7 @@ GValue* ghb_dict_lookup(const GValue *gval, const gchar *key); gboolean ghb_dict_remove(GValue *gval, const gchar *key); void ghb_register_transforms(void); +void debug_show_value(GValue *gval); +void debug_show_type(GType tp); #endif // _GHB_VALUES_H_ |