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=0dba983e20c238274e9eadabdb658056bb468a19;hb=c500456e3448832c7fc0f4436fe5a335b4afca5c;hp=f5ab0407b62fee42f21ea874c5f60e745f05a628;hpb=6003391d261ef7940bbc14683f60b242fe347adb;p=evince.git diff --git a/shell/ev-metadata-manager.c b/shell/ev-metadata-manager.c index f5ab0407..0dba983e 100644 --- a/shell/ev-metadata-manager.c +++ b/shell/ev-metadata-manager.c @@ -72,6 +72,12 @@ static gboolean ev_metadata_manager_save (gpointer data); static EvMetadataManager *ev_metadata_manager = NULL; +/** + * item_free: + * @data: a pointer to a #Item data + * + * It does free the values on the #GHashTable where data points. + */ static void item_free (gpointer data) { @@ -87,6 +93,16 @@ item_free (gpointer data) g_free (item); } +/** + * ev_metadata_manager_init: + * + * Creates an EvMetadataManager with default values. + * + * values_loaded -> %FALSE. + * modified -> %FALSE. + * timeout_id -> the id of the event source. + * items -> a new full empty #GHashTable. + */ void ev_metadata_manager_init (void) { @@ -268,7 +284,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; @@ -276,7 +292,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; @@ -380,7 +396,7 @@ ev_metadata_manager_set_last (const gchar *key, } /** - * ev_metadata_manager_set: + * ev_metadata_manager_get: * @uri: Uri to set data for, if @NULL, we return default value * @key: Key to set uri * @value: GValue struct filled up with value @@ -539,8 +555,12 @@ save_values (const gchar *key, GValue *value, xmlNodePtr parent) string_value = g_strdup_printf ("%d", g_value_get_int (value)); break; case G_TYPE_DOUBLE: - string_value = g_strdup_printf ("%f", g_value_get_double (value)); - break; + { + gchar buf[G_ASCII_DTOSTR_BUF_SIZE]; + g_ascii_dtostr (buf, G_ASCII_DTOSTR_BUF_SIZE, g_value_get_double (value)); + string_value = g_strdup_printf ("%s", buf); + } + break; case G_TYPE_BOOLEAN: string_value = g_strdup_printf ("%d", g_value_get_boolean (value)); break;