misc edits
authorCampbell Barton <ideasman42@gmail.com>
Sat, 15 Oct 2011 05:01:47 +0000 (05:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 15 Oct 2011 05:01:47 +0000 (05:01 +0000)
- 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

po/update_msg.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/intern/readfile.c
source/blender/editors/include/ED_fileselect.h
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/filelist.c
source/creator/CMakeLists.txt

index 5986d96f14b333f98b9f71262c3030dfb65b6403..7cc7ee50b63af977e815440662552ee5f4d9ee79 100644 (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):
 
index 9b93fd18bacaaa46435d86a36f766cc2396eb787..068e5a2659a404a71df8568978ae29780a49bace 100644 (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"
 
index 479314777284ac5639c098c919f00f844dff0cd8..e7be98d955d5daacc8dca9fe2b76a4dd0dfdc43a 100644 (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
index 7d84eeba9c857e10d299af4cf073e4da2a1fcf71..76070e42f29f097d1a07630b051fe8fef1597076 100644 (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"));
 }
index 1eedd7ec782bc21a78718cc85d6d5d405ac9f34b..df4113ca07a3ef43d7a8008442fc7069089c99f2 100644 (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 */
 
index 611bf79603e9b3f3a5dd760c97c9d9cad72ab1aa..85edcce35ca1b2a80e4d4fcb2a9b23df5a618669 100644 (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);
index c2e45c5ad8ae8f60be2833b4e2e7356fedf3f9d5..b478976d02702f8455844cded97b33f15a319cbf 100644 (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);
        
index 0650a5678b2e7be28e0deccef4c6bc8b14d0237b..e7a1ff14f03e597b3f634112429871632d9679e8 100644 (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
                )