Fix dont open any file option

This commit is contained in:
xarkes 2018-07-06 23:23:51 +02:00
parent 125006b1c2
commit c0fe9e2c3f
2 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,7 @@ void AnalTask::runTask()
// Do not reload the file if already loaded // Do not reload the file if already loaded
QJsonArray openedFiles = Core()->getOpenedFiles(); QJsonArray openedFiles = Core()->getOpenedFiles();
if (!openedFiles.size()) { if (!openedFiles.size() && options.filename.length()) {
bool fileLoaded = Core()->loadFile(options.filename, bool fileLoaded = Core()->loadFile(options.filename,
options.binLoadAddr, options.binLoadAddr,
options.mapAddr, options.mapAddr,
@ -47,7 +47,7 @@ void AnalTask::runTask()
if (!fileLoaded) { if (!fileLoaded) {
// Something wrong happened, fallback to open dialog // Something wrong happened, fallback to open dialog
emit openFileFailed(); emit openFileFailed();
AsyncTask::interrupt(); interrupt();
return; return;
} }
} }
@ -60,8 +60,8 @@ void AnalTask::runTask()
Core()->cmd("e asm.os=" + options.os); Core()->cmd("e asm.os=" + options.os);
} }
// Load PDB and/or scripts
if (!options.pdbFile.isNull()) { if (!options.pdbFile.isNull()) {
log(tr("Loading PDB file...\n"));
Core()->loadPDB(options.pdbFile); Core()->loadPDB(options.pdbFile);
} }
@ -70,6 +70,7 @@ void AnalTask::runTask()
} }
if (!options.script.isNull()) { if (!options.script.isNull()) {
log(tr("Executing script...\n"));
Core()->loadScript(options.script); Core()->loadScript(options.script);
} }

View File

@ -74,7 +74,7 @@
#include "widgets/HeadersWidget.h" #include "widgets/HeadersWidget.h"
#include "widgets/ZignaturesWidget.h" #include "widgets/ZignaturesWidget.h"
// graphics // Graphics
#include <QGraphicsEllipseItem> #include <QGraphicsEllipseItem>
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QGraphicsView> #include <QGraphicsView>