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:
authorCampbell Barton <ideasman42@gmail.com>2010-04-23 13:24:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-04-23 13:24:22 +0400
commitd43bef938f950691b5a607eff7393e9e47690d33 (patch)
tree6f72aed117ce24d216034744b04e4822bfa1f255
parent0429707e6c077ceecd651cd00682016cfac74fe2 (diff)
svn merge https://svn.blender.org/svnroot/bf-blender/branches/render25 -r28371:28372
console history save/load from joe
-rw-r--r--source/blender/blenloader/intern/readfile.c15
-rw-r--r--source/blender/blenloader/intern/writefile.c8
2 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 9fe2313ea66..32a07db1768 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5158,7 +5158,7 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
}
else if(sl->spacetype==SPACE_CONSOLE) {
SpaceConsole *sconsole= (SpaceConsole *)sl;
- //ConsoleLine *cl;
+ ConsoleLine *cl, *clnext;
link_list(fd, &sconsole->scrollback);
link_list(fd, &sconsole->history);
@@ -5166,9 +5166,16 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
//for(cl= sconsole->scrollback.first; cl; cl= cl->next)
// cl->line= newdataadr(fd, cl->line);
- //for(cl= sconsole->history.first; cl; cl= cl->next)
- // cl->line= newdataadr(fd, cl->line);
-
+ /*comma expressions, (e.g. expr1, expr2, expr3) evalutate each expression,
+ from left to right. the right-most expression sets the result of the comma
+ expression as a whole*/
+ for(cl= sconsole->history.first; cl && (clnext=cl->next), cl; cl= clnext) {
+ cl->line= newdataadr(fd, cl->line);
+ if (!cl->line) {
+ BLI_remlink(&sconsole->history, cl);
+ MEM_freeN(cl);
+ }
+ }
}
else if(sl->spacetype==SPACE_FILE) {
SpaceFile *sfile= (SpaceFile *)sl;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 988f562b82a..47b71dfa5e4 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2108,7 +2108,15 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
writestruct(wd, DATA, "SpaceLogic", 1, sl);
}
else if(sl->spacetype==SPACE_CONSOLE) {
+ SpaceConsole *con = (SpaceConsole*)sl;
+ ConsoleLine *cl;
+
+ for (cl=con->history.first; cl; cl=cl->next) {
+ writestruct(wd, DATA, "ConsoleLine", 1, cl);
+ writedata(wd, DATA, cl->len+1, cl->line);
+ }
writestruct(wd, DATA, "SpaceConsole", 1, sl);
+
}
else if(sl->spacetype==SPACE_USERPREF) {
writestruct(wd, DATA, "SpaceUserPref", 1, sl);