From 360407f453a645a915e3aaced9959e1f9adc186a Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 3 Apr 2017 23:02:47 +0200 Subject: [PATCH] Fix regression introduced in 0317cf2663fcf0942100030c52dbb2c506bb2f27 * Graphs are working again * Multiple instances not working * MainWindow was creating a new core, as well as OptionDialog --- src/mainwindow.cpp | 5 +++-- src/mainwindow.h | 2 +- src/optionsdialog.cpp | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 339229ee..bdc9289f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -58,12 +58,13 @@ static void appendRow(QTreeWidget *tw, const QString &str, const QString &str2=N tw->insertTopLevelItem(0, tempItem); } -MainWindow::MainWindow(QWidget *parent) : +MainWindow::MainWindow(QWidget *parent, QRCore *kore) : QMainWindow(parent), - core(new QRCore()), + core(kore), ui(new Ui::MainWindow), webserverThread(core, this) { + this->start_web_server(); ui->setupUi(this); doLock = false; diff --git a/src/mainwindow.h b/src/mainwindow.h index 0589fc5a..19a3e560 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -56,7 +56,7 @@ public: bool responsive; - explicit MainWindow(QWidget *parent = 0); + explicit MainWindow(QWidget *parent = 0, QRCore *kore = nullptr); ~MainWindow(); void start_web_server(); diff --git a/src/optionsdialog.cpp b/src/optionsdialog.cpp index 70ea1229..208fb88e 100644 --- a/src/optionsdialog.cpp +++ b/src/optionsdialog.cpp @@ -84,8 +84,7 @@ void OptionsDialog::on_okButton_clicked() //ui->progressBar->setValue(5); // Close dialog and open OptionsDialog - this->w = new MainWindow(nullptr); - this->w->core = this->core; + this->w = new MainWindow(0, this->core); // Fill asm plugins in hexdump combo this->w->memoryDock->fillPlugins(this->asm_plugins);