Mercurial > hg > forks > geeqie
changeset 965:0dc21b9935ca
keep files with non-zero marks in memory
author | Vladimir Nadvornik <nadvornik@suse.cz> |
---|---|
date | Sat, 16 Aug 2008 20:57:40 +0000 |
parents | 77a9952eebd4 |
children | 0771ea1b8fcd |
files | src/filedata.c |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/filedata.c Sat Aug 16 20:34:14 2008 +0000 +++ b/src/filedata.c Sat Aug 16 20:57:40 2008 +0000 @@ -1061,9 +1061,20 @@ void file_data_set_mark(FileData *fd, gint n, gboolean value) { + guint old = fd->marks; if (!value == !(fd->marks & (1 << n))) return; fd->marks = fd->marks ^ (1 << n); + + if (old && !fd->marks) /* keep files with non-zero marks in memory */ + { + file_data_unref(fd); + } + else if (!old && fd->marks) + { + file_data_ref(fd); + } + file_data_increment_version(fd); file_data_send_notification(fd, NOTIFY_TYPE_INTERNAL); }