summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-24 20:30:24 +0100
committerVictor Kareh <[email protected]>2022-03-23 09:19:29 -0400
commit5358eaef9720283551321b6cd8c7f63efd15ed0f (patch)
tree087dbb7b59b1dd4c8605f4d4989eb4a71fc18870
parent188204ac0ef18800207393e9b71d7d2a95d5f408 (diff)
downloadpluma-5358eaef9720283551321b6cd8c7f63efd15ed0f.tar.bz2
pluma-5358eaef9720283551321b6cd8c7f63efd15ed0f.tar.xz
pluma-metadata-manager: remove time.h
-rw-r--r--pluma/pluma-metadata-manager.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/pluma/pluma-metadata-manager.c b/pluma/pluma-metadata-manager.c
index 746b5ae6..03b491dc 100644
--- a/pluma/pluma-metadata-manager.c
+++ b/pluma/pluma-metadata-manager.c
@@ -32,7 +32,6 @@
#include <config.h>
#endif
-#include <time.h>
#include <stdlib.h>
#include <libxml/xmlreader.h>
#include "pluma-metadata-manager.h"
@@ -53,7 +52,7 @@ typedef struct _Item Item;
struct _Item
{
- time_t atime; /* time of last access */
+ gint64 atime; /* time of last access */
GHashTable *values;
};
@@ -178,7 +177,7 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur)
item = g_new0 (Item, 1);
- item->atime = g_ascii_strtoull ((char *)atime, NULL, 0);
+ item->atime = g_ascii_strtoll ((char *)atime, NULL, 0);
item->values = g_hash_table_new_full (g_str_hash,
g_str_equal,
@@ -331,7 +330,7 @@ pluma_metadata_manager_get (const gchar *uri,
if (item == NULL)
return NULL;
- item->atime = time (NULL);
+ item->atime = g_get_real_time () / G_USEC_PER_SEC;
if (item->values == NULL)
return NULL;
@@ -393,7 +392,7 @@ pluma_metadata_manager_set (const gchar *uri,
g_hash_table_remove (item->values,
key);
- item->atime = time (NULL);
+ item->atime = g_get_real_time () / G_USEC_PER_SEC;
pluma_metadata_manager_arm_timeout ();
}
@@ -453,7 +452,7 @@ save_item (const gchar *key, const gpointer *data, xmlNodePtr parent)
pluma_debug_message (DEBUG_METADATA, "uri: %s", key);
#endif
- atime = g_strdup_printf ("%ld", item->atime);
+ atime = g_strdup_printf ("%" G_GINT64_FORMAT, item->atime);
xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime);
#ifdef PLUMA_METADATA_VERBOSE_DEBUG