first commit
This commit is contained in:
37
utils/configmanager.h
Normal file
37
utils/configmanager.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef CONFIGMANAGER_H
|
||||
#define CONFIGMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
#include <QVector>
|
||||
#include "../widgets/appicon.h"
|
||||
#include "../widgets/launcherpage.h"
|
||||
|
||||
class ConfigManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigManager(QObject *parent = nullptr);
|
||||
~ConfigManager();
|
||||
|
||||
bool loadFromFile(const QString &filePath);
|
||||
bool loadDefaultConfig();
|
||||
bool saveToFile(const QString &filePath);
|
||||
|
||||
QVector<PageConfig> getPages() const;
|
||||
QVector<AppIconData> getDockApps() const;
|
||||
QJsonObject getColorSystem() const;
|
||||
QJsonObject getAnimations() const;
|
||||
|
||||
private:
|
||||
AppIconData parseAppData(const QJsonObject &obj) const;
|
||||
PageConfig parsePageConfig(const QJsonObject &obj) const;
|
||||
|
||||
QJsonDocument m_configDoc;
|
||||
QJsonObject m_config;
|
||||
};
|
||||
|
||||
#endif // CONFIGMANAGER_H
|
||||
Reference in New Issue
Block a user