87 QString DocumentManager::openModel(const QString& path, QTextStream& errorStream) |
87 QString DocumentManager::openModel(const QString& path, QTextStream& errorStream) |
88 { |
88 { |
89 QFile file{path}; |
89 QFile file{path}; |
90 const QString name = pathToName(path); |
90 const QString name = pathToName(path); |
91 file.open(QFile::ReadOnly | QFile::Text); |
91 file.open(QFile::ReadOnly | QFile::Text); |
92 std::unique_ptr<Model> newModel = std::make_unique<Model>(); |
92 std::unique_ptr<Model> newModel = std::make_unique<Model>(path); |
93 QTextStream textStream{&file}; |
93 QTextStream textStream{&file}; |
94 Model::EditContext editor = newModel->edit(); |
94 Model::EditContext editor = newModel->edit(); |
95 Parser parser{file}; |
95 Parser parser{file}; |
96 parser.parseBody(editor); |
96 parser.parseBody(editor); |
97 QString result; |
97 QString result; |