+
+ if (!appcast_busy)
+ {
+ gchar *updates;
+ updates = ghb_settings_get_string(ud->settings, "check_updates");
+ gint64 duration = 0;
+ if (strcmp(updates, "daily") == 0)
+ duration = 60 * 60 * 24;
+ else if (strcmp(updates, "weekly") == 0)
+ duration = 60 * 60 * 24 * 7;
+ else if (strcmp(updates, "monthly") == 0)
+ duration = 60 * 60 * 24 * 7;
+
+ g_free(updates);
+ if (duration != 0)
+ {
+ gint64 last;
+ time_t tt;
+
+ last = ghb_settings_get_int64(ud->settings, "last_update_check");
+ time(&tt);
+ if (last + duration < tt)
+ {
+ ghb_settings_set_int64(ud->settings,
+ "last_update_check", tt);
+ ghb_pref_save(ud->settings, "last_update_check");
+ g_thread_create((GThreadFunc)ghb_check_update, ud,
+ FALSE, NULL);
+ }
+ }
+ }