[gnome-software] odrs: Fix confusing variable name



commit f16d2956c794bf67c52f55a5c0d403c6ff461332
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Dec 3 14:47:04 2019 +0000

    odrs: Fix confusing variable name
    
    `fn` is commonly used as shorthand for ‘function’. In this case, it was
    being used as shorthand for ‘filename’.
    
    Avoid the confusion by using a slightly longer and more descriptive
    variable name.
    
    This doesn’t introduce any functional changes (pun unintended).
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 plugins/odrs/gs-plugin-odrs.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/plugins/odrs/gs-plugin-odrs.c b/plugins/odrs/gs-plugin-odrs.c
index e0264b86..9421b4b4 100644
--- a/plugins/odrs/gs-plugin-odrs.c
+++ b/plugins/odrs/gs-plugin-odrs.c
@@ -164,27 +164,27 @@ gs_plugin_refresh (GsPlugin *plugin,
                   GError **error)
 {
        GsPluginData *priv = gs_plugin_get_data (plugin);
-       g_autofree gchar *fn = NULL;
+       g_autofree gchar *cache_filename = NULL;
        g_autofree gchar *uri = NULL;
        g_autoptr(GError) error_local = NULL;
        g_autoptr(GsApp) app_dl = gs_app_new (gs_plugin_get_name (plugin));
 
        /* check cache age */
-       fn = gs_utils_get_cache_filename ("odrs",
-                                         "ratings.json",
-                                         GS_UTILS_CACHE_FLAG_WRITEABLE,
-                                         error);
-       if (fn == NULL)
+       cache_filename = gs_utils_get_cache_filename ("odrs",
+                                                     "ratings.json",
+                                                     GS_UTILS_CACHE_FLAG_WRITEABLE,
+                                                     error);
+       if (cache_filename == NULL)
                return FALSE;
        if (cache_age > 0) {
                guint tmp;
                g_autoptr(GFile) file = NULL;
-               file = g_file_new_for_path (fn);
+               file = g_file_new_for_path (cache_filename);
                tmp = gs_utils_get_file_age (file);
                if (tmp < cache_age) {
                        g_debug ("%s is only %u seconds old, so ignoring refresh",
-                                fn, tmp);
-                       return gs_plugin_odrs_load_ratings (plugin, fn, error);
+                                cache_filename, tmp);
+                       return gs_plugin_odrs_load_ratings (plugin, cache_filename, error);
                }
        }
 
@@ -193,7 +193,7 @@ gs_plugin_refresh (GsPlugin *plugin,
        gs_app_set_summary_missing (app_dl,
                                    /* TRANSLATORS: status text when downloading */
                                    _("Downloading application ratings…"));
-       if (!gs_plugin_download_file (plugin, app_dl, uri, fn, cancellable, &error_local)) {
+       if (!gs_plugin_download_file (plugin, app_dl, uri, cache_filename, cancellable, &error_local)) {
                g_autoptr(GsPluginEvent) event = gs_plugin_event_new ();
 
                gs_plugin_event_set_error (event, error_local);
@@ -208,7 +208,7 @@ gs_plugin_refresh (GsPlugin *plugin,
                /* don't fail updates if the ratings server is unavailable */
                return TRUE;
        }
-       return gs_plugin_odrs_load_ratings (plugin, fn, error);
+       return gs_plugin_odrs_load_ratings (plugin, cache_filename, error);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]