comparison src/slideshow.c @ 783:d6a7fb4b8e7c

replaced directory path with FileData* dir_fd
author nadvornik
date Tue, 03 Jun 2008 19:44:19 +0000
parents 41dc324ee014
children ad420f2eb789
comparison
equal deleted inserted replaced
782:3f7a0420c293 783:d6a7fb4b8e7c
33 33
34 if (ss->stop_func) ss->stop_func(ss, ss->stop_data); 34 if (ss->stop_func) ss->stop_func(ss, ss->stop_data);
35 35
36 if (ss->filelist) filelist_free(ss->filelist); 36 if (ss->filelist) filelist_free(ss->filelist);
37 if (ss->cd) collection_unref(ss->cd); 37 if (ss->cd) collection_unref(ss->cd);
38 g_free(ss->layout_path); 38 file_data_unref(ss->dir_fd);
39 39
40 g_list_free(ss->list); 40 g_list_free(ss->list);
41 g_list_free(ss->list_done); 41 g_list_free(ss->list_done);
42 42
43 file_data_unref(ss->slide_fd); 43 file_data_unref(ss->slide_fd);
118 } 118 }
119 119
120 gint slideshow_should_continue(SlideShowData *ss) 120 gint slideshow_should_continue(SlideShowData *ss)
121 { 121 {
122 FileData *imd_fd; 122 FileData *imd_fd;
123 const gchar *path; 123 FileData *dir_fd;
124 124
125 if (!ss) return FALSE; 125 if (!ss) return FALSE;
126 126
127 imd_fd = image_get_fd(ss->imd); 127 imd_fd = image_get_fd(ss->imd);
128 128
138 else 138 else
139 return FALSE; 139 return FALSE;
140 } 140 }
141 141
142 if (!ss->layout) return FALSE; 142 if (!ss->layout) return FALSE;
143 path = layout_get_path(ss->layout); 143 dir_fd = ss->layout->dir_fd;
144 144
145 if (path && ss->layout_path && 145 if (dir_fd && ss->dir_fd && dir_fd == ss->dir_fd)
146 strcmp(path, ss->layout_path) == 0)
147 { 146 {
148 if (ss->from_selection && ss->slide_count == layout_selection_count(ss->layout, NULL)) return TRUE; 147 if (ss->from_selection && ss->slide_count == layout_selection_count(ss->layout, NULL)) return TRUE;
149 if (!ss->from_selection && ss->slide_count == layout_list_count(ss->layout, NULL)) return TRUE; 148 if (!ss->from_selection && ss->slide_count == layout_list_count(ss->layout, NULL)) return TRUE;
150 } 149 }
151 150
326 ss->imd = imd; 325 ss->imd = imd;
327 326
328 ss->filelist = filelist; 327 ss->filelist = filelist;
329 ss->cd = cd; 328 ss->cd = cd;
330 ss->layout = lw; 329 ss->layout = lw;
331 ss->layout_path = NULL; 330 ss->dir_fd = NULL;
332 331
333 ss->list = NULL; 332 ss->list = NULL;
334 ss->list_done = NULL; 333 ss->list_done = NULL;
335 334
336 ss->from_selection = FALSE; 335 ss->from_selection = FALSE;
356 else 355 else
357 { 356 {
358 /* layout method */ 357 /* layout method */
359 358
360 ss->slide_count = layout_selection_count(ss->layout, NULL); 359 ss->slide_count = layout_selection_count(ss->layout, NULL);
361 ss->layout_path = g_strdup(layout_get_path(ss->layout)); 360 ss->dir_fd = file_data_ref(ss->layout->dir_fd);
362 if (ss->slide_count < 2) 361 if (ss->slide_count < 2)
363 { 362 {
364 ss->slide_count = layout_list_count(ss->layout, NULL); 363 ss->slide_count = layout_list_count(ss->layout, NULL);
365 if (!options->slideshow.random && start_point >= 0 && (guint) start_point < ss->slide_count) 364 if (!options->slideshow.random && start_point >= 0 && (guint) start_point < ss->slide_count)
366 { 365 {