[gnome-software] Update the saved timestamp when manually refreshing updates



commit 38aa716394a16e83dae012c024adba18dee14402
Author: Kalev Lember <kalevlember gmail com>
Date:   Mon Mar 3 14:50:32 2014 +0100

    Update the saved timestamp when manually refreshing updates
    
    This ensures the "Last checked: HH:MM" label properly updates on
    clicking the update refresh button.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725165

 src/gs-shell-updates.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index c011a47..349fcfb 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -603,6 +603,7 @@ gs_shell_updates_refresh_cb (GsPluginLoader *plugin_loader,
 {
        GError *error = NULL;
        gboolean ret;
+       GDateTime *now;
        GsShellUpdatesPrivate *priv = shell_updates->priv;
        GtkWidget *widget;
 
@@ -638,6 +639,12 @@ gs_shell_updates_refresh_cb (GsPluginLoader *plugin_loader,
                return;
        }
 
+       /* update the last checked timestamp */
+       now = g_date_time_new_now_local ();
+       g_settings_set (priv->settings, "check-timestamp", "x",
+                       g_date_time_to_unix (now));
+       g_date_time_unref (now);
+
        /* get the new list */
        gs_shell_updates_refresh (shell_updates, FALSE, TRUE);
 }


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