all repos — mgba @ 20f8cdc3e099958dc5fc5d8c6db18d4e0a9588aa

mGBA Game Boy Advance Emulator

Qt: Move last directory setting from qt.ini to config.ini
Jeffrey Pfau jeffrey@endrift.com
Tue, 20 Dec 2016 01:35:07 -0800
commit

20f8cdc3e099958dc5fc5d8c6db18d4e0a9588aa

parent

d7d48e605bab8dc210d6dc5fb06c26e76dd51460

2 files changed, 9 insertions(+), 8 deletions(-)

jump to
M CHANGESCHANGES

@@ -53,6 +53,7 @@ - Debugger: Make building with debugging aspects optional

- GBA Memory: Support for Mo Jie Qi Bing by Vast Fame (taizou) - GBA Memory: Support reading/writing POSTFLG - Util: Add size counting to Table + - Qt: Move last directory setting from qt.ini to config.ini 0.5.1: (2016-10-05) Bugfixes:
M src/platform/qt/GBAApp.cppsrc/platform/qt/GBAApp.cpp

@@ -152,10 +152,10 @@

QString GBAApp::getOpenFileName(QWidget* owner, const QString& title, const QString& filter) { QList<int> paused; pauseAll(&paused); - QString filename = QFileDialog::getOpenFileName(owner, title, m_configController.getQtOption("lastDirectory").toString(), filter); + QString filename = QFileDialog::getOpenFileName(owner, title, m_configController.getOption("lastDirectory"), filter); continueAll(&paused); if (!filename.isEmpty()) { - m_configController.setQtOption("lastDirectory", QFileInfo(filename).dir().path()); + m_configController.setOption("lastDirectory", QFileInfo(filename).dir().path()); } return filename; }

@@ -163,10 +163,10 @@

QString GBAApp::getSaveFileName(QWidget* owner, const QString& title, const QString& filter) { QList<int> paused; pauseAll(&paused); - QString filename = QFileDialog::getSaveFileName(owner, title, m_configController.getQtOption("lastDirectory").toString(), filter); + QString filename = QFileDialog::getSaveFileName(owner, title, m_configController.getOption("lastDirectory"), filter); continueAll(&paused); if (!filename.isEmpty()) { - m_configController.setQtOption("lastDirectory", QFileInfo(filename).dir().path()); + m_configController.setOption("lastDirectory", QFileInfo(filename).dir().path()); } return filename; }

@@ -174,10 +174,10 @@

QString GBAApp::getOpenDirectoryName(QWidget* owner, const QString& title) { QList<int> paused; pauseAll(&paused); - QString filename = QFileDialog::getExistingDirectory(owner, title, m_configController.getQtOption("lastDirectory").toString()); + QString filename = QFileDialog::getExistingDirectory(owner, title, m_configController.getOption("lastDirectory")); continueAll(&paused); if (!filename.isEmpty()) { - m_configController.setQtOption("lastDirectory", QFileInfo(filename).dir().path()); + m_configController.setOption("lastDirectory", QFileInfo(filename).dir().path()); } return filename; }

@@ -224,7 +224,7 @@ return false;

} GBAApp::FileDialog::FileDialog(GBAApp* app, QWidget* parent, const QString& caption, const QString& filter) - : QFileDialog(parent, caption, app->m_configController.getQtOption("lastDirectory").toString(), filter) + : QFileDialog(parent, caption, app->m_configController.getOption("lastDirectory"), filter) , m_app(app) { }

@@ -235,7 +235,7 @@ m_app->pauseAll(&paused);

bool didAccept = QFileDialog::exec() == QDialog::Accepted; QStringList filenames = selectedFiles(); if (!filenames.isEmpty()) { - m_app->m_configController.setQtOption("lastDirectory", QFileInfo(filenames[0]).dir().path()); + m_app->m_configController.setOption("lastDirectory", QFileInfo(filenames[0]).dir().path()); } m_app->continueAll(&paused); return didAccept;