summaryrefslogtreecommitdiff
path: root/src/nautilus-search-engine-tracker.c
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2023-01-04 14:37:26 -0800
committerAntónio Fernandes <antoniof@gnome.org>2023-01-09 10:46:41 +0000
commitc69f87524b336f998146d12c1063916e85e90eb6 (patch)
treeecd0d6fb409dd68317c2edc71ef1b852d6321dc1 /src/nautilus-search-engine-tracker.c
parent30e82424ad01ecbd847b129722f9d383021cba29 (diff)
downloadnautilus-c69f87524b336f998146d12c1063916e85e90eb6.tar.gz
general: Replace deprecated GTimeVal with GDateTime
Diffstat (limited to 'src/nautilus-search-engine-tracker.c')
-rw-r--r--src/nautilus-search-engine-tracker.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/nautilus-search-engine-tracker.c b/src/nautilus-search-engine-tracker.c
index b4ae92ad4..51917216b 100644
--- a/src/nautilus-search-engine-tracker.c
+++ b/src/nautilus-search-engine-tracker.c
@@ -181,7 +181,8 @@ cursor_callback (GObject *object,
const char *atime_str;
const char *ctime_str;
const gchar *snippet;
- GTimeVal tv;
+ GDateTime *date;
+ g_autoptr (GTimeZone) tz = g_time_zone_new_local ();
gdouble rank, match;
gboolean success;
gchar *basename;
@@ -231,10 +232,9 @@ cursor_callback (GObject *object,
}
}
- if (g_time_val_from_iso8601 (mtime_str, &tv))
+ date = g_date_time_new_from_iso8601 (mtime_str, tz);
+ if (date != NULL)
{
- GDateTime *date;
- date = g_date_time_new_from_timeval_local (&tv);
nautilus_search_hit_set_modification_time (hit, date);
g_date_time_unref (date);
}
@@ -242,10 +242,9 @@ cursor_callback (GObject *object,
{
g_warning ("unable to parse mtime: %s", mtime_str);
}
- if (g_time_val_from_iso8601 (atime_str, &tv))
+ date = g_date_time_new_from_iso8601 (atime_str, tz);
+ if (date != NULL)
{
- GDateTime *date;
- date = g_date_time_new_from_timeval_local (&tv);
nautilus_search_hit_set_access_time (hit, date);
g_date_time_unref (date);
}
@@ -253,10 +252,9 @@ cursor_callback (GObject *object,
{
g_warning ("unable to parse atime: %s", atime_str);
}
- if (g_time_val_from_iso8601 (ctime_str, &tv))
+ date = g_date_time_new_from_iso8601 (ctime_str, tz);
+ if (date != NULL)
{
- GDateTime *date;
- date = g_date_time_new_from_timeval_local (&tv);
nautilus_search_hit_set_creation_time (hit, date);
g_date_time_unref (date);
}