From 5da894b1fe1214866d7b343fabab848e8f32a581 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 15 Oct 2011 05:01:47 +0000 Subject: misc edits - cmake/windows was installing locale & font when internationalization was disabled, twice when enabled. - file selector was using the string size-1, where this isn't needed since string buttons expected this value to be the sizeof(), accounting for '\0'. - use const char for extension checking funcs. - minor pep8 edits --- source/blender/blenloader/BLO_readfile.h | 2 +- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/editors/include/ED_fileselect.h | 2 +- source/blender/editors/space_file/file_draw.c | 4 ++-- source/blender/editors/space_file/filelist.c | 4 ++-- source/creator/CMakeLists.txt | 10 +--------- 6 files changed, 8 insertions(+), 16 deletions(-) (limited to 'source') diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 47931477728..e7be98d955d 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -204,7 +204,7 @@ BLO_blendhandle_close( #define GROUP_MAX 32 -int BLO_has_bfile_extension(char *str); +int BLO_has_bfile_extension(const char *str); /* return ok when a blenderfile, in dir is the filename, * in group the type of libdata diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7d84eeba9c8..76070e42f29 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1048,7 +1048,7 @@ void blo_freefiledata(FileData *fd) /* ************ DIV ****************** */ -int BLO_has_bfile_extension(char *str) +int BLO_has_bfile_extension(const char *str) { return (BLI_testextensie(str, ".ble") || BLI_testextensie(str, ".blend") || BLI_testextensie(str, ".blend.gz")); } diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 1eedd7ec782..df4113ca07a 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -106,7 +106,7 @@ void ED_fileselect_clear(struct bContext *C, struct SpaceFile *sfile); void ED_fileselect_exit(struct bContext *C, struct SpaceFile *sfile); -int ED_file_extension_icon(char *relname); +int ED_file_extension_icon(const char *relname); #endif /* ED_FILES_H */ diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 611bf79603e..85edcce35ca 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -181,7 +181,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) but = uiDefButTextO(block, TEX, "FILE_OT_directory", 0, "", min_x, line1_y, line1_w-chan_offs, btn_h, - params->dir, 0.0, (float)FILE_MAX-1, 0, 0, + params->dir, 0.0, (float)FILE_MAX, 0, 0, UI_translate_do_tooltip(N_("File path"))); uiButSetCompleteFunc(but, autocomplete_directory, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); @@ -189,7 +189,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) if((params->flag & FILE_DIRSEL_ONLY) == 0) { but = uiDefBut(block, TEX, B_FS_FILENAME, "", min_x, line2_y, line2_w-chan_offs, btn_h, - params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, + params->file, 0.0, (float)FILE_MAXFILE, 0, 0, UI_translate_do_tooltip(overwrite_alert ?N_("File name, overwrite existing") : N_("File name"))); uiButSetCompleteFunc(but, autocomplete_file, NULL); uiButSetFlag(but, UI_BUT_NO_UTF8); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index c2e45c5ad8a..b478976d027 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -736,7 +736,7 @@ static int file_is_blend_backup(const char *str) } -static int file_extension_type(char *relname) +static int file_extension_type(const char *relname) { if(BLO_has_bfile_extension(relname)) { return BLENDERFILE; @@ -769,7 +769,7 @@ static int file_extension_type(char *relname) return 0; } -int ED_file_extension_icon(char *relname) +int ED_file_extension_icon(const char *relname) { int type= file_extension_type(relname); diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 0650a5678b2..e7a1ff14f03 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -443,14 +443,6 @@ elseif(WIN32) endif() endif() - install( # same as linux!, deduplicate - DIRECTORY - ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale - ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts - DESTINATION ${TARGETDIR_VER}/datafiles - PATTERN ".svn" EXCLUDE - ) - # plugins in blender 2.5 don't work at the moment. # # install( @@ -656,8 +648,8 @@ elseif(APPLE) if(WITH_INTERNATIONAL) install( DIRECTORY - ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale + ${CMAKE_SOURCE_DIR}/release/bin/.blender/fonts DESTINATION ${TARGETDIR_VER}/datafiles PATTERN ".svn" EXCLUDE ) -- cgit v1.2.3