#ifndef Configuration_H
#define Configuration_H

#include <QObject>
#include <QMutex>
#include <QSettings>

class Configuration : public QObject
{
    Q_OBJECT
public:
    static Configuration *instance();
    Configuration(Configuration &)=delete;
    Configuration &operator =(Configuration)=delete;
public:
    void init(){}
    void destroy(){ delete this; }
public:
    QVariant get(QString, QString, QVariant d=QVariant());
    void set(QString, QString, QVariant);
    QVariantList gets(QString, QString);
    void sets(QString, QString, QVariantList);
private:
    explicit Configuration(QObject *parent = nullptr);
    ~Configuration();
private:
    static Configuration *m_oInstance;
    static QMutex            m_oMutex;
private:
    QSettings               *m_oSetting;
signals:

};
#define CFG Configuration::instance()
#endif // Configuration_H
