diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 4d741bc4..b6cec28c 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -314,14 +314,13 @@ void MainWindow::openNewFile(InitialOptions options, bool skipOptionsDialog) /* Prompt to load filename.r2 script */ if (options.script.isEmpty()) { QString script = QString("%1.r2").arg(this->filename); - QString loadScript; if (r_file_exists(script.toStdString().data())) { QMessageBox mb; mb.setWindowTitle(tr("Script loading")); mb.setText(tr("Do you want to load the '%1' script?").arg(script)); mb.setStandardButtons(QMessageBox::Yes | QMessageBox::No); if (mb.exec() == QMessageBox::Yes) { - loadScript = script; + options.script = script; } } }