OGS
LastSavedFileDirectory.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <QDir>
18#include <QFileInfo>
19#include <QSettings>
20#include <QString>
21
23{
24public:
26 static const QString getDir()
27 {
28 QSettings settings;
29 return settings.value("lastSavedFileDirectory").toString();
30 }
31
33 static void setDir(const QString &path)
34 {
35 QFileInfo fi(path);
36 QDir dir = QDir(fi.absolutePath());
37 QSettings settings;
38 settings.setValue("lastSavedFileDirectory", dir.absolutePath() + "/");
39 }
40
41};
static void setDir(const QString &path)
Sets the directory last used for saving a file.
static const QString getDir()
Returns the directory last used for saving a file.