comparison src/slideshow.c @ 89:b3149a34d0dd

Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net> * img-view.c: Use correct method to close the window using Escape key, fixes bug #1231845. Also added more robust method to update window list when a window is closed so this doesn't happen again. * slideshow.c: Add sanity checks to exported functions to check for NULL SlideShow pointers, to match rest of coding style.
author gqview
date Sat, 28 Oct 2006 18:49:38 +0000
parents d907d608745f
children 197b8d2e52ce
comparison
equal deleted inserted replaced
88:2099ee3f9a8d 89:b3149a34d0dd
23 static void slideshow_timer_reset(SlideShowData *ss, gint reset); 23 static void slideshow_timer_reset(SlideShowData *ss, gint reset);
24 24
25 25
26 void slideshow_free(SlideShowData *ss) 26 void slideshow_free(SlideShowData *ss)
27 { 27 {
28 if (!ss) return;
29
28 slideshow_timer_reset(ss, FALSE); 30 slideshow_timer_reset(ss, FALSE);
29 31
30 if (ss->stop_func) ss->stop_func(ss, ss->stop_data); 32 if (ss->stop_func) ss->stop_func(ss, ss->stop_data);
31 33
32 if (ss->path_list) path_list_free(ss->path_list); 34 if (ss->path_list) path_list_free(ss->path_list);
116 gint slideshow_should_continue(SlideShowData *ss) 118 gint slideshow_should_continue(SlideShowData *ss)
117 { 119 {
118 const gchar *imd_path; 120 const gchar *imd_path;
119 const gchar *path; 121 const gchar *path;
120 122
123 if (!ss) return FALSE;
124
121 imd_path = image_get_path(ss->imd); 125 imd_path = image_get_path(ss->imd);
122 126
123 if ( ((imd_path == NULL) != (ss->slide_path == NULL)) || 127 if ( ((imd_path == NULL) != (ss->slide_path == NULL)) ||
124 (imd_path && ss->slide_path && strcmp(imd_path, ss->slide_path) != 0) ) return FALSE; 128 (imd_path && ss->slide_path && strcmp(imd_path, ss->slide_path) != 0) ) return FALSE;
125 129
282 } 286 }
283 } 287 }
284 288
285 void slideshow_next(SlideShowData *ss) 289 void slideshow_next(SlideShowData *ss)
286 { 290 {
291 if (!ss) return;
292
287 if (!slideshow_step(ss, TRUE)) 293 if (!slideshow_step(ss, TRUE))
288 { 294 {
289 slideshow_free(ss); 295 slideshow_free(ss);
290 return; 296 return;
291 } 297 }
293 slideshow_timer_reset(ss, TRUE); 299 slideshow_timer_reset(ss, TRUE);
294 } 300 }
295 301
296 void slideshow_prev(SlideShowData *ss) 302 void slideshow_prev(SlideShowData *ss)
297 { 303 {
304 if (!ss) return;
305
298 if (!slideshow_step(ss, FALSE)) 306 if (!slideshow_step(ss, FALSE))
299 { 307 {
300 slideshow_free(ss); 308 slideshow_free(ss);
301 return; 309 return;
302 } 310 }