[gnome-settings-daemon] updates: Don't have the session start delay configurable



commit b6982f214f51e7519a1957cf550d4148999eb03b
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jun 29 10:45:17 2012 +0100

    updates: Don't have the session start delay configurable
    
    Also, reduce it from 300 seconds to 10 seconds as we're now downloading the
    updates before we notify the user, which will be a considerable delay in itself.

 ...ttings-daemon.plugins.updates.gschema.xml.in.in |    5 -----
 plugins/updates/gsd-updates-common.h               |    1 -
 plugins/updates/gsd-updates-refresh.c              |   15 +++++++--------
 3 files changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
index e46d1b3..8a787bd 100644
--- a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in
@@ -50,11 +50,6 @@
       <_summary>How often to refresh the package cache</_summary>
       <_description>How often to refresh the package cache. Value is in seconds.</_description>
     </key>
-    <key name="session-startup-timeout" type="i">
-      <default>300</default>
-      <_summary>The number of seconds at session startup to wait before checking for updates</_summary>
-      <_description>The number of seconds at session startup to wait before checking for updates. Value is in seconds.</_description>
-    </key>
     <key name="update-battery" type="b">
       <default>false</default>
       <_summary>Install updates automatically when running on battery power</_summary>
diff --git a/plugins/updates/gsd-updates-common.h b/plugins/updates/gsd-updates-common.h
index 58b001b..b916d75 100644
--- a/plugins/updates/gsd-updates-common.h
+++ b/plugins/updates/gsd-updates-common.h
@@ -40,7 +40,6 @@ G_BEGIN_DECLS
 #define GSD_SETTINGS_NOTIFY_UPDATE_COMPLETE_RESTART     "notify-update-complete-restart"
 #define GSD_SETTINGS_NOTIFY_UPDATE_NOT_BATTERY          "notify-update-not-battery"
 #define GSD_SETTINGS_SCHEMA                             "org.gnome.settings-daemon.plugins.updates"
-#define GSD_SETTINGS_SESSION_STARTUP_TIMEOUT            "session-startup-timeout"
 #define GSD_SETTINGS_UPDATE_BATTERY                     "update-battery"
 #define GSD_SETTINGS_AUTO_DOWNLOAD_UPDATES              "auto-download-updates"
 
diff --git a/plugins/updates/gsd-updates-refresh.c b/plugins/updates/gsd-updates-refresh.c
index 7219bc0..2585ed5 100644
--- a/plugins/updates/gsd-updates-refresh.c
+++ b/plugins/updates/gsd-updates-refresh.c
@@ -34,6 +34,7 @@ static void     gsd_updates_refresh_finalize    (GObject            *object);
 
 #define PERIODIC_CHECK_TIME     60*60   /* poke PackageKit every hour */
 #define LOGIN_TIMEOUT           3       /* seconds */
+#define SESSION_STARTUP_TIMEOUT 10      /* seconds */
 
 enum {
         PRESENCE_STATUS_AVAILABLE = 0,
@@ -293,8 +294,6 @@ change_state_cb (GsdUpdatesRefresh *refresh)
 static gboolean
 change_state (GsdUpdatesRefresh *refresh)
 {
-        guint value;
-
         g_return_val_if_fail (GSD_IS_UPDATES_REFRESH (refresh), FALSE);
 
         /* no point continuing if we have no network */
@@ -306,11 +305,12 @@ change_state (GsdUpdatesRefresh *refresh)
         /* wait a little time for things to settle down */
         if (refresh->priv->timeout_id != 0)
                 g_source_remove (refresh->priv->timeout_id);
-        value = g_settings_get_int (refresh->priv->settings,
-                                    GSD_SETTINGS_SESSION_STARTUP_TIMEOUT);
-        g_debug ("defering action for %i seconds", value);
+        g_debug ("defering action for %i seconds",
+                 SESSION_STARTUP_TIMEOUT);
         refresh->priv->timeout_id =
-                g_timeout_add_seconds (value, (GSourceFunc) change_state_cb, refresh);
+                g_timeout_add_seconds (SESSION_STARTUP_TIMEOUT,
+                                       (GSourceFunc) change_state_cb,
+                                       refresh);
         g_source_set_name_by_id (refresh->priv->timeout_id,
                                  "[GsdUpdatesRefresh] change-state");
 
@@ -323,8 +323,7 @@ settings_key_changed_cb (GSettings *client,
                          GsdUpdatesRefresh *refresh)
 {
         g_return_if_fail (GSD_IS_UPDATES_REFRESH (refresh));
-        if (g_strcmp0 (key, GSD_SETTINGS_SESSION_STARTUP_TIMEOUT) == 0 ||
-            g_strcmp0 (key, GSD_SETTINGS_FREQUENCY_GET_UPDATES) == 0 ||
+        if (g_strcmp0 (key, GSD_SETTINGS_FREQUENCY_GET_UPDATES) == 0 ||
             g_strcmp0 (key, GSD_SETTINGS_FREQUENCY_GET_UPGRADES) == 0 ||
             g_strcmp0 (key, GSD_SETTINGS_FREQUENCY_REFRESH_CACHE) == 0 ||
             g_strcmp0 (key, GSD_SETTINGS_AUTO_UPDATE_TYPE) == 0 ||



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