From 6027c05a2886353bf5454561d8b4f82527b125b9 Mon Sep 17 00:00:00 2001 From: xbezdick <255993@mail.muni.cz> Date: Thu, 5 May 2011 18:41:09 +0200 Subject: [PATCH] cleanup --- shell/ev-presentation-timer.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/shell/ev-presentation-timer.c b/shell/ev-presentation-timer.c index d1b3474d..0ab7018d 100644 --- a/shell/ev-presentation-timer.c +++ b/shell/ev-presentation-timer.c @@ -95,12 +95,16 @@ timeout_cb (gpointer data) void ev_presentation_timer_set_pages (EvPresentationTimer *ev_timer, guint pages) { + if(!EV_IS_PRESENTATION_TIMER (ev_timer)) + return; ev_timer->priv->pages = pages -1; } void ev_presentation_timer_set_page (EvPresentationTimer *ev_timer, guint page) { + if(!EV_IS_PRESENTATION_TIMER (ev_timer)) + return; if (page >= ev_timer->priv->pages) { page = ev_timer->priv->pages; @@ -125,6 +129,8 @@ ev_presentation_timer_init (EvPresentationTimer *ev_timer) void ev_presentation_timer_start (EvPresentationTimer *ev_timer) { + if (!EV_IS_PRESENTATION_TIMER (ev_timer)) + return; if (ev_timer->priv->running == FALSE) { ev_timer->priv->remaining = (ev_timer->priv->time)*60; @@ -136,6 +142,10 @@ ev_presentation_timer_start (EvPresentationTimer *ev_timer) void ev_presentation_timer_stop (EvPresentationTimer *ev_timer) { + if (!EV_IS_PRESENTATION_TIMER (ev_timer)) + return; + if (priv->timeout > 0) + g_source_remove (priv->timeout); ev_timer->priv->remaining = 0; } @@ -143,9 +153,10 @@ void ev_presentation_timer_set_time (EvPresentationTimer *ev_timer, gint time) { + if (!EV_IS_PRESENTATION_TIMER (ev_timer)) + return; if(ev_timer->priv->running) ev_timer->priv->remaining = ((ev_timer->priv->remaining)/(ev_timer->priv->time)*time); - ev_timer->priv->time = (time < -1)? -1:time; } -- 2.43.5