src/documentmanager.cpp

changeset 140
2f383e88acf4
parent 35
98906a94732f
child 147
37f936073cac
equal deleted inserted replaced
139:72098474d362 140:2f383e88acf4
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;

mercurial