src/documentmanager.cpp

changeset 1367
0aab8d972cf6
parent 1332
1fffb24d4ffe
child 1379
35811339ea72
equal deleted inserted replaced
1365:3f917410e977 1367:0aab8d972cf6
214 LDDocument* load = fileToOverride; 214 LDDocument* load = fileToOverride;
215 215
216 if (fileToOverride == nullptr) 216 if (fileToOverride == nullptr)
217 load = m_window->newDocument(implicit); 217 load = m_window->newDocument(implicit);
218 218
219 load->setFullPath(path);
220 load->setName(LDDocument::shortenName(path));
221
222 // Loading the file shouldn't count as actual edits to the document. 219 // Loading the file shouldn't count as actual edits to the document.
223 load->history()->setIgnoring (true); 220 load->history()->setIgnoring (true);
224 221
225 Parser parser {file}; 222 Parser parser {file};
226 Winding winding = NoWinding; 223 Winding winding = NoWinding;
227 load->header = parser.parseHeader(winding); 224 load->header = parser.parseHeader(winding);
225 load->setFullPath(path);
226 load->setName(LDDocument::shortenName(path));
228 load->setWinding(winding); 227 load->setWinding(winding);
229 parser.parseBody(*load); 228 parser.parseBody(*load);
230 file.close(); 229 file.close();
231 230
232 if (m_loadingMainFile) 231 if (m_loadingMainFile)

mercurial