changeset 745:41dc324ee014

slideshow_next(), slideshow_prev(): move code to common slideshow_move(), reducing code redundancy.
author zas_
date Fri, 23 May 2008 12:27:28 +0000
parents eb7e0d3206a2
children 9cf7d61a2e7f
files src/slideshow.c
diffstat 1 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/slideshow.c	Fri May 23 12:19:42 2008 +0000
+++ b/src/slideshow.c	Fri May 23 12:27:28 2008 +0000
@@ -152,7 +152,7 @@
 	return FALSE;
 }
 
-static gint slideshow_step(SlideShowData *ss, gint forward)
+static gint slideshow_step(SlideShowData *ss, gboolean forward)
 {
 	gint row;
 
@@ -288,11 +288,11 @@
 				       slideshow_loop_cb, ss);
 }
 
-void slideshow_next(SlideShowData *ss)
+static void slideshow_move(SlideShowData *ss, gboolean forward)
 {
 	if (!ss) return;
 
-	if (!slideshow_step(ss, TRUE))
+	if (!slideshow_step(ss, forward))
 		{
 		slideshow_free(ss);
 		return;
@@ -301,17 +301,14 @@
 	slideshow_timer_reset(ss);
 }
 
+void slideshow_next(SlideShowData *ss)
+{
+	slideshow_move(ss, TRUE);
+}
+
 void slideshow_prev(SlideShowData *ss)
 {
-	if (!ss) return;
-
-	if (!slideshow_step(ss, FALSE))
-		{
-		slideshow_free(ss);
-		return;
-		}
-
-	slideshow_timer_reset(ss);
+	slideshow_move(ss, FALSE);
 }
 
 static SlideShowData *real_slideshow_start(ImageWindow *imd, LayoutWindow *lw,