Qt: Move last directory setting from qt.ini to config.ini
Jeffrey Pfau jeffrey@endrift.com
Tue, 20 Dec 2016 01:35:07 -0800
2 files changed,
9 insertions(+),
8 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.cpp
→
src/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;