[epiphany] adblock: Replace usage of GTimeVal with GDateTime
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] adblock: Replace usage of GTimeVal with GDateTime
- Date: Mon, 26 Aug 2019 12:04:50 +0000 (UTC)
commit 8ac1e62b72b47e98217377c9737557f4900e338d
Author: Adrian Perez de Castro <aperez igalia com>
Date: Mon Aug 26 11:15:21 2019 +0300
adblock: Replace usage of GTimeVal with GDateTime
GTimeVal has been recently deprecated as it may overflow in 2038.
This uses GDateTime instead, which is the recommended replacement.
embed/ephy-filters-manager.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-filters-manager.c b/embed/ephy-filters-manager.c
index 2e5112b0a..2383b472f 100644
--- a/embed/ephy-filters-manager.c
+++ b/embed/ephy-filters-manager.c
@@ -379,7 +379,7 @@ filter_info_needs_updating_from_source (const FilterInfo *self)
* than the last update time saved for it.
*/
if (self->local) {
- GTimeVal modification_time = { .tv_sec = 0 };
+ g_autoptr (GDateTime) modification_time = NULL;
g_autoptr (GError) error = NULL;
g_autoptr (GFile) source_file = g_file_new_for_uri (self->source_uri);
g_autoptr (GFileInfo) info = g_file_query_info (source_file,
@@ -392,8 +392,8 @@ filter_info_needs_updating_from_source (const FilterInfo *self)
return TRUE;
}
- g_file_info_get_modification_time (info, &modification_time);
- return (modification_time.tv_sec > 0) && (modification_time.tv_sec > self->last_update);
+ modification_time = g_file_info_get_modification_date_time (info);
+ return g_date_time_to_unix (modification_time) > self->last_update;
}
/* For remote filters, check the time elapsed since the last fetch. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]