diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:58:02 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:59:24 +0300 |
commit | 7bc6fbf158556331e247b714f874b919b9af9ae7 (patch) | |
tree | c5b3c883d6a4243f2f11bbac9306abdee07e1207 /source/blender/editors/space_file/file_draw.c | |
parent | fca515838e70f8bec7028b840bb921a1be9fabbb (diff) |
Cleanup: current/parent paths: add helpers in BLI_path_utils.
Also, avoid calling ugly strcmp with '.' or '..', making direct char checks is
much cheaper here!
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 836e1f80765..98e0a176b0e 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -239,7 +239,7 @@ static void draw_tile(int sx, int sy, int width, int height, int colorid, int sh static int get_file_icon(struct direntry *file) { if (file->type & S_IFDIR) { - if (STREQ(file->relname, "..")) { + if (FILENAME_IS_PARENT(file->relname)) { return ICON_FILE_PARENT; } if (file->flags & FILE_TYPE_APPLICATIONBUNDLE) { @@ -529,7 +529,7 @@ void file_draw_list(const bContext *C, ARegion *ar) int shade = (params->active_file == i) || (file->selflag & FILE_SEL_HIGHLIGHTED) ? 20 : 0; /* readonly files (".." and ".") must not be drawn as selected - set color back to normal */ - if (STREQ(file->relname, "..") || STREQ(file->relname, ".")) { + if (FILENAME_IS_CURRPAR(file->relname)) { colorid = TH_BACK; } draw_tile(sx, sy - 1, layout->tile_w + 4, sfile->layout->tile_h + layout->tile_border_y, colorid, shade); @@ -538,7 +538,7 @@ void file_draw_list(const bContext *C, ARegion *ar) UI_draw_roundbox_corner_set(UI_CNR_NONE); /* don't drag parent or refresh items */ - do_drag = !(STREQ(file->relname, "..") || STREQ(file->relname, ".")); + do_drag = !(FILENAME_IS_CURRPAR(file->relname)); if (FILE_IMGDISPLAY == params->display) { is_icon = 0; |