diff options
author | Andrea Weikert <elubie@gmx.net> | 2011-03-14 22:56:13 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2011-03-14 22:56:13 +0300 |
commit | 41c27cd6efa70f9a7a8135a0dcbf483c766db18c (patch) | |
tree | f646f073692d2a632689ad1118a0ed69cc995754 /source/blender/editors/space_file/filelist.c | |
parent | d789484dc707ca46ab84af0fe1c14eb9e4ce5933 (diff) |
== filebrowser ==
Cleanup of selection code.
Also fixed bug where selection outside the tiles was clamped and file in last column was selected.
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 42efa5d4a3b..5fb64b2f2bc 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -926,6 +926,23 @@ void filelist_swapselect(struct FileList* filelist) } } +void filelist_select(struct FileList* filelist, FileSelection* sel, short select, unsigned int flag) +{ + /* select all valid files between first and last indicated */ + if ( (sel->first >= 0) && (sel->first < filelist->numfiltered) && (sel->last >= 0) && (sel->last < filelist->numfiltered) ) { + int current_file; + for (current_file = sel->first; current_file <= sel->last; current_file++) { + struct direntry* file = filelist_file(filelist, current_file); + + if (select) + file->flags |= flag; + else + file->flags &= ~flag; + } + } +} + + void filelist_sort(struct FileList* filelist, short sort) { switch(sort) { |