From cdac8a4da759cb6a90f6709a434c3a38f2060345 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 5 Mar 2003 17:13:34 +0000 Subject: Likewise, assume weather_refresh_time of zero means "never update the * e-summary-weather.c (e_summary_weather_set_online): Likewise, assume weather_refresh_time of zero means "never update the weather". (e_summary_weather_init): Likewise here. (e_summary_weather_reconfigure): And here. * e-summary-rdf.c (e_summary_rdf_init): Don't add the news feeds here -- it should be handled with a GConf schema. Also, assume that prefs is always not NULL (as is the case with the current code), and interpret a timeout value of zero as "never update automatically". (e_summary_rdf_reconfigure): Likewise here. If rdf->timeout is zero, assume there is no pending timeout. (e_summary_rdf_set_online): Likewise here. Sigh, so much duplication in this code. svn path=/trunk/; revision=20174 --- my-evolution/e-summary-weather.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'my-evolution/e-summary-weather.c') diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index 3bafa212e9..221c96b7b9 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -530,9 +530,11 @@ e_summary_weather_set_online (ESummary *summary, if (online == TRUE) { e_summary_weather_update (summary); - weather->timeout = gtk_timeout_add (summary->preferences->weather_refresh_time * 1000, - (GtkFunction) e_summary_weather_update, - summary); + + if (summary->preferences->weather_refresh_time != 0) + weather->timeout = gtk_timeout_add (summary->preferences->weather_refresh_time * 1000, + (GtkFunction) e_summary_weather_update, + summary); } else { for (p = weather->weathers; p; p = p->next) { Weather *w; @@ -608,10 +610,13 @@ e_summary_weather_init (ESummary *summary) } e_summary_weather_update (summary); - - weather->timeout = gtk_timeout_add (timeout * 1000, - (GtkFunction) e_summary_weather_update, - summary); + + if (timeout == 0) + weather->timeout = 0; + else + weather->timeout = gtk_timeout_add (timeout * 1000, + (GtkFunction) e_summary_weather_update, + summary); return; } @@ -789,8 +794,12 @@ e_summary_weather_reconfigure (ESummary *summary) e_summary_weather_add_location (summary, p->data); } - weather->timeout = gtk_timeout_add (summary->preferences->weather_refresh_time * 1000, - (GtkFunction) e_summary_weather_update, summary); + if (summary->preferences->weather_refresh_time == 0) + weather->timeout = 0; + else + weather->timeout = gtk_timeout_add (summary->preferences->weather_refresh_time * 1000, + (GtkFunction) e_summary_weather_update, summary); + e_summary_weather_update (summary); } -- cgit v1.2.3