Revision: 2067
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2067&view=rev
Author: teuf
Date: 2008-07-29 20:10:13 +0000 (Tue, 29 Jul 2008)
Log Message:
-----------
Use GError in SysInfoExtended parsing
Modified Paths:
--------------
libgpod/trunk/ChangeLog
libgpod/trunk/src/itdb_device.c
libgpod/trunk/src/itdb_sysinfo_extended_parser.c
libgpod/trunk/src/itdb_sysinfo_extended_parser.h
libgpod/trunk/tests/test-sysinfo-extended-parsing.c
Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog 2008-07-29 20:09:30 UTC (rev 2066)
+++ libgpod/trunk/ChangeLog 2008-07-29 20:10:13 UTC (rev 2067)
@@ -1,5 +1,15 @@
2008-07-27 Christophe Fergeau <[EMAIL PROTECTED]>
+ * src/itdb_sysinfo_extended_parser.c:
+ * src/itdb_sysinfo_extended_parser.h: add a GError argument to
+ SysInfoExtended parsing functions
+ * src/itdb_device.c: pass NULL GError argument to call to
+ SysInfoExtended functions
+ * tests/test-sysinfo-extended.c: add a GError argument when calling
+ SysInfoExtended parsing functions
+
+2008-07-27 Christophe Fergeau <[EMAIL PROTECTED]>
+
* src/itdb_device.c: add itdb_device_error_quark()
* src/itdb_plist.h:
* src/itdb_plist.c: add error handling to XML parsing (using
Modified: libgpod/trunk/src/itdb_device.c
===================================================================
--- libgpod/trunk/src/itdb_device.c 2008-07-29 20:09:30 UTC (rev 2066)
+++ libgpod/trunk/src/itdb_device.c 2008-07-29 20:10:13 UTC (rev 2067)
@@ -642,7 +642,7 @@
sysinfo_ex_path = itdb_resolve_path (dev_path, p_sysinfo_ex);
g_free (dev_path);
if (!sysinfo_ex_path) return;
- device->sysinfo_extended = itdb_sysinfo_extended_parse (sysinfo_ex_path);
+ device->sysinfo_extended = itdb_sysinfo_extended_parse (sysinfo_ex_path,
NULL);
g_free (sysinfo_ex_path);
if ((device->sysinfo != NULL) && (device->sysinfo_extended != NULL)) {
Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.c
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.c 2008-07-29 20:09:30 UTC
(rev 2066)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.c 2008-07-29 20:10:13 UTC
(rev 2067)
@@ -460,6 +460,7 @@
*img_formats = g_list_prepend (*img_formats, format);
}
}
+
static GList *parse_one_formats_list (GHashTable *sysinfo_dict,
const char *key)
{
@@ -500,14 +501,15 @@
return props;
}
-SysInfoIpodProperties *itdb_sysinfo_extended_parse (const char *filename)
+SysInfoIpodProperties *itdb_sysinfo_extended_parse (const char *filename,
+ GError **error)
{
GValue *parsed_doc;
SysInfoIpodProperties *props;
g_return_val_if_fail (filename != NULL, NULL);
- parsed_doc = itdb_plist_parse_from_file (filename, NULL);
+ parsed_doc = itdb_plist_parse_from_file (filename, error);
if (parsed_doc == NULL) {
return NULL;
}
Modified: libgpod/trunk/src/itdb_sysinfo_extended_parser.h
===================================================================
--- libgpod/trunk/src/itdb_sysinfo_extended_parser.h 2008-07-29 20:09:30 UTC
(rev 2066)
+++ libgpod/trunk/src/itdb_sysinfo_extended_parser.h 2008-07-29 20:10:13 UTC
(rev 2067)
@@ -35,7 +35,8 @@
typedef struct _SysInfoIpodProperties SysInfoIpodProperties;
void itdb_sysinfo_properties_dump (SysInfoIpodProperties *props);
-SysInfoIpodProperties *itdb_sysinfo_extended_parse (const char *filename);
+SysInfoIpodProperties *itdb_sysinfo_extended_parse (const char *filename,
+ GError **error);
void itdb_sysinfo_properties_free (SysInfoIpodProperties *props);
const char *
Modified: libgpod/trunk/tests/test-sysinfo-extended-parsing.c
===================================================================
--- libgpod/trunk/tests/test-sysinfo-extended-parsing.c 2008-07-29 20:09:30 UTC
(rev 2066)
+++ libgpod/trunk/tests/test-sysinfo-extended-parsing.c 2008-07-29 20:10:13 UTC
(rev 2067)
@@ -6,14 +6,14 @@
int main (int argc, char **argv)
{
SysInfoIpodProperties *props;
-
+ GError *error = NULL;
if (argc != 2)
return(1);
g_type_init ();
- props = itdb_sysinfo_extended_parse (argv[1]);
+ props = itdb_sysinfo_extended_parse (argv[1], &error);
if (props == NULL) {
- g_print ("Couldn't parse %s\n", argv[1]);
+ g_print ("Couldn't parse %s: %s\n", argv[1], error->message);
}
itdb_sysinfo_properties_dump (props);
itdb_sysinfo_properties_free (props);
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