X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-metadata-manager.c;h=e6c5202fc41e06890d34570680555f2ef4a2cb44;hb=81f8b8c70408c541a7b9a98a8cbd905365d510c0;hp=4103a3516eeb5db96a44789b530c769813a948af;hpb=68f32e3484d5cabf3e167c4ce1d40bd0991ccb68;p=evince.git diff --git a/shell/ev-metadata-manager.c b/shell/ev-metadata-manager.c index 4103a351..e6c5202f 100644 --- a/shell/ev-metadata-manager.c +++ b/shell/ev-metadata-manager.c @@ -127,6 +127,15 @@ ev_metadata_manager_shutdown (void) ev_metadata_manager = NULL; } +static void +value_free (gpointer data) +{ + GValue *value = (GValue *)data; + + g_value_unset (value); + g_free (value); +} + static GValue * parse_value (xmlChar *value, xmlChar *type) { @@ -184,7 +193,7 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur) item->values = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - g_free); + value_free); cur = cur->xmlChildrenNode; @@ -195,7 +204,7 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur) xmlChar *key; xmlChar *xml_value; xmlChar *type; - GValue *value; + GValue *value; key = xmlGetProp (cur, (const xmlChar *)"key"); xml_value = xmlGetProp (cur, (const xmlChar *)"value"); @@ -209,6 +218,8 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur) if (key != NULL) xmlFree (key); + if (type != NULL) + xmlFree (type); if (xml_value != NULL) xmlFree (xml_value); } @@ -257,7 +268,7 @@ load_values () cur = xmlDocGetRootElement (doc); if (cur == NULL) { - g_message ("The metadata file '%s' is empty", METADATA_FILE); + g_message ("The metadata file “%s” is empty", METADATA_FILE); xmlFreeDoc (doc); return FALSE; @@ -265,7 +276,7 @@ load_values () if (xmlStrcmp (cur->name, (const xmlChar *) "metadata")) { - g_message ("File '%s' is of the wrong type", METADATA_FILE); + g_message ("File “%s” is of the wrong type", METADATA_FILE); xmlFreeDoc (doc); return FALSE; @@ -286,16 +297,6 @@ load_values () return TRUE; } -static void -value_free (gpointer data) -{ - GValue *value = (GValue *)data; - - g_value_unset (value); - g_free (value); -} - - #define LAST_URI "last-used-value" static gboolean