diff options
author | jstebbins <[email protected]> | 2015-03-06 18:12:27 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-03-06 18:12:27 +0000 |
commit | b2afa282e450e3c1e7c1ab75925734086e6b706a (patch) | |
tree | 65376e1623e890e518c3dc5f1b847a255b82d2c6 /gtk/src/icons.c | |
parent | f6bf7d75908d718ea620ac2e6f691627d0a9e7c2 (diff) |
LinGui: change settings dict from glib to jansson
This will allow for preferences, presets, and queue files to be
written as json instead of plists (currently still plists).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6968 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/icons.c')
-rw-r--r-- | gtk/src/icons.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gtk/src/icons.c b/gtk/src/icons.c index aef0b056d..5c22527ad 100644 --- a/gtk/src/icons.c +++ b/gtk/src/icons.c @@ -5,23 +5,22 @@ void ghb_load_icons() { - GHashTableIter iter; - gchar *key; - GValue *gval; + GhbDictIter iter; + const gchar *key; + GhbValue *gval; - GValue *icons = ghb_resource_get("icons"); - ghb_dict_iter_init(&iter, icons); - // middle (void*) cast prevents gcc warning "defreferencing type-punned - // pointer will break strict-aliasing rules" - while (g_hash_table_iter_next( - &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval)) + GhbValue *icons = ghb_resource_get("icons"); + ghb_dict_iter_init(icons, &iter); + while (ghb_dict_iter_next(icons, &iter, &key, &gval)) { - ghb_rawdata_t *rd; gint size; GdkPixbuf *pb; gboolean svg; char *name = g_strdup(key); char *pos; + const char *base64; + guint8 *data; + gsize data_size; pos = g_strstr_len(name, -1, "."); if (pos != NULL) @@ -29,14 +28,15 @@ ghb_load_icons() GInputStream *gis; svg = ghb_value_boolean(ghb_dict_lookup(gval, "svg")); - rd = g_value_get_boxed(ghb_dict_lookup(gval, "data")); + base64 = ghb_value_const_string(ghb_dict_lookup(gval, "data")); + data = g_base64_decode(base64, &data_size); if (svg) { int ii; int sizes[] = {16, 22, 24, 32, 48, 64, 128, 256, 0}; for (ii = 0; sizes[ii]; ii++) { - gis = g_memory_input_stream_new_from_data(rd->data, rd->size, + gis = g_memory_input_stream_new_from_data(data, data_size, NULL); pb = gdk_pixbuf_new_from_stream_at_scale(gis, sizes[ii], sizes[ii], @@ -49,7 +49,7 @@ ghb_load_icons() } else { - gis = g_memory_input_stream_new_from_data(rd->data, rd->size, NULL); + gis = g_memory_input_stream_new_from_data(data, data_size, NULL); pb = gdk_pixbuf_new_from_stream(gis, NULL, NULL); g_input_stream_close(gis, NULL, NULL); size = gdk_pixbuf_get_height(pb); |