Example code of propagating the result of the partial restore
This commit is contained in:
@@ -187,7 +187,7 @@ void PropertyGeometryList::Restore(Base::XMLReader &reader)
|
||||
values.push_back(newG);
|
||||
reader.readEndElement("Geometry");
|
||||
}
|
||||
catch(Base::RestoreError e) {
|
||||
catch(Base::RestoreError &e) {
|
||||
|
||||
e.ReportException();
|
||||
|
||||
@@ -214,8 +214,8 @@ void PropertyGeometryList::Restore(Base::XMLReader &reader)
|
||||
// assignment
|
||||
setValues(values);
|
||||
|
||||
/*if(partialrestore)
|
||||
THROWMT(Base::RestoreError, QT_TRANSLATE_NOOP("Exceptions","There were errors during the restoring process. Some geometry objects may not correspond to the version that was saved or might have been deleted."));*/
|
||||
if(partialrestore)
|
||||
THROW(Base::RestoreError);
|
||||
}
|
||||
|
||||
App::Property *PropertyGeometryList::Copy(void) const
|
||||
|
||||
@@ -325,6 +325,13 @@ void BrowserView::onLinkClicked (const QUrl & url)
|
||||
// Gui::Command::doCommand(Gui::Command::Gui,"execfile('%s')",(const char*) fi.absoluteFilePath(). toLocal8Bit());
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"exec(open('%s').read())",(const char*) fi.absoluteFilePath() .toLocal8Bit());
|
||||
}
|
||||
catch (const Base::RestoreError& e) {
|
||||
e.ReportException();
|
||||
if(e.getTranslatable()) {
|
||||
QMessageBox::critical(Gui::getMainWindow(), QObject::tr("Error loading file"),
|
||||
QObject::tr(e.getMessage().c_str()));
|
||||
}
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
QMessageBox::critical(this, tr("Error"), QString::fromUtf8(e.what()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user