Don't go into an infinite loop if there are absolutely no enabled
2001-07-27 Richard Hestilow <hestilow@ximian.com> * prefs-widget.c (random_timeout_cb): Don't go into an infinite loop if there are absolutely no enabled screensavers.
This commit is contained in:
parent
d063bb65b0
commit
2d9be3eb4e
2 changed files with 14 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2001-07-27 Richard Hestilow <hestilow@ximian.com>
|
||||||
|
|
||||||
|
* prefs-widget.c (random_timeout_cb): Don't go into an infinite
|
||||||
|
loop if there are absolutely no enabled screensavers.
|
||||||
|
|
||||||
2001-07-27 Bradford Hovinen <hovinen@ximian.com>
|
2001-07-27 Bradford Hovinen <hovinen@ximian.com>
|
||||||
|
|
||||||
* RELEASE : 1.5.2
|
* RELEASE : 1.5.2
|
||||||
|
|
|
@ -702,7 +702,7 @@ selection_foreach_func (int model_row, int *closure)
|
||||||
static gint
|
static gint
|
||||||
random_timeout_cb (PrefsWidget *prefs_widget)
|
random_timeout_cb (PrefsWidget *prefs_widget)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l, *old;
|
||||||
|
|
||||||
g_return_val_if_fail (prefs_widget != NULL, FALSE);
|
g_return_val_if_fail (prefs_widget != NULL, FALSE);
|
||||||
|
|
||||||
|
@ -730,11 +730,17 @@ random_timeout_cb (PrefsWidget *prefs_widget)
|
||||||
l = prefs_widget->screensavers;
|
l = prefs_widget->screensavers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (l)
|
||||||
|
old = l->next;
|
||||||
|
else
|
||||||
|
old = NULL;
|
||||||
|
|
||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
/* Are we back to where we started? */
|
/* Are we back to where we started? */
|
||||||
if (((Screensaver*) l->data)->enabled
|
if (((Screensaver*) l->data)->enabled
|
||||||
|| l == prefs_widget->priv->random_current)
|
|| l == prefs_widget->priv->random_current
|
||||||
|
|| (old && old == l))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
l = l->next;
|
l = l->next;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue