diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-11-22 09:11:03 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-12-30 19:44:44 +0300 |
commit | 75aec5eeaa9a6899daf4f7dffcf2214919d65e6d (patch) | |
tree | 96114963a2485a3bd6b5772ce9299cd88fc4287d /source/blender/blenkernel | |
parent | 0c456eb90a8b3cb70f9f4cb7439453fa9cc478b8 (diff) |
WM: minor correction to user-pref writing
When saving templates had wrong return value.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_blendfile.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blendfile.c | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_blendfile.h b/source/blender/blenkernel/BKE_blendfile.h index ac58451e412..1cf8a78fef3 100644 --- a/source/blender/blenkernel/BKE_blendfile.h +++ b/source/blender/blenkernel/BKE_blendfile.h @@ -58,8 +58,7 @@ struct UserDef *BKE_blendfile_userdef_read_from_memory( const void *filebuf, int filelength, struct ReportList *reports); -int BKE_blendfile_userdef_write(const char *filepath, struct ReportList *reports); - +bool BKE_blendfile_userdef_write(const char *filepath, struct ReportList *reports); /* partial blend file writing */ void BKE_blendfile_write_partial_tag_ID(struct ID *id, bool set); diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 05ea7983b8e..56b9c8df8b8 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -494,19 +494,22 @@ UserDef *BKE_blendfile_userdef_read_from_memory( } -/* only write the userdef in a .blend */ -int BKE_blendfile_userdef_write(const char *filepath, ReportList *reports) +/** + * Only write the userdef in a .blend + * \return success + */ +bool BKE_blendfile_userdef_write(const char *filepath, ReportList *reports) { Main *mainb = MEM_callocN(sizeof(Main), "empty main"); - int retval = 0; + bool ok = false; if (BLO_write_file(mainb, filepath, G_FILE_USERPREFS, reports, NULL)) { - retval = 1; + ok = true; } MEM_freeN(mainb); - return retval; + return ok; } /** \} */ |