diff options
author | Andrea Weikert <elubie@gmx.net> | 2011-03-20 14:16:59 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2011-03-20 14:16:59 +0300 |
commit | e73a2020dd1450a709d8da53af9132e08c811226 (patch) | |
tree | 7930fd4934a75472cc10db8e312f25d20c641fa0 /source/blender/editors/space_file/filelist.c | |
parent | 5325f3b2e989a3b94e2d9450c574e4610d2005d8 (diff) |
== filebrowser == Code cleanup
* Separate out selection flags from file type flags, was bothering me since forever ;)
* Also renamed ACTIVEFILE to SELECTED_FILE to better reflect actual usage in code.
* Fix crash introduced with last commit, better check for valid selection
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 3c76b815a80..649c2dadc0c 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -914,15 +914,15 @@ void filelist_swapselect(struct FileList* filelist) file= filelist->filelist; for(num=0; num<filelist->numfiles; num++, file++) { - if(file->flags & ACTIVEFILE) { + if(file->selflag & SELECTED_FILE) { act= 1; break; } } file= filelist->filelist+2; for(num=2; num<filelist->numfiles; num++, file++) { - if(act) file->flags &= ~ACTIVEFILE; - else file->flags |= ACTIVEFILE; + if(act) file->selflag &= ~SELECTED_FILE; + else file->selflag |= SELECTED_FILE; } } @@ -936,13 +936,13 @@ void filelist_select(struct FileList* filelist, FileSelection* sel, FileSelType switch (select) { case FILE_SEL_REMOVE: - file->flags &= ~flag; + file->selflag &= ~flag; break; case FILE_SEL_ADD: - file->flags |= flag; + file->selflag |= flag; break; case FILE_SEL_TOGGLE: - file->flags ^= flag; + file->selflag ^= flag; break; } } @@ -1183,10 +1183,10 @@ void filelist_from_main(struct FileList *filelist) #if 0 // XXXXX TODO show the selection status of the objects if(!filelist->has_func) { /* F4 DATA BROWSE */ if(idcode==ID_OB) { - if( ((Object *)id)->flag & SELECT) files->flags |= ACTIVEFILE; + if( ((Object *)id)->flag & SELECT) files->selflag |= SELECTED_FILE; } else if(idcode==ID_SCE) { - if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->flags |= ACTIVEFILE; + if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->selflag |= SELECTED_FILE; } } #endif |