diff options
Diffstat (limited to 'source/blender/src/imasel.c')
-rw-r--r-- | source/blender/src/imasel.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/src/imasel.c b/source/blender/src/imasel.c index be9f489ea49..f502445d329 100644 --- a/source/blender/src/imasel.c +++ b/source/blender/src/imasel.c @@ -80,3 +80,26 @@ void free_imasel(SpaceImaSel *simasel) } } +/* resets a previous imagebrowser space type */ +/* is used when opening an imagebrowser directly from windowtype_pupmenu, + since in that case we don't want any load/save/append/link action +*/ +void reset_imaselspace(ScrArea *sa) +{ + if(sa->spacetype==SPACE_IMASEL) { + SpaceImaSel *simasel= sa->spacedata.first; + if(simasel->type==FILE_MAIN) { + if (simasel->files) { + BIF_filelist_free(simasel->files); + BIF_filelist_settype(simasel->files, FILE_MAIN); + } + } else { + if (simasel->files) { + simasel->type= FILE_UNIX; + BIF_filelist_settype(simasel->files, simasel->type); + } + } + simasel->returnfunc= NULL; + simasel->title[0]= 0; + } +} |