Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_files.c
| Show First 20 Lines • Show All 992 Lines • ▼ Show 20 Lines | |||||
| /** \name Save Main .blend File Operator | /** \name Save Main .blend File Operator | ||||
| * | * | ||||
| * Both #WM_OT_save_as_mainfile & #WM_OT_save_mainfile. | * Both #WM_OT_save_as_mainfile & #WM_OT_save_mainfile. | ||||
| * \{ */ | * \{ */ | ||||
| static void wm_filepath_default(const Main *bmain, char *filepath) | static void wm_filepath_default(const Main *bmain, char *filepath) | ||||
| { | { | ||||
| if (bmain->filepath[0] == '\0') { | if (bmain->filepath[0] == '\0') { | ||||
| BLI_path_filename_ensure(filepath, FILE_MAX, "untitled.blend"); | char untitled[64]; | ||||
mont29: would prefer more correct name, something like `filename_untiltled` e.g.
Will do the change… | |||||
mont29Unsubmitted Not Done Inline ActionsAlso better to use FILE_MAXFILE here, for consistency. mont29: Also better to use `FILE_MAXFILE` here, for consistency. | |||||
| SNPRINTF(untitled, "%s.blend", DATA_("untitled")); | |||||
| BLI_path_filename_ensure(filepath, FILE_MAX, untitled); | |||||
| } | } | ||||
| } | } | ||||
| static void save_set_compress(wmOperator *op) | static void save_set_compress(wmOperator *op) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| prop = RNA_struct_find_property(op->ptr, "compress"); | prop = RNA_struct_find_property(op->ptr, "compress"); | ||||
| ▲ Show 20 Lines • Show All 616 Lines • ▼ Show 20 Lines | |||||
| /* Filename. */ | /* Filename. */ | ||||
| const char *blendfile_path = BKE_main_blendfile_path(CTX_data_main(C)); | const char *blendfile_path = BKE_main_blendfile_path(CTX_data_main(C)); | ||||
| char filename[FILE_MAX]; | char filename[FILE_MAX]; | ||||
| if (blendfile_path[0] != '\0') { | if (blendfile_path[0] != '\0') { | ||||
| BLI_split_file_part(blendfile_path, filename, sizeof(filename)); | BLI_split_file_part(blendfile_path, filename, sizeof(filename)); | ||||
| } | } | ||||
| else { | else { | ||||
| STRNCPY(filename, "untitled.blend"); | SNPRINTF(filename, "%s.blend", DATA_("untitled")); | ||||
| } | } | ||||
| uiItemL(layout, filename, ICON_NONE); | uiItemL(layout, filename, ICON_NONE); | ||||
| /* Image Saving Warnings. */ | /* Image Saving Warnings. */ | ||||
| ReportList reports; | ReportList reports; | ||||
| BKE_reports_init(&reports, RPT_STORE); | BKE_reports_init(&reports, RPT_STORE); | ||||
| uint modified_images_count = ED_image_save_all_modified_info(bmain, &reports); | uint modified_images_count = ED_image_save_all_modified_info(bmain, &reports); | ||||
| ▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines | |||||
would prefer more correct name, something like filename_untiltled e.g.
Will do the change while committing.