Mercurial > geeqie
diff src/filedata.c @ 1598:c03a8e19a43a
expose the file grouping flag to the user
author | nadvornik |
---|---|
date | Sat, 09 May 2009 19:45:24 +0000 |
parents | 24a12aa0cb54 |
children | 9e6cdef3bc3d |
line wrap: on
line diff
--- a/src/filedata.c Sat May 09 19:25:51 2009 +0000 +++ b/src/filedata.c Sat May 09 19:45:24 2009 +0000 @@ -670,6 +670,7 @@ void file_data_disable_grouping(FileData *fd, gboolean disable) { if (!fd->disable_grouping == !disable) return; + fd->disable_grouping = !!disable; if (disable) @@ -678,7 +679,6 @@ { FileData *parent = file_data_ref(fd->parent); file_data_disconnect_sidecar_file(parent, fd); - file_data_send_notification(fd, NOTIFY_GROUPING); file_data_send_notification(parent, NOTIFY_GROUPING); file_data_unref(parent); } @@ -693,18 +693,37 @@ file_data_disconnect_sidecar_file(fd, sfd); file_data_send_notification(sfd, NOTIFY_GROUPING); } - file_data_send_notification(fd, NOTIFY_GROUPING); file_data_check_sidecars((FileData *)sidecar_files->data, FALSE); /* this will group the sidecars back together */ filelist_free(sidecar_files); } + else + { + file_data_increment_version(fd); /* the functions called in the cases above increments the version too */ + } } else { + file_data_increment_version(fd); file_data_check_sidecars(fd, FALSE); - file_data_send_notification(fd, NOTIFY_GROUPING); + } + file_data_send_notification(fd, NOTIFY_GROUPING); +} + +void file_data_disable_grouping_list(GList *fd_list, gboolean disable) +{ + GList *work; + + work = fd_list; + while (work) + { + FileData *fd = work->data; + + file_data_disable_grouping(fd, disable); + work = work->next; } } + /* compare name without extension */ gint file_data_compare_name_without_ext(FileData *fd1, FileData *fd2) {