diff src/img-view.c @ 118:ac0f7f942c4d

Wed Nov 29 22:53:03 2006 John Ellis <johne@verizon.net> * image-overlay.[ch]: Prepare for icon notification display, and fix info overlay image index when on last image of slideshow. * img-view.c: Fix image index when on last image of slideshow.
author gqview
date Thu, 30 Nov 2006 03:56:25 +0000
parents 0c2e1f0a001b
children e2a8b7f2165b
line wrap: on
line diff
--- a/src/img-view.c	Wed Nov 29 19:38:25 2006 +0000
+++ b/src/img-view.c	Thu Nov 30 03:56:25 2006 +0000
@@ -216,6 +216,7 @@
 		work = work->prev;
 		if (work) work_ahead = work->prev;
 		}
+
 	if (!work) return;
 
 	vw->list_pointer = work;
@@ -747,8 +748,28 @@
 static void view_slideshow_stop_func(SlideShowData *fs, gpointer data)
 {
 	ViewWindow *vw = data;
+	GList *work;
+	const gchar *path;
 
 	vw->ss = NULL;
+
+	work = vw->list;
+	path = image_get_path(view_window_active_image(vw));
+	while (work)
+		{
+		gchar *temp;
+
+		temp = work->data;
+		if (strcmp(path, temp) == 0)
+			{
+			vw->list_pointer = work;
+			work = NULL;
+			}
+		else
+			{
+			work = work->next;
+			}
+		}
 }
 
 static void view_slideshow_start(ViewWindow *vw)
@@ -1015,9 +1036,13 @@
 			if (vw->ss)
 				{
 				gint n;
+				gint t;
+
 				n = g_list_length(vw->ss->list_done);
+				t = n + g_list_length(vw->ss->list);
+				if (n == 0) n = t;
 				if (index) *index = n - 1;
-				if (total) *total = n + g_list_length(vw->ss->list);
+				if (total) *total = t;
 				}
 			else
 				{