diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index e520f007..4118820d 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -577,7 +577,7 @@ void setDefaultViews(MultiViewWidget* viewWidget) bool anyPluginTrue = false; // load plugins normally, if all non-ignore are false. // restore the default behavior - for (auto plugin : sceneModel->scenePlugins()) { + for (ScenePlugin* plugin : sceneModel->scenePlugins()) { QString settingsKey("MainWindow/" + plugin->objectName()); bool enabled = settings.value(settingsKey, plugin->isEnabled()).toBool(); if (plugin->defaultBehavior() != ScenePlugin::DefaultBehavior::Ignore && @@ -1497,6 +1497,9 @@ bool MainWindow::saveFileAs(bool async) QFileDialog saveDialog(this, tr("Save chemical file"), dir, filter); saveDialog.setAcceptMode(QFileDialog::AcceptSave); saveDialog.exec(); + if (saveDialog.selectedFiles().isEmpty()) // user cancel + return false; + QString fileName = saveDialog.selectedFiles().first(); if (fileName.isEmpty()) // user cancel