#ifndef SETTINGSCONFIGLOADER_P_H #define SETTINGSCONFIGLOADER_P_H #include #include #include "settingssetup.h" #include namespace QtMvvm { class SettingsConfigLoader : public QObject, public ISettingsSetupLoader, public SettingsConfigImpl { Q_OBJECT Q_INTERFACES(QtMvvm::ISettingsSetupLoader) public: Q_INVOKABLE SettingsConfigLoader(QObject *parent = nullptr); void changeDefaultIcon(const QUrl &defaultIcon) override; SettingsElements::Setup loadSetup(const QString &filePath, const QString &frontend, const QFileSelector *selector) const override; private: QUrl _defaultIcon; mutable QCache _cache; SettingsElements::Setup *convertSettings(const SettingsConfigType &settings) const; template SettingsElements::Category convertCategory(const CategoryType &category, const QList> &content) const; template SettingsElements::Section convertSection(const SectionType §ion, const QList> &content) const; template SettingsElements::Group convertGroup(const GroupType &group, const QList> &content) const; }; class SettingsConfigException : public SettingsLoaderException { public: SettingsConfigException(SettingsConfigBase::Exception &exception); SettingsConfigException(QByteArray what); const char *what() const noexcept override; void raise() const override; QException *clone() const override; private: const QByteArray _what; }; } #endif // SETTINGSCONFIGLOADER_P_H