mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
smtk_import: remove QSettings
Update smtk_import to use qPrefDisplay (amended variable) Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
parent
31eb48c3c2
commit
3436734bb9
1 changed files with 4 additions and 9 deletions
|
@ -4,9 +4,9 @@
|
|||
#include "qt-models/filtermodels.h"
|
||||
#include "core/dive.h"
|
||||
#include "core/divelist.h"
|
||||
#include "core/settings/qPrefDisplay.h"
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include <QSettings>
|
||||
#include <QDebug>
|
||||
|
||||
QStringList inputFiles;
|
||||
|
@ -37,21 +37,16 @@ Smrtk2ssrfcWindow::~Smrtk2ssrfcWindow()
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
void Smrtk2ssrfcWindow::updateLastUsedDir(const QString &dir)
|
||||
{
|
||||
QSettings s;
|
||||
s.beginGroup("FileDialog");
|
||||
s.setValue("LastDir", dir);
|
||||
qPrefDisplay::set_lastDir(dir);
|
||||
}
|
||||
|
||||
void Smrtk2ssrfcWindow::on_inputFilesButton_clicked()
|
||||
|
|
Loading…
Reference in a new issue