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) |