diff --git a/rpcs3/rpcs3qt/cg_disasm_window.cpp b/rpcs3/rpcs3qt/cg_disasm_window.cpp index e4e29a8cc0..c046f0d808 100644 --- a/rpcs3/rpcs3qt/cg_disasm_window.cpp +++ b/rpcs3/rpcs3qt/cg_disasm_window.cpp @@ -19,7 +19,7 @@ constexpr auto qstr = QString::fromStdString; inline std::string sstr(const QString& _in) { return _in.toUtf8().toStdString(); } -cg_disasm_window::cg_disasm_window(std::shared_ptr xSettings, QWidget* parent): QWidget(parent), xgui_settings(xSettings) +cg_disasm_window::cg_disasm_window(std::shared_ptr xSettings): xgui_settings(xSettings) { setWindowTitle(tr("Cg Disasm")); setAttribute(Qt::WA_DeleteOnClose); @@ -72,7 +72,6 @@ void cg_disasm_window::ShowContextMenu(const QPoint &pos) QString filePath = QFileDialog::getOpenFileName(this, tr("Select Cg program object"), m_path_last, tr("Cg program objects (*.fpo;*.vpo);;")); if (filePath == NULL) return; m_path_last = filePath; - ShowDisasm(); }); @@ -81,14 +80,13 @@ void cg_disasm_window::ShowContextMenu(const QPoint &pos) void cg_disasm_window::ShowDisasm() { - xgui_settings->SetValue(GUI::fd_cg_disasm, m_path_last); - if (QFileInfo(m_path_last).isFile()) { CgBinaryDisasm disasm(sstr(m_path_last)); disasm.BuildShaderBody(); m_disasm_text->setText(qstr(disasm.GetArbShader())); m_glsl_text->setText(qstr(disasm.GetGlslShader())); + xgui_settings->SetValue(GUI::fd_cg_disasm, m_path_last); } else if (!m_path_last.isEmpty()) { diff --git a/rpcs3/rpcs3qt/cg_disasm_window.h b/rpcs3/rpcs3qt/cg_disasm_window.h index 3629543808..1bd34ab457 100644 --- a/rpcs3/rpcs3qt/cg_disasm_window.h +++ b/rpcs3/rpcs3qt/cg_disasm_window.h @@ -26,7 +26,7 @@ private: std::shared_ptr xgui_settings; public: - explicit cg_disasm_window(std::shared_ptr xSettings, QWidget *parent); + explicit cg_disasm_window(std::shared_ptr xSettings); protected: void dropEvent(QDropEvent* ev); diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 6b8223915c..3833c38d42 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1171,7 +1171,7 @@ void main_window::CreateConnects() sdid->show(); }); connect(ui->toolsCgDisasmAct, &QAction::triggered, [=](){ - cg_disasm_window* cgdw = new cg_disasm_window(guiSettings, this); + cg_disasm_window* cgdw = new cg_disasm_window(guiSettings); cgdw->show(); }); connect(ui->toolskernel_explorerAct, &QAction::triggered, [=](){