[gnome-software: 9/10] gs-odrs-provider: Consistently use 64-bit cache ages
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 9/10] gs-odrs-provider: Consistently use 64-bit cache ages
- Date: Tue, 22 Feb 2022 12:47:58 +0000 (UTC)
commit 3ce9892fd09350c387637dc96d0826321ef3a0d8
Author: Philip Withnall <pwithnall endlessos org>
Date: Sun Feb 20 17:48:27 2022 +0000
gs-odrs-provider: Consistently use 64-bit cache ages
This makes the API and internals consistent with the modern GLib
conventions for representing time.
It should introduce no functional changes.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Helps: #1472
lib/gs-odrs-provider.c | 8 ++++----
lib/gs-odrs-provider.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/lib/gs-odrs-provider.c b/lib/gs-odrs-provider.c
index c2587c512..279470706 100644
--- a/lib/gs-odrs-provider.c
+++ b/lib/gs-odrs-provider.c
@@ -1258,7 +1258,7 @@ gs_odrs_provider_new (const gchar *review_server,
* gs_odrs_provider_refresh:
* @self: a #GsOdrsProvider
* @plugin: the #GsPlugin running this operation
- * @cache_age: cache age, in seconds, as passed to gs_plugin_refresh()
+ * @cache_age_secs: cache age, in seconds, as passed to gs_plugin_refresh()
* @cancellable: (nullable): a #GCancellable, or %NULL
* @error: return location for a #GError
*
@@ -1270,7 +1270,7 @@ gs_odrs_provider_new (const gchar *review_server,
gboolean
gs_odrs_provider_refresh (GsOdrsProvider *self,
GsPlugin *plugin,
- guint cache_age,
+ guint64 cache_age_secs,
GCancellable *cancellable,
GError **error)
{
@@ -1287,12 +1287,12 @@ gs_odrs_provider_refresh (GsOdrsProvider *self,
error);
if (cache_filename == NULL)
return FALSE;
- if (cache_age > 0) {
+ if (cache_age_secs > 0) {
guint tmp;
g_autoptr(GFile) file = NULL;
file = g_file_new_for_path (cache_filename);
tmp = gs_utils_get_file_age (file);
- if (tmp < cache_age) {
+ if (tmp < cache_age_secs) {
g_debug ("%s is only %u seconds old, so ignoring refresh",
cache_filename, tmp);
return gs_odrs_provider_load_ratings (self, cache_filename, error);
diff --git a/lib/gs-odrs-provider.h b/lib/gs-odrs-provider.h
index 6bd4a455d..64059355c 100644
--- a/lib/gs-odrs-provider.h
+++ b/lib/gs-odrs-provider.h
@@ -31,7 +31,7 @@ GsOdrsProvider *gs_odrs_provider_new (const gchar
*review_server,
gboolean gs_odrs_provider_refresh (GsOdrsProvider *self,
GsPlugin *plugin,
- guint cache_age,
+ guint64 cache_age_secs,
GCancellable *cancellable,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]