ukui-search/ukui-search-service-dir-man.../dirwatcher/config.h

32 lines
711 B
C++

#ifndef CONFIG_H
#define CONFIG_H
#include <QString>
#include <QSettings>
#include <QVector>
#include "search-dir.h"
class Config
{
public:
static Config *self();
void addDir(const SearchDir& dir);
QStringList removeDir(const SearchDir& dir);
/**
* @brief 兼容模式,自动提取老版本数据生成黑名单
* @return
*/
bool isCompatibilityMode();
QVector<SearchDir> searchDirObjects() const;
QStringList searchDirs() const;
QStringList blackDirs() const;
QStringList globalBlackList() const;
private:
Config();
QSettings *m_settings = nullptr;
bool m_compatibilityMode = false;
QVector<SearchDir> m_searchDirs;
};
#endif // CONFIG_H