diff options
Diffstat (limited to 'src/ui/struct/SettingsObject.h')
-rw-r--r-- | src/ui/struct/SettingsObject.h | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/src/ui/struct/SettingsObject.h b/src/ui/struct/SettingsObject.h index d1e85be5..a9e5819f 100644 --- a/src/ui/struct/SettingsObject.h +++ b/src/ui/struct/SettingsObject.h @@ -1,5 +1,5 @@ /** - * Copyright (C) 2021 Saturneric + * Copyright (C) 2021 Saturneric <[email protected]> * * This file is part of GpgFrontend. * @@ -20,41 +20,36 @@ * the gpg4usb project, which is under GPL-3.0-or-later. * * All the source code of GpgFrontend was modified and released by - * Saturneric<[email protected]> starting on May 12, 2021. + * Saturneric <[email protected]> starting on May 12, 2021. * * SPDX-License-Identifier: GPL-3.0-or-later * */ -#ifndef GPGFRONTEND_SETTINGSOBJECT_H -#define GPGFRONTEND_SETTINGSOBJECT_H - -#include <utility> - -#include "core/function/DataObjectOperator.h" +#pragma once namespace GpgFrontend::UI { /** * @brief The SettingsObject class - * This class is used to store settings for the application securely. + * This class is used to store data for the application securely. * */ -class SettingsObject : public nlohmann::json { +class SettingsObject : public QJsonObject { public: /** * @brief Construct a new Settings Object object * * @param settings_name The name of the settings object */ - explicit SettingsObject(std::string settings_name); + explicit SettingsObject(QString settings_name); /** * @brief Construct a new Settings Object object * * @param _sub_json */ - explicit SettingsObject(nlohmann::json _sub_json, bool); + explicit SettingsObject(QJsonObject sub_json); /** * @brief Destroy the Settings Object object @@ -65,24 +60,10 @@ class SettingsObject : public nlohmann::json { /** * @brief * - * @param key - * @param default_value - * @return nlohmann::json& - */ - nlohmann::json& Check(const std::string& key, - const nlohmann::json& default_value); - - /** - * @brief - * - * @param key - * @return SettingsObject */ - SettingsObject Check(const std::string& key); + void Store(const QJsonObject&); private: - std::string settings_name_; ///< + QString settings_name_; ///< }; } // namespace GpgFrontend::UI - -#endif // GPGFRONTEND_SETTINGSOBJECT_H |