summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-08-18 20:00:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-25 11:49:47 -0700
commitc85f5c560cfd392049d64a2346073d1151098925 (patch)
tree78921db2397d9aa97021a1a93dd6b3eb5679179a /desktop-widgets/mainwindow.cpp
parent3436734bb9e12a4effa5cfe973a0e6d432cc78c9 (diff)
downloadsubsurface-c85f5c560cfd392049d64a2346073d1151098925.tar.gz
desktop-widget: remove QSettings
Update desktop-widget to use qPrefDisplay (amended variable) Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 62cbe7b28..ea5f31556 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -549,13 +549,10 @@ void MainWindow::on_actionNew_triggered()
static QString lastUsedDir()
{
- QSettings settings;
QString lastDir = QDir::homePath();
- settings.beginGroup("FileDialog");
- if (settings.contains("LastDir"))
- if (QDir(settings.value("LastDir").toString()).exists())
- lastDir = settings.value("LastDir").toString();
+ if (QDir(qPrefDisplay::lastDir()).exists())
+ lastDir = qPrefDisplay::lastDir();
return lastDir;
}
@@ -773,9 +770,7 @@ void MainWindow::on_actionClose_triggered()
void MainWindow::updateLastUsedDir(const QString &dir)
{
- QSettings s;
- s.beginGroup("FileDialog");
- s.setValue("LastDir", dir);
+ qPrefDisplay::set_lastDir(dir);
}
void MainWindow::on_actionPrint_triggered()