Commit 48483f97 authored by Umang Jain's avatar Umang Jain Committed by Richard Hughes

Set install-timestamp gsetting when we update or upgrade

install-timestamp is the gsetting which drives app-center
notifications for pending updates. However, the logic for
driving notifications was already present in gs-update-monitor
(see no_updates_for_a_week) but it turns out that install-timestamp
gsettings was not being set at appropriate places when the user
updates or upgrades. We fill this gap by relying on plugin-loader's
logic because that drives update or upgrades at a macro level.
parent 07e9d679
Pipeline #53596 passed with stage
in 4 minutes and 37 seconds
......@@ -3003,6 +3003,8 @@ gs_plugin_loader_generic_update (GsPluginLoader *plugin_loader,
helper->anything_ran = TRUE;
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
gs_utils_update_install_timestamp (priv->settings);
return TRUE;
......@@ -3069,6 +3071,11 @@ gs_plugin_loader_process_thread_cb (GTask *task,
GsPluginLoaderPrivate *priv = gs_plugin_loader_get_instance_private (plugin_loader);
gs_utils_update_install_timestamp (priv->settings);
/* remove from pending list */
if (add_to_pending_array)
gs_plugin_loader_pending_apps_remove (plugin_loader, helper);
......@@ -1200,4 +1200,22 @@ gs_utils_parse_evr (const gchar *evr,
return TRUE;
* gs_utils_update_install_timestamp:
* Sets the value of install-timestamp to current epoch. "install-timestamp" represents
* the last time we had an update or upgrade.
gs_utils_update_install_timestamp (GSettings *settings)
g_autoptr(GDateTime) now = NULL;
g_return_if_fail (settings != NULL);
now = g_date_time_new_now_local ();
g_settings_set (settings, "install-timestamp", "x", g_date_time_to_unix (now));
/* vim: set noexpandtab: */
......@@ -103,6 +103,7 @@ gboolean gs_utils_parse_evr (const gchar *evr,
gchar **out_epoch,
gchar **out_version,
gchar **out_release);
void gs_utils_update_install_timestamp (GSettings *settings);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment