src/documentloader.cpp

changeset 1079
67c6e5d32e68
parent 1073
a0a0d581309b
child 1086
621c2e5853bb
equal deleted inserted replaced
1078:c72e3115a297 1079:67c6e5d32e68
112 112
113 // Trim the trailing newline 113 // Trim the trailing newline
114 while (line.endsWith ("\n") or line.endsWith ("\r")) 114 while (line.endsWith ("\n") or line.endsWith ("\r"))
115 line.chop (1); 115 line.chop (1);
116 116
117 LDObject* obj = ParseLine (line); 117 LDObject* obj = _model->addFromString(line);
118 118
119 // Check for parse errors and warn about them 119 // Check for parse errors and warn about them
120 if (obj->type() == OBJ_Error) 120 if (obj->type() == OBJ_Error)
121 { 121 {
122 print ("Couldn't parse line #%1: %2", progress() + 1, static_cast<LDError*> (obj)->reason()); 122 print ("Couldn't parse line #%1: %2", progress() + 1, static_cast<LDError*> (obj)->reason());
123 ++m_warningCount; 123 ++m_warningCount;
124 } 124 }
125
126 _model->addObject(obj);
127 } 125 }
128 126
129 m_progress = i; 127 m_progress = i;
130 128
131 if (m_progressDialog) 129 if (m_progressDialog)

mercurial