code clear, insert blf_gettext.c to blf.c
authorXiao Xiangquan <xiaoxiangquan@gmail.com>
Fri, 12 Aug 2011 13:43:21 +0000 (13:43 +0000)
committerXiao Xiangquan <xiaoxiangquan@gmail.com>
Fri, 12 Aug 2011 13:43:21 +0000 (13:43 +0000)
SConstruct
release/scripts/startup/bl_operators/image.py
source/blender/blenfont/BLF_api.h
source/blender/blenfont/CMakeLists.txt
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_gettext.c [deleted file]
source/blender/blenfont/intern/blf_lang.c
source/blender/editors/include/ED_datafiles.h
source/blender/python/generic/blf_py_api.c

index 04d0a8f575431ff229600a7ca67caf24443ddb5c..14e43e37d65509a4db25f45b7cb0e90a79f179af 100644 (file)
@@ -512,12 +512,12 @@ if  env['OURPLATFORM']!='darwin':
                 
                 if 'locale' in dp or 'fonts' in dp:
                     datafileslist.append(os.path.join(dp,f))
-                    dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:]))    # skip bin/.blender
+                    dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[1:]))    # skip bin
                     datafilestargetlist.append(dir + os.sep + f)
 
                 else:
                     dotblendlist.append(os.path.join(dp, f))
-                    dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[1:]))    # skip bin/.blender
+                    dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[1:]))    # skip bin
                     dottargetlist.append(dir + os.sep + f)
                     
         dotblenderinstall = []
index 6fec536a9a6da42a00748dc06334ed1634bbb9ff..aca9b581b97be4a20b31a487be38c571c0705c56 100644 (file)
@@ -160,7 +160,8 @@ class ProjectEdit(bpy.types.Operator):
 
         filepath = os.path.basename(bpy.data.filepath)
         filepath = os.path.splitext(filepath)[0]
-        # filepath = bpy.path.clean_name(filepath) # fixes <memory> rubbish, needs checking
+        # fixes <memory> rubbish, needs checking
+        # filepath = bpy.path.clean_name(filepath)
 
         if bpy.data.is_saved:
             filepath = "//" + filepath
index 6f6003fa6701052e1e01d149003378c6c4e68aa0..837ca814fbfa24ecf812b9cdc06f98bc1fa806f0 100644 (file)
@@ -34,7 +34,6 @@
 #ifndef BLF_API_H
 #define BLF_API_H
 
-#include <stdlib.h>
 struct rctf;
 
 int BLF_init(int points, int dpi);
index cc677d39b10269c6b55838af353db8cdb1a23343..82099d4f125a9687d0d16f394da03919d91042fb 100644 (file)
@@ -40,7 +40,6 @@ set(SRC
        intern/blf.c
        intern/blf_dir.c
        intern/blf_font.c
-       intern/blf_gettext.c
        intern/blf_glyph.c
        intern/blf_lang.c
        intern/blf_util.c
index c0e62b1c0c70340d72bcf2b58efbebc2ecc8c33d..82094fdecdd5b5de7bde3d788998fbceda2ba5ff 100644 (file)
@@ -34,6 +34,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <libintl.h>
 #include <math.h>
 
 #include <ft2build.h>
@@ -299,6 +300,13 @@ void BLF_enable(int fontid, int option)
                font->flags |= option;
 }
 
+char* BLF_gettext(const char *msgid)
+{
+       if( msgid!=NULL && strlen(msgid)>0 )
+               return gettext( msgid );
+       return "";
+}
+
 void BLF_disable(int fontid, int option)
 {
        FontBLF *font;
diff --git a/source/blender/blenfont/intern/blf_gettext.c b/source/blender/blenfont/intern/blf_gettext.c
deleted file mode 100755 (executable)
index c82baed..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * $Id: blf_gettext.c 37094 2011-06-02 11:22:22Z xiaoxiangquan $
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2008 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Blender Foundation.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/blenfont/intern/blf_gettext.c
- *  \ingroup blf
- */
-
-#include <libintl.h>
-#include <string.h>
-
-char* BLF_gettext(const char *msgid)
-{
-       if( msgid!=NULL && strlen(msgid)>0 )
-               return gettext( msgid );
-       return "";
-}
index cc55eb585edca3a427c9c67a44dc3d9ed5fe9e06..28d1f57c6199d070772ab569af01bd9122b3f676 100644 (file)
@@ -140,8 +140,11 @@ void BLF_lang_set(const char *str)
        char *locreturn;
        if(str==NULL)
                str = lang_to_locale[U.language];
-       BLI_setenv("LANG", str);
-       BLI_setenv("LANGUAGE", str);
+       if( str[0]!=0 )
+       {
+               BLI_setenv("LANG", str);
+               BLI_setenv("LANGUAGE", str);
+       }
 
        locreturn= setlocale(LC_ALL, str);
        if (locreturn == NULL) {
@@ -161,9 +164,6 @@ void BLF_lang_set(const char *str)
        bindtextdomain(DOMAIN_NAME, global_messagepath);
        /* bind_textdomain_codeset(DOMAIN_NAME, global_encoding_name); */
        BLI_strncpy(global_language, str, sizeof(global_language));
-
-//     printf( "<<< %s %s %s \n", setlocale(LC_MESSAGES,NULL), getenv("LANG"), getenv("LANGUAGE") );
-
 }
 
 void BLF_lang_encoding(const char *str)
index 6831f80092c0e6eff10ce9e8ee728f7a8e1fe315..b6792635f30fe00201ab2dd3beb04262ac6a28fb 100644 (file)
@@ -57,7 +57,7 @@ extern int datatoc_bmonofont_ttf_size;
 extern char datatoc_bmonofont_ttf[];
 
 extern int datatoc_bunifont_ttf_size;
-extern char* get_datatoc_bunifont_ttf();
+extern char* get_datatoc_bunifont_ttf(void);
 
 /* Brush icon datafiles */
 /* TODO: this could be simplified by putting all
index a6bbb26be86e7c8f5b43f22cedd70bda6ae62db8..a389fda924ef3faf7e9c2e3815cb5c4274134d21 100644 (file)
@@ -381,7 +381,7 @@ static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *args)
 {
        char* msgid;
        char* msgstr;
-       char* error_handle;
+       char* error_handle=NULL;
 
        if (!PyArg_ParseTuple(args, "s:blf.gettext", &msgid))
                return NULL;
@@ -404,7 +404,7 @@ PyDoc_STRVAR(py_blf_fake_gettext_doc,
 static PyObject *py_blf_fake_gettext(PyObject *UNUSED(self), PyObject *args)
 {
        char* msgid;
-       char* error_handle;
+       char* error_handle = NULL;
 
        if (!PyArg_ParseTuple(args, "s:blf.gettext", &msgid))
                return NULL;