window: simplify refresh sources timeout code
This commit is contained in:
+2
-6
@@ -818,19 +818,15 @@ static gboolean
|
|||||||
refresh_sources (GcalWindow *window)
|
refresh_sources (GcalWindow *window)
|
||||||
{
|
{
|
||||||
GcalWindowPrivate *priv;
|
GcalWindowPrivate *priv;
|
||||||
static gint current_timeout = 0;
|
static gint current_timeout = FAST_REFRESH_TIMEOUT;
|
||||||
|
|
||||||
priv = gcal_window_get_instance_private (window);
|
priv = gcal_window_get_instance_private (window);
|
||||||
|
|
||||||
/* update current_timeout the first time it's called */
|
|
||||||
if (current_timeout == 0)
|
|
||||||
current_timeout = priv->refresh_timeout;
|
|
||||||
|
|
||||||
/* refresh sources */
|
/* refresh sources */
|
||||||
gcal_manager_refresh (priv->manager);
|
gcal_manager_refresh (priv->manager);
|
||||||
|
|
||||||
/* check window state */
|
/* check window state */
|
||||||
if (current_timeout != 0 && current_timeout != priv->refresh_timeout)
|
if (current_timeout != priv->refresh_timeout)
|
||||||
{
|
{
|
||||||
current_timeout = priv->refresh_timeout;
|
current_timeout = priv->refresh_timeout;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user