MCPcopy Create free account
hub / github.com/MITK/MITK / SaveMementoToFile

Method SaveMementoToFile

Plugins/org.blueberry.ui.qt/src/internal/berryWorkbench.cpp:1090–1116  ·  view source on GitHub ↗

* Save the workbench UI in a persistence file. */

Source from the content-addressed store, hash-verified

1088 * Save the workbench UI in a persistence file.
1089 */
1090bool Workbench::SaveMementoToFile(XMLMemento::Pointer memento)
1091{
1092 // Save it to a file.
1093 // XXX: nobody currently checks the return value of this method.
1094 QString stateFile = GetWorkbenchStateFile();
1095 if (stateFile.isNull())
1096 {
1097 return false;
1098 }
1099 //BERRY_INFO << "Saving state to: " << stateFile.path() << std::endl;
1100 try
1101 {
1102 Poco::FileOutputStream stream(stateFile.toStdString());
1103 memento->Save(stream);
1104 }
1105 catch (const Poco::IOException& /*e*/)
1106 {
1107 QFile::remove(stateFile);
1108 QMessageBox::critical(nullptr,
1109 "Saving Problems",
1110 "Unable to store workbench state.");
1111 return false;
1112 }
1113
1114 // Success !
1115 return true;
1116}
1117
1118IWorkbenchWindow::Pointer Workbench::GetActiveWorkbenchWindow() const
1119{

Callers

nothing calls this directly

Calls 1

SaveMethod · 0.45

Tested by

no test coverage detected