Revision: 2137
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2137&view=rev
Author: teuf
Date: 2008-10-07 18:57:22 +0000 (Tue, 07 Oct 2008)
Log Message:
-----------
Adjust SysInfoExtended parsing to the plist parser changes
The type of the parsed data for <array> nodes have changed in the plist parser,
it's now a GValueArray, the SysInfoExtended parser has to take that into account
since the description of the various artwork formats is stored in an <array>
element.
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/itdb_sysinfo_extended_parser.c
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2008-10-07 18:57:06 UTC (rev 2136)
+++ libgpod/trunk/ChangeLog 2008-10-07 18:57:22 UTC (rev 2137)
@@ -1,5 +1,11 @@
2008-10-07 Christophe Fergeau <[EMAIL PROTECTED]>
+ * src/itdb_sysinfoextended_parser.c: artwork is stored in <array>
+ nodes (which are parsed to a GValueArray), reflect that in the
+ SysInfoExtended parsing code.
+
+2008-10-07 Christophe Fergeau <[EMAIL PROTECTED]>
+
* src/itdb_plist.c: fix handling on blank nodes (ie nodes
containing only white spaces), fixes parsing of SysInfoExtended files
as well ;)
Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.c
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.c 2008-10-07 18:57:06 UTC
(rev 2136)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.c 2008-10-07 18:57:22 UTC
(rev 2137)
@@ -450,31 +450,29 @@
return img_spec;
}
-static void process_one (gpointer key, gpointer value, gpointer user_data)
-{
- GList **img_formats = user_data;
- Itdb_ArtworkFormat *format;
-
- format = g_value_to_image_format (value);
- if (format != NULL) {
- *img_formats = g_list_prepend (*img_formats, format);
- }
-}
-
static GList *parse_one_formats_list (GHashTable *sysinfo_dict,
const char *key)
{
GValue *to_parse;
GList *formats = NULL;
+ GValueArray *array;
+ gint i;
to_parse = g_hash_table_lookup (sysinfo_dict, key);
if (to_parse == NULL) {
return NULL;
}
- if (!G_VALUE_HOLDS (to_parse, G_TYPE_HASH_TABLE)) {
+ if (!G_VALUE_HOLDS (to_parse, G_TYPE_VALUE_ARRAY)) {
return NULL;
}
- g_hash_table_foreach (g_value_get_boxed (to_parse), process_one, &formats);
+ array = (GValueArray*)g_value_get_boxed (to_parse);
+ for (i = 0; i < array->n_values; i++) {
+ Itdb_ArtworkFormat *format;
+ format = g_value_to_image_format (g_value_array_get_nth (array, i));
+ if (format != NULL) {
+ formats = g_list_prepend (formats, format);
+ }
+ }
g_hash_table_remove (sysinfo_dict, key);
return formats;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2