X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=fd0c24595da1bfe0efc675ac395970ccce764ece;hp=061734a5bc946dde58082641543aed5ec24d6c0c;hb=f3a965524eae344fbd25ba486e9fa32e1262fcc4;hpb=66fe5753170a33f3823924e41d768557ec79b8cb diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 061734a..fd0c245 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -8,7 +8,7 @@ #include -Mainwindow::Mainwindow() +Mainwindow::Mainwindow(const std::string& filename) { openAction = new QAction(tr("&Open"), this); // saveAction = new QAction(tr("&Save"), this); @@ -37,6 +37,8 @@ Mainwindow::Mainwindow() stackedWidget, SLOT(setCurrentIndex(int))); setWindowTitle(tr("Notepad")); + + openBinary(filename); } void Mainwindow::quit() @@ -54,8 +56,12 @@ void Mainwindow::open() { QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", tr("Binaries (*)")); - if (fileName != "") { - disassembler.reset(new LLVMDisassembler(fileName.toStdString())); + openBinary(fileName.toStdString()); +} + +void Mainwindow::openBinary(const std::string& filename) { + if (filename != "") { + disassembler.reset(new LLVMDisassembler(filename)); // curBin = new Binary(fileName.toStdString()); // std::vector symbols = curBin->getSymbols();