aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-weather.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-03-06 01:13:34 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-03-06 01:13:34 +0800
commitcdac8a4da759cb6a90f6709a434c3a38f2060345 (patch)
treed5691b85879c8daddc55bed34cc35ae022f25450 /my-evolution/e-summary-weather.c
parentf56716d0d30a89adb25863e938b98a41c1b75dcd (diff)
downloadgsoc2013-evolution-cdac8a4da759cb6a90f6709a434c3a38f2060345.tar
gsoc2013-evolution-cdac8a4da759cb6a90f6709a434c3a38f2060345.tar.gz
gsoc2013-evolution-cdac8a4da759cb6a90f6709a434c3a38f2060345.tar.bz2
gsoc2013-evolution-cdac8a4da759cb6a90f6709a434c3a38f2060345.tar.lz
gsoc2013-evolution-cdac8a4da759cb6a90f6709a434c3a38f2060345.tar.xz
gsoc2013-evolution-cdac8a4da759cb6a90f6709a434c3a38f2060345.tar.zst
gsoc2013-evolution-cdac8a4da759cb6a90f6709a434c3a38f2060345.zip
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
Diffstat (limited to 'my-evolution/e-summary-weather.c')
-rw-r--r--my-evolution/e-summary-weather.c27
1 files changed, 18 insertions, 9 deletions
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);
}