]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-metadata-manager.c
Updated Serbian translation
[evince.git] / shell / ev-metadata-manager.c
index 196f3408638adff16442c7a867017ec001a302cb..4103a3516eeb5db96a44789b530c769813a948af 100644 (file)
@@ -142,13 +142,13 @@ parse_value (xmlChar *value, xmlChar *type)
                        g_value_set_string (ret, (char *)value);
                        break;
                case G_TYPE_INT:
-                       g_value_set_int (ret, atoi ((char *)value));
+                       g_value_set_int (ret, g_ascii_strtoull ((char *)value, NULL, 0));
                        break;
                case G_TYPE_DOUBLE:
                        g_value_set_double (ret, g_ascii_strtod ((char *)value, NULL));
                        break;
                case G_TYPE_BOOLEAN:
-                       g_value_set_boolean (ret, atoi ((char *)value));
+                       g_value_set_boolean (ret, g_ascii_strtoull ((char *)value, NULL, 0));
                        break;
        }
 
@@ -179,7 +179,7 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur)
 
        item = g_new0 (Item, 1);
 
-       item->atime = atol ((char *)atime);
+       item->atime = g_ascii_strtoull((char*)atime, NULL, 0);
        
        item->values = g_hash_table_new_full (g_str_hash, 
                                              g_str_equal, 
@@ -378,6 +378,17 @@ ev_metadata_manager_set_last (const gchar *key,
        return;
 }
                                 
+/**
+ * ev_metadata_manager_set:
+ * @uri: Uri to set data for, if @NULL, we return default value
+ * @key: Key to set uri
+ * @value: GValue struct filled up with value
+ * @ignore_last: if @TRUE, default value is ignored
+ * 
+ * Retrieve value for uri in metadata database
+ * 
+ * Returns: @TRUE if value was taken.
+ **/
 gboolean
 ev_metadata_manager_get (const gchar *uri,
                         const gchar *key,
@@ -427,6 +438,14 @@ ev_metadata_manager_get (const gchar *uri,
        return ev_metadata_manager_get_last (key, value, ignore_last);
 }
 
+/**
+ * ev_metadata_manager_set:
+ * @uri: Uri to set data for, if @NULL, we set default value
+ * @key: Key to set uri
+ * @value: GValue struct containing value
+ * 
+ * Set value for key in metadata database
+ **/
 void
 ev_metadata_manager_set (const gchar  *uri,
                         const gchar  *key,
@@ -550,10 +569,8 @@ save_item (const gchar *key, const gpointer *data, xmlNodePtr parent)
        
        xmlSetProp (xml_node, (const xmlChar *)"uri", (const xmlChar *)key);
 
-       /* FIXME: is the cast right? - Paolo */
-       atime = g_strdup_printf ("%d", (int)item->atime);
-       xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime);        
-
+       atime = g_strdup_printf ("%ld", item->atime);
+       xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime);
        g_free (atime);
 
        g_hash_table_foreach (item->values,