#ifndef AIBARCONFIG_H
#define AIBARCONFIG_H

#include <QObject>
#include <QFileSystemWatcher>
#include <QTimer>
#include <QSettings>

#define ConfigerIns()  uos_ai::AiBarConfig::instance()

namespace uos_ai {

class AiBarConfig : public QObject
{
    Q_OBJECT
public:
    static AiBarConfig *instance();
    explicit AiBarConfig(QObject *parent = nullptr);
    inline bool getEnableFileDrag() const {
        return enableFileDrag;
    }

signals:
protected slots:
    void onFileChanged(const QString &path);
    void onLoadConfig();
private:
    void init();
private:
    QString configFilePath;
    QFileSystemWatcher *watcher = nullptr;
    QTimer delayLoad;
    bool enableFileDrag = true;
};

}
#endif // AIBARCONFIG_H
