diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-14 02:34:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-14 02:34:53 +0300 |
commit | 7ad9ca72ddc789479e92fa4dc898740642eb04da (patch) | |
tree | 301d5e75b27b6d89da8144562da92b1d5cadc7ee /source/blender/editors/space_info/space_info.c | |
parent | b7c42ef93edeadc28015a6eae184ff07f26e9c36 (diff) |
Cleanup: replace BLI_split_file_part w/ BLI_path_basename
Diffstat (limited to 'source/blender/editors/space_info/space_info.c')
-rw-r--r-- | source/blender/editors/space_info/space_info.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index 062fc0cd42e..3bebac156a4 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -282,16 +282,13 @@ static void info_header_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegi static void recent_files_menu_draw(const bContext *UNUSED(C), Menu *menu) { struct RecentFile *recent; - char file[FILE_MAX]; uiLayout *layout = menu->layout; uiLayoutSetOperatorContext(layout, WM_OP_EXEC_REGION_WIN); - if (G.recent_files.first) { + if (!BLI_listbase_is_empty(&G.recent_files)) { for (recent = G.recent_files.first; (recent); recent = recent->next) { - BLI_split_file_part(recent->filepath, file, sizeof(file)); - if (BLO_has_bfile_extension(file)) - uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); - else - uiItemStringO(layout, BLI_path_basename(recent->filepath), ICON_FILE_BACKUP, "WM_OT_open_mainfile", "filepath", recent->filepath); + const char *file = BLI_path_basename(recent->filepath); + const int icon = BLO_has_bfile_extension(file) ? ICON_FILE_BLEND : ICON_FILE_BACKUP; + uiItemStringO(layout, file, icon, "WM_OT_open_mainfile", "filepath", recent->filepath); } } else { |