src/file.cpp

changeset 490
fff86085017e
parent 484
5b5c77c7f3dd
child 664
e3a32a79a10a
equal deleted inserted replaced
489:0b32138fedcc 490:fff86085017e
31 #include "misc.h" 31 #include "misc.h"
32 #include "gui.h" 32 #include "gui.h"
33 #include "history.h" 33 #include "history.h"
34 #include "dialogs.h" 34 #include "dialogs.h"
35 #include "gldraw.h" 35 #include "gldraw.h"
36 #include "gldata.h"
36 37
37 cfg (String, io_ldpath, ""); 38 cfg (String, io_ldpath, "");
38 cfg (List, io_recentfiles, {}); 39 cfg (List, io_recentfiles, {});
39 extern_cfg (String, net_downloadpath); 40 extern_cfg (String, net_downloadpath);
40 extern_cfg (Bool, gl_logostuds); 41 extern_cfg (Bool, gl_logostuds);
280 str line = lines()[i]; 281 str line = lines()[i];
281 282
282 // Trim the trailing newline 283 // Trim the trailing newline
283 qchar c; 284 qchar c;
284 285
285 while ((c = line[line.length() - 1]) == '\n' || c == '\r') 286 while (line.length() > 0 && ((c = line[line.length() - 1]) == '\n' || c == '\r'))
286 line.chop (1); 287 line.chop (1);
287 288
288 LDObject* obj = parseLine (line); 289 LDObject* obj = parseLine (line);
289 290
290 // Check for parse errors and warn about tthem 291 // Check for parse errors and warn about tthem
1083 // A ton of stuff needs to be updated 1084 // A ton of stuff needs to be updated
1084 g_win->clearSelection(); 1085 g_win->clearSelection();
1085 g_win->updateFileListItem (f); 1086 g_win->updateFileListItem (f);
1086 g_win->buildObjList(); 1087 g_win->buildObjList();
1087 g_win->updateTitle(); 1088 g_win->updateTitle();
1089 g_vertexCompiler.needMerge();
1088 g_win->R()->setFile (f); 1090 g_win->R()->setFile (f);
1089 g_win->R()->resetAngles(); 1091 g_win->R()->resetAngles();
1090 g_win->R()->repaint(); 1092 g_win->R()->repaint();
1091 1093
1092 log ("Changed file to %1", f->getShortName()); 1094 log ("Changed file to %1", f->getShortName());

mercurial