Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-29 16:38:08 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-29 16:38:08 +0300
commit0a8a00cd1060ee7aa9eae4223fc8c2577533247f (patch)
tree6dc09a68c1d8e35bd807d784f3507b57c9c1f62f /source/blender/blenloader/intern/readblenentry.c
parentd51bc24384a70f3cdcd4b72091873c96d542d642 (diff)
2.5: Error reporting
* Added a report list to operator, to which they can report errors and warnings. When the operator ends, it will display them with a popup. For python these should become exceptions when calling operators. * Added a function to make a popup menu from a report list. * Also added a utility function to prepend a string before the reports to indicate what they relates to. Also made the report functions used BLI_dynstr to simplify the code. * Made file reading and writing report errors to the user again using this system, also replacing the left over uncommented bad level error() calls.
Diffstat (limited to 'source/blender/blenloader/intern/readblenentry.c')
-rw-r--r--source/blender/blenloader/intern/readblenentry.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index e7e45597887..23e334fbbd1 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -166,12 +166,9 @@ int BLO_idcode_from_name(char *name)
BlendHandle *BLO_blendhandle_from_file(char *file)
{
- ReportList reports;
BlendHandle *bh;
- BKE_reports_init(&reports, 0);
- bh= (BlendHandle*)blo_openblenderfile(file, &reports);
- BKE_reports_clear(&reports);
+ bh= (BlendHandle*)blo_openblenderfile(file, NULL);
return bh;
}
@@ -330,7 +327,8 @@ BlendFileData *BLO_read_from_file(char *file, ReportList *reports)
fd = blo_openblenderfile(file, reports);
if (fd) {
- bfd= blo_read_file_internal(fd, reports);
+ fd->reports= reports;
+ bfd= blo_read_file_internal(fd);
if (bfd) {
bfd->type= BLENFILETYPE_BLEND;
strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1);
@@ -348,7 +346,8 @@ BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports)
fd = blo_openblendermemory(mem, memsize, reports);
if (fd) {
- bfd= blo_read_file_internal(fd, reports);
+ fd->reports= reports;
+ bfd= blo_read_file_internal(fd);
if (bfd) {
bfd->type= BLENFILETYPE_BLEND;
strcpy(bfd->main->name, "");
@@ -367,6 +366,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
fd = blo_openblendermemfile(memfile, reports);
if (fd) {
+ fd->reports= reports;
strcpy(fd->filename, filename);
/* clear ob->proxy_from pointers in old main */
@@ -380,7 +380,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil
/* makes lookup of existing images in old main */
blo_make_image_pointer_map(fd, oldmain);
- bfd= blo_read_file_internal(fd, reports);
+ bfd= blo_read_file_internal(fd);
if (bfd) {
bfd->type= BLENFILETYPE_BLEND;
strcpy(bfd->main->name, "");