UI: Window Title With Version #111998

Merged
Harley Acheson merged 14 commits from Harley/blender:WindowTitle into main 2023-09-16 02:37:12 +02:00
1 changed files with 7 additions and 8 deletions
Showing only changes of commit 31299bdc22 - Show all commits

View File

@ -483,17 +483,16 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
}
else if (win->ghostwin) {
char str[sizeof(Main::filepath) + 24];
const char *filename = (BKE_main_blendfile_path_from_global()[0]) ?
const char *filepath = (BKE_main_blendfile_path_from_global()[0]) ?
Harley marked this conversation as resolved Outdated

Use filepath for full path names.

Use `filepath` for full path names.

Calling twice (while not a problem) is a bit odd, would just do:

const char *filepath = BKE_main_blendfile_path_from_global(); then have the ternary operator within the SNPRINTF statement.

Calling twice (while not a problem) is a bit odd, would just do: `const char *filepath = BKE_main_blendfile_path_from_global();` then have the ternary operator within the SNPRINTF statement.
BKE_main_blendfile_path_from_global() :
IFACE_("(Unsaved)");
BLI_snprintf(str,
sizeof(str),
"%s%s%s - Blender %s",
wm->file_saved ? "" : "*",
filename,
G_MAIN->recovered ? " (Recovered)" : "",
BKE_blender_version_string());
SNPRINTF(str,
Harley marked this conversation as resolved Outdated

SNPRINTF should still be used here.

`SNPRINTF` should still be used here.
"%s%s%s - Blender %s",
wm->file_saved ? "" : "*",
filepath,
G_MAIN->recovered ? " (Recovered)" : "",
BKE_blender_version_string());
GHOST_SetTitle(static_cast<GHOST_WindowHandle>(win->ghostwin), str);
/* Informs GHOST of unsaved changes, to set window modified visual indicator (macOS)