2023-04-06 10:39:10 +08:00
|
|
|
|
#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);
|
2023-04-08 11:45:59 +08:00
|
|
|
|
|
2023-04-06 10:39:10 +08:00
|
|
|
|
/**
|
2023-04-08 11:45:59 +08:00
|
|
|
|
* @brief 处理老版本数据,需要调用
|
2023-04-06 10:39:10 +08:00
|
|
|
|
*/
|
2023-04-08 11:45:59 +08:00
|
|
|
|
void processCompatibleCache();
|
|
|
|
|
QVector<SearchDir> searchDirObjects();
|
|
|
|
|
QStringList searchDirs();
|
|
|
|
|
QStringList blackDirs();
|
2023-04-06 10:39:10 +08:00
|
|
|
|
QStringList globalBlackList() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Config();
|
2023-04-08 11:45:59 +08:00
|
|
|
|
void removeDir(const QString& url);
|
|
|
|
|
bool isCompatibilityMode();
|
|
|
|
|
|
2023-04-06 10:39:10 +08:00
|
|
|
|
QSettings *m_settings = nullptr;
|
|
|
|
|
bool m_compatibilityMode = false;
|
|
|
|
|
QVector<SearchDir> m_searchDirs;
|
2023-04-08 11:45:59 +08:00
|
|
|
|
QVector<SearchDir> m_compatibleCache;
|
2023-04-06 10:39:10 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CONFIG_H
|