aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogexportdialog.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/divelogexportdialog.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/divelogexportdialog.cpp')
-rw-r--r--desktop-widgets/divelogexportdialog.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp
index 93341dd20..2dbbe3817 100644
--- a/desktop-widgets/divelogexportdialog.cpp
+++ b/desktop-widgets/divelogexportdialog.cpp
@@ -12,6 +12,7 @@
#include "desktop-widgets/subsurfacewebservices.h"
#include "core/worldmap-save.h"
#include "core/save-html.h"
+#include "core/settings/qPrefDisplay.h"
#include "desktop-widgets/mainwindow.h"
#include "profile-widget/profilewidget2.h"
#include "core/dive.h" // Allows access to helper functions in TeX export.
@@ -121,15 +122,10 @@ void DiveLogExportDialog::on_buttonBox_accepted()
{
QString filename;
QString stylesheet;
- 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();
- }
- settings.endGroup();
+ if (QDir(qPrefDisplay::lastDir()).exists())
+ lastDir = qPrefDisplay::lastDir();
switch (ui->tabWidget->currentIndex()) {
case 0:
@@ -184,9 +180,7 @@ void DiveLogExportDialog::on_buttonBox_accepted()
if (!filename.isNull() && !filename.isEmpty()) {
// remember the last export path
QFileInfo fileInfo(filename);
- settings.beginGroup("FileDialog");
- settings.setValue("LastDir", fileInfo.dir().path());
- settings.endGroup();
+ qPrefDisplay::set_lastDir(fileInfo.dir().path());
// the non XSLT exports are called directly above, the XSLT based ons are called here
if (!stylesheet.isEmpty()) {
future = QtConcurrent::run(export_dives_xslt, filename.toUtf8(), ui->exportSelected->isChecked(), ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8());