#ifndef SETTINGCONFIG_H
#define SETTINGCONFIG_H

#include <QVariant>
#include <QSettings>

class SettingConfig : public QObject
{
public:
    ~SettingConfig() {};
    SettingConfig(const SettingConfig&)=delete;
    SettingConfig& operator=(const SettingConfig&)=delete;

    static SettingConfig& getInstance() {
        static SettingConfig instance;
        return instance;
    }

    /**
     * @brief get
     * @param nodeName
     * @param keyName
     * @return QVariant
     * @title
     */
    QVariant getProperty(QString nodeName, QString keyName);
    void setProperty(QString nodeName, QString keyName, QString value);
    void init();

    /******** 以下为需要的各类参数 ********/
    QString LOCAL_Mode;
    QString LOCAL_HOST;
    QString LOCAL_ODBC_NAME;
    QString LOCAL_USERNAME;
    QString LOCAL_PASSWORD;
    QString LOCAL_PORT;
    QString LOCAL_SCHEMA;

    QString REMOTE_HOST;
    QString REMOTE_ODBC_NAME;
    QString REMOTE_USERNAME;
    QString REMOTE_PASSWORD;

    QString CLIENT_TITLE;
    QString BASE_LOG_PATH;
    QString BASE_RES_FILE_PATH;
    QString BASE_CER_FILE_PATH;
    QString BASE_HTTP_FILE;


private:
    SettingConfig();

    QString filename;
    QSettings* setting;
};

#endif // SETTINGCONFIG_H
