ModelEditor: Reload documents

Task-number: QTCREATORBUG-20612
Change-Id: Ie4a89f17e9f062ab273b58f19b8c5d6193cedacc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jochen Becher
2018-08-10 10:49:05 +02:00
parent 2c2faf8749
commit f4a7d02c09
2 changed files with 14 additions and 5 deletions

View File

@@ -127,8 +127,17 @@ bool ModelDocument::reload(QString *errorString, Core::IDocument::ReloadFlag fla
emit changed();
return true;
}
*errorString = tr("Cannot reload model file.");
return false;
try {
d->documentController->loadProject(filePath().toString());
} catch (const qmt::FileNotFoundException &ex) {
*errorString = ex.errorMessage();
return false;
} catch (const qmt::Exception &ex) {
*errorString = tr("Could not open \"%1\" for reading: %2.").arg(filePath().toString()).arg(ex.errorMessage());
return false;
}
emit contentSet();
return true;
}
ExtDocumentController *ModelDocument::documentController() const