Fix refresh by having the save occur on accept instead of during the destructor.

This commit is contained in:
Robbie 2017-06-16 10:15:40 -05:00 committed by Ani
parent 152ab8c13d
commit 40d1882db9
2 changed files with 4 additions and 9 deletions

View File

@ -50,6 +50,10 @@ vfs_dialog::vfs_dialog(QWidget* parent) : QDialog(parent),
}); });
QPushButton* okay = new QPushButton(tr("Okay")); QPushButton* okay = new QPushButton(tr("Okay"));
connect(okay, &QAbstractButton::pressed, [this]() { connect(okay, &QAbstractButton::pressed, [this]() {
for (int i = 0; i < tabs->count(); ++i)
{
static_cast<vfs_dialog_tab*>(tabs->widget(i))->SaveSettings();
}
accept(); accept();
}); });
@ -67,11 +71,3 @@ vfs_dialog::vfs_dialog(QWidget* parent) : QDialog(parent),
setLayout(vbox); setLayout(vbox);
setWindowTitle("Virtual File System"); setWindowTitle("Virtual File System");
} }
vfs_dialog::~vfs_dialog()
{
for (int i = 0; i < tabs->count(); ++i)
{
static_cast<vfs_dialog_tab*>(tabs->widget(i))->SaveSettings();
}
}

View File

@ -13,7 +13,6 @@ class vfs_dialog : public QDialog
public: public:
explicit vfs_dialog(QWidget* parent = nullptr); explicit vfs_dialog(QWidget* parent = nullptr);
~vfs_dialog();
private: private:
gui_settings m_gui_settings; gui_settings m_gui_settings;
emu_settings m_emu_settings; emu_settings m_emu_settings;