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
This commit is contained in:
2011-10-15 05:01:47 +00:00
parent 317b649bb2
commit 5da894b1fe
8 changed files with 14 additions and 19 deletions

View File

@@ -135,10 +135,12 @@ def dump_messages_rna(messages):
item.identifier,
)
# Here identifier and name can be the same!
if item.name: # and item.name != item.identifier:
messages.setdefault(item.name, []).append(msgsrc)
if item.name: # and item.name != item.identifier:
messages.setdefault(item.name,
[]).append(msgsrc)
if item.description:
messages.setdefault(item.description, []).append(msgsrc)
messages.setdefault(item.description,
[]).append(msgsrc)
def walkRNA(bl_rna):

View File

@@ -985,6 +985,7 @@ class VIEW3D_MT_make_links(Menu):
layout.operator("object.join_uvs") # stupid place to add this!
class VIEW3D_MT_object_game(Menu):
bl_label = "Game"

View File

@@ -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

View File

@@ -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"));
}

View File

@@ -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 */

View File

@@ -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);

View File

@@ -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);

View File

@@ -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
)