Skip to content

Commit

Permalink
docs: add docs for settings
Browse files Browse the repository at this point in the history
给dsettingsdconfigbackend添加文档注释

Log: add docs

Task: deepin-community/coding-quarter#26
  • Loading branch information
chenchongbiao committed Dec 3, 2022
1 parent 3234c94 commit fed0117
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
32 changes: 32 additions & 0 deletions docs/settings/backend/dsettingsdconfigbackend.zh_CN.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*!
@~chinese
@file include/settings/backend/dsettingsdconfigbackend.h
@ingroup dsettings

@class Dtk::Core::DSettingsDConfigBackend dsettingsdconfigbackend.h
@brief 配置存储到DConfig

@fn Dtk::Core::DSettingsDConfigBackend::DSettingsDConfigBackend(const QString &name, const QString &subpath = QString(), QObject *parent = nullptr)
@brief DSettingsDConfigBackend构造函数,使用DConfig为配置文件名,保存数据到配置文件。
@param[in] name 配置文件名
@param[in] subpath 配置文件名的子目录
@param[in] parent 父对象

@fn virtual QStringList Dtk::Core::DSettingsDConfigBackend::keys() const
@brief 返回Dconfig的全部键值
@return

@fn virtual QVariant Dtk::Core::DSettingsDConfigBackend::getOption(const QString &key) const
@brief 从DConfig获取键值
@param[in] key
@return

@fn virtual void QVariant Dtk::Core::DSettingsDConfigBackend::doSetOption(const QString &key, const QVariant &value)
@brief 给DConfig设置键值
@param[in] key
@param[in] value

@fn virtual void Dtk::Core::DSettingsDConfigBackend::doSync()
@brief 触发DSettings将选项值保存到DConfig

*/
24 changes: 15 additions & 9 deletions src/settings/backend/dsettingsdconfigbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ class DSettingsDConfigBackendPrivate
};

/*!
\class Dtk::Core::DSettingsDConfigBackend
@~english
@class Dtk::Core::DSettingsDConfigBackend
\inmodule dtkcore
\brief Storage DSetttings to an DConfig.
@brief Storage DSetttings to an DConfig.
*/

/*!
\brief Save data to configure file name with DConfig.
@~english
@brief Save data to configure file name with DConfig.
\a name configure file name.
\a subpath subdirectory of configure file name.
\a parent
Expand All @@ -48,8 +50,9 @@ DSettingsDConfigBackend::~DSettingsDConfigBackend()
}

/*!
\brief List all keys of DConfig
\return
@~english
@brief List all keys of DConfig
@return
*/
QStringList DSettingsDConfigBackend::keys() const
{
Expand All @@ -58,9 +61,10 @@ QStringList DSettingsDConfigBackend::keys() const
}

/*!
\brief Get value of key from DConfig
@~english
@brief Get value of key from DConfig
\a key
\return
@return
*/
QVariant DSettingsDConfigBackend::getOption(const QString &key) const
{
Expand All @@ -69,7 +73,8 @@ QVariant DSettingsDConfigBackend::getOption(const QString &key) const
}

/*!
\brief Set value of key to DConfig
@~english
@brief Set value of key to DConfig
\a key
\a value
*/
Expand All @@ -82,7 +87,8 @@ void DSettingsDConfigBackend::doSetOption(const QString &key, const QVariant &va
}

/*!
\brief Trigger DSettings to save option value to DConfig
@~english
@brief Trigger DSettings to save option value to DConfig
*/
void DSettingsDConfigBackend::doSync()
{
Expand Down

0 comments on commit fed0117

Please sign in to comment.