ukui-notification/libukui-notification/notification-settings/settings-manager-private.h

72 lines
1.7 KiB
C
Raw Normal View History

//
//
//
#ifndef NotificationSettingsPrivate_H
#define NotificationSettingsPrivate_H
#include "settings-manager.h"
#include <application-info.h>
#include <QJsonObject>
#include <QFileSystemWatcher>
#include <QList>
#include "settings-properties.h"
namespace UkuiNotification {
#define NOTIFICATION_SETTINGS_VERSION "1.0"
class SettingsManagerPrivate : public QObject
{
friend class SettingsManager;
Q_OBJECT
public:
explicit SettingsManagerPrivate(QObject* parent = nullptr);
~SettingsManagerPrivate();
void init();
private Q_SLOTS:
/**
* @brief checkAndLoad
*
*/
void checkAndLoad();
private:
/**
* @brief createSettingsFile
*
*/
void createSettingsFile();
/**
* @brief updateSettingsFile
*
*/
void updateSettingsFile();
/**
* @brief getAppInfo
* desktop信息
*/
QStringList getAppInfo();
void initSettingsData(QJsonObject &data);
public Q_SLOTS:
void desktopFileAdd(const QStringList &data);
void desktopFileDelete(const QStringList &data);
Q_SIGNALS:
void settingsUpdateFinished();
void appUninstalled(const QString &desktopEntry);
private:
void save2SettingsFile(const QJsonObject &jsonDocData);
QJsonObject m_settingsData;
QFileSystemWatcher *m_watcher = nullptr;
UkuiSearch::ApplicationInfo * m_applicationInfo = nullptr;
QJsonObject m_applicationDefaultSettings;
};
}
#endif // NotificationSettingsPrivate_H