FileSpace cleanup: make ED_path_extension_type public.

Maybe we should move it to BLI, but not sure how, and where (and its defines
are SpaceFile's ones, meh :| ).
This commit is contained in:
Bastien Montagne 2016-06-14 16:30:16 +02:00
parent c7e7c1b241
commit 9182e07c0e
2 changed files with 6 additions and 4 deletions

View File

@ -104,7 +104,8 @@ void ED_fileselect_clear(struct wmWindowManager *wm, struct ScrArea *sa, struct
void ED_fileselect_exit(struct wmWindowManager *wm, struct ScrArea *sa, struct SpaceFile *sfile);
int ED_file_extension_icon(const char *relname);
int ED_path_extension_type(const char *path);
int ED_file_extension_icon(const char *path);
void ED_file_read_bookmarks(void);

View File

@ -1925,7 +1925,8 @@ static bool file_is_blend_backup(const char *str)
return (retval);
}
static int path_extension_type(const char *path)
/* TODO: Maybe we should move this to BLI? On the other hand, it's using defines from spacefile area, so not sure... */
int ED_path_extension_type(const char *path)
{
if (BLO_has_bfile_extension(path)) {
return FILE_TYPE_BLENDER;
@ -1977,12 +1978,12 @@ static int file_extension_type(const char *dir, const char *relpath)
{
char path[FILE_MAX];
BLI_join_dirfile(path, sizeof(path), dir, relpath);
return path_extension_type(path);
return ED_path_extension_type(path);
}
int ED_file_extension_icon(const char *path)
{
int type = path_extension_type(path);
const int type = ED_path_extension_type(path);
switch (type) {
case FILE_TYPE_BLENDER: