Mercurial > geeqie
comparison src/filedata.c @ 1729:672ee190869e
improved printing of selection
author | nadvornik |
---|---|
date | Fri, 28 Aug 2009 21:01:29 +0000 |
parents | 94ced97edf0b |
children | 67145eade000 |
comparison
equal
deleted
inserted
replaced
1728:94ced97edf0b | 1729:672ee190869e |
---|---|
2464 } | 2464 } |
2465 return TRUE; | 2465 return TRUE; |
2466 } | 2466 } |
2467 #endif | 2467 #endif |
2468 | 2468 |
2469 GList *file_data_process_groups_in_selection(GList *list, GList **ungrouped_list) | 2469 GList *file_data_process_groups_in_selection(GList *list, gboolean ungroup, GList **ungrouped_list) |
2470 { | 2470 { |
2471 GList *out = NULL; | 2471 GList *out = NULL; |
2472 GList *work = list; | 2472 GList *work = list; |
2473 | 2473 |
2474 /* change partial groups to independent files */ | 2474 /* change partial groups to independent files */ |
2475 while (work) | 2475 if (ungroup) |
2476 { | 2476 { |
2477 FileData *fd = work->data; | 2477 while (work) |
2478 work = work->next; | 2478 { |
2479 | 2479 FileData *fd = work->data; |
2480 if (!file_data_list_contains_whole_group(list, fd)) | 2480 work = work->next; |
2481 { | 2481 |
2482 file_data_disable_grouping(fd, TRUE); | 2482 if (!file_data_list_contains_whole_group(list, fd)) |
2483 if (ungrouped_list) | |
2484 { | 2483 { |
2485 *ungrouped_list = g_list_prepend(*ungrouped_list, file_data_ref(fd)); | 2484 file_data_disable_grouping(fd, TRUE); |
2485 if (ungrouped_list) | |
2486 { | |
2487 *ungrouped_list = g_list_prepend(*ungrouped_list, file_data_ref(fd)); | |
2488 } | |
2486 } | 2489 } |
2487 } | 2490 } |
2488 } | 2491 } |
2489 | 2492 |
2490 /* remove sidecars from the list, | 2493 /* remove sidecars from the list, |
2493 while (work) | 2496 while (work) |
2494 { | 2497 { |
2495 FileData *fd = work->data; | 2498 FileData *fd = work->data; |
2496 work = work->next; | 2499 work = work->next; |
2497 | 2500 |
2498 if (!fd->parent) | 2501 if (!fd->parent || |
2499 { | 2502 (!ungroup && !file_data_list_contains_whole_group(list, fd))) |
2500 out = g_list_prepend(out, fd); | 2503 { |
2501 } | 2504 out = g_list_prepend(out, file_data_ref(fd)); |
2502 else | 2505 } |
2503 { | 2506 } |
2504 file_data_unref(fd); | 2507 |
2505 } | 2508 filelist_free(list); |
2506 } | |
2507 | |
2508 g_list_free(list); | |
2509 out = g_list_reverse(out); | 2509 out = g_list_reverse(out); |
2510 | 2510 |
2511 return out; | 2511 return out; |
2512 } | 2512 } |
2513 | 2513 |