diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-09 21:37:21 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-09 21:37:21 -0700 |
commit | ed6a54f5066f3220ce357f9cf7686fc4d72079dd (patch) | |
tree | 2bac89ffa947d0a96efd611800e14ef83f74c839 /qt-gui.cpp | |
parent | aea8493165a98d1653c7adf475ca2267d505bfe8 (diff) | |
download | subsurface-ed6a54f5066f3220ce357f9cf7686fc4d72079dd.tar.gz |
Enable defautl_filename in settings
We don't have a UI to set it, yet, so you have to manually set it in the
config file, but once you do that it works...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r-- | qt-gui.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp index 1e2c86e69..5d858d733 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -27,6 +27,7 @@ #include <QStringList> #include <QTextCodec> #include <QTranslator> +#include <QSettings> class Translator: public QTranslator { @@ -65,6 +66,7 @@ void init_qt_ui(int *argcp, char ***argvp) void init_ui(int *argcp, char ***argvp) { + QVariant v; application = new QApplication(*argcp, *argvp); #if QT_VERSION < 0x050000 @@ -75,6 +77,16 @@ void init_ui(int *argcp, char ***argvp) QTextCodec::setCodecForCStrings(QTextCodec::codecForMib(106)); #endif + QSettings settings("hohndel.org","subsurface"); + settings.beginGroup("GeneralSettings"); + v = settings.value(QString("default_filename")); + if (v.isValid()) { + QString name = v.toString(); + prefs.default_filename = strdup(name.toUtf8()); + qDebug("default filename %s", prefs.default_filename); + } + settings.endGroup(); + #if 0 subsurface_open_conf(); |