comparison src/main.c @ 576:9dc0513837b5

dropped path_list functions, use filelist functions everywhere
author nadvornik
date Sun, 04 May 2008 21:54:20 +0000
parents fe675761d091
children 905688aa2317
comparison
equal deleted inserted replaced
575:b941403a4cd9 576:9dc0513837b5
367 367
368 static void gr_slideshow_start_rec(const gchar *text, gpointer data) 368 static void gr_slideshow_start_rec(const gchar *text, gpointer data)
369 { 369 {
370 GList *list; 370 GList *list;
371 371
372 list = path_list_recursive(text); 372 list = filelist_recursive(text);
373 if (!list) return; 373 if (!list) return;
374 //printf("length: %d\n", g_list_length(list)); 374 //printf("length: %d\n", g_list_length(list));
375 layout_image_slideshow_stop(NULL); 375 layout_image_slideshow_stop(NULL);
376 layout_image_slideshow_start_from_list(NULL, list); 376 layout_image_slideshow_start_from_list(NULL, list);
377 } 377 }
749 } 749 }
750 750
751 work = cmd_list; 751 work = cmd_list;
752 while (work) 752 while (work)
753 { 753 {
754 const gchar *name; 754 FileData *fd;
755 gchar *text; 755 gchar *text;
756 756
757 name = work->data; 757 fd = work->data;
758 work = work->next; 758 work = work->next;
759 759
760 text = g_strconcat(prefix, name, NULL); 760 text = g_strconcat(prefix, fd->path, NULL);
761 remote_client_send(rc, text); 761 remote_client_send(rc, text);
762 g_free(text); 762 g_free(text);
763 763
764 sent = TRUE; 764 sent = TRUE;
765 } 765 }
830 } 830 }
831 else 831 else
832 { 832 {
833 if (!*path) *path = remove_level_from_path(path_parsed); 833 if (!*path) *path = remove_level_from_path(path_parsed);
834 if (!*file) *file = g_strdup(path_parsed); 834 if (!*file) *file = g_strdup(path_parsed);
835 *list = g_list_prepend(*list, path_parsed); 835 *list = g_list_prepend(*list, file_data_new_simple(path_parsed));
836 } 836 }
837 } 837 }
838 838
839 static void parse_command_line_add_dir(const gchar *dir, gchar **path, gchar **file, 839 static void parse_command_line_add_dir(const gchar *dir, gchar **path, gchar **file,
840 GList **list) 840 GList **list)
843 gchar *path_parsed; 843 gchar *path_parsed;
844 844
845 path_parsed = g_strdup(dir); 845 path_parsed = g_strdup(dir);
846 parse_out_relatives(path_parsed); 846 parse_out_relatives(path_parsed);
847 847
848 if (path_list(path_parsed, &files, NULL)) 848 if (filelist_read(path_parsed, &files, NULL))
849 { 849 {
850 GList *work; 850 GList *work;
851 851
852 files = path_list_filter(files, FALSE); 852 files = filelist_filter(files, FALSE);
853 files = path_list_sort(files); 853 files = filelist_sort_path(files);
854 854
855 work = files; 855 work = files;
856 while (work) 856 while (work)
857 { 857 {
858 gchar *p; 858 FileData *fd = work->data;
859 859 if (!*path) *path = remove_level_from_path(fd->path);
860 p = work->data; 860 if (!*file) *file = g_strdup(fd->path);
861 if (!*path) *path = remove_level_from_path(p); 861 *list = g_list_prepend(*list, fd);
862 if (!*file) *file = g_strdup(p);
863 *list = g_list_prepend(*list, p);
864 862
865 work = work->next; 863 work = work->next;
866 } 864 }
867 865
868 g_list_free(files); 866 g_list_free(files);
1072 { 1070 {
1073 *cmd_list = list; 1071 *cmd_list = list;
1074 } 1072 }
1075 else 1073 else
1076 { 1074 {
1077 path_list_free(list); 1075 filelist_free(list);
1078 *cmd_list = NULL; 1076 *cmd_list = NULL;
1079 } 1077 }
1080 } 1078 }
1081 1079
1082 static void parse_command_line_for_debug_option(int argc, char *argv[]) 1080 static void parse_command_line_for_debug_option(int argc, char *argv[])
1372 { 1370 {
1373 g_free(cmd_path); 1371 g_free(cmd_path);
1374 cmd_path = NULL; 1372 cmd_path = NULL;
1375 g_free(cmd_file); 1373 g_free(cmd_file);
1376 cmd_file = NULL; 1374 cmd_file = NULL;
1377 path_list_free(cmd_list); 1375 filelist_free(cmd_list);
1378 cmd_list = NULL; 1376 cmd_list = NULL;
1379 path_list_free(collection_list); 1377 string_list_free(collection_list);
1380 collection_list = NULL; 1378 collection_list = NULL;
1381 1379
1382 path = NULL; 1380 path = NULL;
1383 } 1381 }
1384 else if (cmd_path) 1382 else if (cmd_path)
1483 image_osd_set(lw->image, FALSE, (options->image_overlay.common.show_at_startup || options->image_overlay.common.enabled)); 1481 image_osd_set(lw->image, FALSE, (options->image_overlay.common.show_at_startup || options->image_overlay.common.enabled));
1484 1482
1485 g_free(geometry); 1483 g_free(geometry);
1486 g_free(cmd_path); 1484 g_free(cmd_path);
1487 g_free(cmd_file); 1485 g_free(cmd_file);
1488 path_list_free(cmd_list); 1486 filelist_free(cmd_list);
1489 path_list_free(collection_list); 1487 string_list_free(collection_list);
1490 g_free(path); 1488 g_free(path);
1491 1489
1492 if (startup_full_screen) layout_image_full_screen_start(lw); 1490 if (startup_full_screen) layout_image_full_screen_start(lw);
1493 if (startup_in_slideshow) layout_image_slideshow_start(lw); 1491 if (startup_in_slideshow) layout_image_slideshow_start(lw);
1494 1492