summaryrefslogtreecommitdiffstats
path: root/utils/regtools/qeditor/settings.cpp
blob: d72a15f74ff72de72dff599239b6726543135265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <QCoreApplication>
#include <QDebug>
#include "settings.h"

Settings::Settings()
{
    
}

Settings::~Settings()
{
    if(m_settings)
        delete m_settings;
}

QSettings *Settings::GetSettings()
{
    if(!m_settings)
    {
        QDir dir(QCoreApplication::applicationDirPath());
        QString filename = dir.filePath(QCoreApplication::organizationDomain() + ".ini");
        m_settings = new QSettings(filename, QSettings::IniFormat);
    }
    return m_settings;
}

QSettings *Settings::Get()
{
    return g_settings.GetSettings();
}

Settings Settings::g_settings;