diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-01 05:58:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-05-01 05:59:25 +0400 |
commit | 7b0bce19468cf83f1198145a9c6b1408b04f91a1 (patch) | |
tree | 974637d661ec51fbb7ddc9e73567e14d066983ba /source/blender/windowmanager | |
parent | 60c8c130fed60dc1fe5387b960549385188feadf (diff) |
Code cleanup: remove redundant filename copy & simplify splash
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index a4355afbbfc..a73532680c5 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1770,11 +1770,10 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiBut *but; uiLayout *layout, *split, *col; uiStyle *style = UI_GetStyle(); - struct RecentFile *recent; + const struct RecentFile *recent; int i; MenuType *mt = WM_menutype_find("USERPREF_MT_splash", true); char url[96]; - char file[FILE_MAX]; #ifndef WITH_HEADLESS extern char datatoc_splash_png[]; @@ -1914,11 +1913,10 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemL(col, IFACE_("Recent"), ICON_NONE); for (recent = G.recent_files.first, i = 0; (i < 5) && (recent); recent = recent->next, i++) { - BLI_split_file_part(recent->filepath, file, sizeof(file)); - if (BLO_has_bfile_extension(file)) - uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath); - else - uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BACKUP, "WM_OT_open_mainfile", "filepath", recent->filepath); + const char *filename = BLI_path_basename(recent->filepath); + uiItemStringO(col, filename, + BLO_has_bfile_extension(filename) ? ICON_FILE_BLEND : ICON_FILE_BACKUP, + "WM_OT_open_mainfile", "filepath", recent->filepath); } uiItemS(col); |