From e7dbc15332dca8d3c2c233258f73694215e703b8 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Tue, 20 Aug 2019 22:30:06 +0200 Subject: Attempt to correct ask for file save when closed on emscripten. Signed-off-by: Pavel Pisa --- qtmips_gui/mainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qtmips_gui') diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index e84359f..084b063 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -469,7 +469,13 @@ void MainWindow::save_exit_or_ignore(bool cancel, QStringList &tosavelist) { if (editor->saveAsRequired()) { save_unnamed = true; } else if (editor != nullptr) { +#ifndef __EMSCRIPTEN__ editor->saveFile(); +#else + central_window->setCurrentWidget(editor); + save_source(); + return; +#endif } } if (save_unnamed && (central_window != nullptr)) { @@ -795,6 +801,7 @@ void MainWindow::close_source_decided(int result) { save_source_as(); return; } + save_source(); } else if (result != QMessageBox::Discard) { return; } -- cgit v1.2.3