Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 支持插件设置护眼模式 #258

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Conversation

fly602
Copy link
Contributor

@fly602 fly602 commented Jul 2, 2024

插件设置护眼模式开关,控制中心色温做联动;
本地保存色温开启时的配置,以供护眼模式使能时恢复配置

插件设置护眼模式开关,控制中心色温做联动;
本地保存色温开启时的配置,以供护眼模式使能时恢复配置
@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • saveColorTempValueInCfg函数中,对ColorTemperatureMode的赋值应该在if语句之前进行,以避免在if语句中赋值时未使用ColorTemperatureMode的值。
  • saveColorTempModeInCfg函数中的if语句可以简化,直接使用cfg.ColorTemperatureMode != ColorTemperatureModeNone来判断是否需要设置ColorTemperatureModeOn
  • Start函数中,so.SetWriteCallback的错误处理应该更详细,不仅仅返回错误,还应该记录日志或提供其他错误处理机制。
  • Start函数中的logger.Warning(err)应该在return dbusutil.ToError(err)之前调用,以便在日志中记录错误信息。
  • setPropColorTemperatureEnabled函数的错误处理应该更详细,不仅仅返回错误,还应该记录日志或提供其他错误处理机制。
  • getSuitableUserMonitorModeConfig函数的错误处理应该更详细,不仅仅返回错误,还应该记录日志或提供其他错误处理机制。
  • setColorTempMode函数的错误处理应该更详细,不仅仅返回错误,还应该记录日志或提供其他错误处理机制。
  • UserMonitorModeConfig结构体中的ColorTemperatureModeOn字段应该有注释说明其用途,以便其他开发者理解其含义。
  • fix函数中,对ColorTemperatureMode的赋值应该在if语句之前进行,以避免在if语句中赋值时未使用ColorTemperatureMode的值。
  • getDefaultUserMonitorModeConfig函数中的// TODO注释应该被解决或者被删除,以保持代码的整洁。

是否建议立即修改:

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, zsien

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fly602
Copy link
Contributor Author

fly602 commented Jul 3, 2024

/merge

@deepin-bot deepin-bot bot merged commit 1820b80 into linuxdeepin:master Jul 3, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants