KShare/settings.cpp

14 lines
482 B
C++
Raw Normal View History

2017-04-23 15:05:48 +02:00
#include "settings.hpp"
#include <QStandardPaths>
2017-05-06 13:21:12 +02:00
QSettings &settings::settings() {
static QDir configDir(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation));
if (configDir.path() == QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)) {
configDir.mkdir("KShare");
configDir.cd("KShare");
}
static QSettings settings(configDir.absoluteFilePath("settings.ini"), QSettings::IniFormat);
return settings;
2017-04-23 15:05:48 +02:00
}