Skip to content
Snippets Groups Projects
Commit 4013fb34 authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

early return

parent 83a4fb6e
No related branches found
No related tags found
No related merge requests found
......@@ -139,18 +139,17 @@ void GUI::Plot::savePlot(const QString& dirname, QCustomPlot* plot, const Datafi
nullptr, "Save Plot", defaultName, getFilterString(), &selectedFilter,
appSettings->useNativeFileDialog() ? QFileDialog::Options()
: QFileDialog::DontUseNativeDialog);
if (fileName.isEmpty())
return;
QString nameToSave = composeFileName(fileName, selectedFilter);
if (!nameToSave.isEmpty()) {
try {
saveToFile(nameToSave, plot, output_data);
} catch (const std::exception& ex) {
QString message = "Attempt to save file with the name '";
message.append(nameToSave);
message.append("' has failed with following error message\n\n");
message.append(QString::fromStdString(ex.what()));
QMessageBox::warning(nullptr, "Houston, we have a problem.", message);
}
try {
saveToFile(nameToSave, plot, output_data);
} catch (const std::exception& ex) {
QString message = "Attempt to save file with the name '";
message.append(nameToSave);
message.append("' has failed with following error message\n\n");
message.append(QString::fromStdString(ex.what()));
QMessageBox::warning(nullptr, "Houston, we have a problem.", message);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment