dde-daemon icon indicating copy to clipboard operation
dde-daemon copied to clipboard

feat(power): adapt dconfig

Open mhduiy opened this issue 9 months ago • 2 comments

gsettings -> dconfig

pms: TASK-374909

Summary by Sourcery

Migrate power module configuration from GSettings to DConfig

Enhancements:

  • Replace GSettings-based configuration with DConfig for power management settings
  • Update property handling to work with DConfig instead of GSettings

Chores:

  • Remove GSettings-related imports and dependencies
  • Update constant definitions to use DConfig keys

mhduiy avatar Apr 07 '25 08:04 mhduiy

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mhduiy

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

deepin-ci-robot avatar Apr 07 '25 08:04 deepin-ci-robot

Reviewer's Guide by Sourcery

This pull request migrates the power management daemon from using gsettings to dconfig for managing configuration settings. This involves replacing gio.Settings and gsprop with dconfig and direct property access, updating initialization and reset logic, and adjusting property change signals.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Replaced gsettings with dconfig for managing power settings.
  • Removed gio import.
  • Removed gsprop import.
  • Removed gsettings related code.
  • Added dconfig related code.
  • Replaced gsettings calls with dconfig calls.
  • Modified property access to use direct struct fields instead of gsprop.
  • Adjusted property change signals to emit based on direct field changes.
  • Updated initialization and reset logic to use dconfig.
  • Removed gsettings connect changed and replaced with dconfig connect changed.
session/power1/manager.go
session/power1/power_dbusutil.go
session/power1/warn_level_config.go
session/power1/power_save_plan.go
session/power1/constant.go
session/power1/utils.go
session/power1/manager_events.go
Refactored WarnLevelConfigManager to directly manage settings and use callbacks.
  • Removed gio.Settings dependency from WarnLevelConfigManager.
  • Modified WarnLevelConfigManager to use direct property access.
  • Adjusted initialization and change notification mechanisms.
  • Removed gsprop bind and replaced with direct assignment.
session/power1/warn_level_config.go
session/power1/manager.go
Updated power save plan to use dconfig for settings.
  • Replaced gsettings calls with dconfig calls in powerSavePlan.
  • Adjusted brightness saving and loading to use dconfig.
  • Removed gsprop bind and replaced with direct assignment.
session/power1/power_save_plan.go
Modified property setters and emitters in power_dbusutil.go.
  • Updated property setters to directly assign values and emit change signals.
  • Removed gsprop set and emit and replaced with direct assignment and emit.
session/power1/power_dbusutil.go
Updated constants to use dconfig keys.
  • Replaced gsettings keys with dconfig keys in constant.go.
session/power1/constant.go
Updated utils to use dconfig.
  • Replaced gsettings connect changed and replaced with dconfig connect changed.
session/power1/utils.go
Updated manager events to use dconfig.
  • Replaced gsettings connect changed and replaced with dconfig connect changed.
session/power1/manager_events.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Apr 07 '25 08:04 sourcery-ai[bot]

TAG Bot

New tag: 6.1.27 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #767

deepin-bot[bot] avatar Apr 17 '25 12:04 deepin-bot[bot]

TAG Bot

New tag: 6.1.28 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #769

deepin-bot[bot] avatar Apr 22 '25 12:04 deepin-bot[bot]

TAG Bot

New tag: 6.1.29 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #775

deepin-bot[bot] avatar Apr 29 '25 05:04 deepin-bot[bot]

TAG Bot

New tag: 6.1.30 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #780

deepin-bot[bot] avatar May 08 '25 09:05 deepin-bot[bot]

TAG Bot

New tag: 6.1.31 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #784

deepin-bot[bot] avatar May 13 '25 11:05 deepin-bot[bot]

TAG Bot

New tag: 6.1.32 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #786

deepin-bot[bot] avatar May 13 '25 13:05 deepin-bot[bot]

TAG Bot

New tag: 6.1.33 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #793

deepin-bot[bot] avatar May 27 '25 12:05 deepin-bot[bot]

TAG Bot

New tag: 6.1.35 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #803

deepin-bot[bot] avatar Jun 05 '25 13:06 deepin-bot[bot]

TAG Bot

New tag: 6.1.36 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #809

deepin-bot[bot] avatar Jun 12 '25 12:06 deepin-bot[bot]

TAG Bot

New tag: 6.1.37 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #811

deepin-bot[bot] avatar Jun 19 '25 08:06 deepin-bot[bot]

TAG Bot

New tag: 6.1.38 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #815

deepin-bot[bot] avatar Jun 20 '25 10:06 deepin-bot[bot]

TAG Bot

New tag: 6.1.39 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #817

deepin-bot[bot] avatar Jun 21 '25 07:06 deepin-bot[bot]

TAG Bot

New tag: 6.1.40 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #819

deepin-bot[bot] avatar Jun 23 '25 09:06 deepin-bot[bot]

TAG Bot

New tag: 6.1.41 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #822

deepin-bot[bot] avatar Jun 27 '25 07:06 deepin-bot[bot]

TAG Bot

New tag: 6.1.42 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #828

deepin-bot[bot] avatar Jul 03 '25 09:07 deepin-bot[bot]

TAG Bot

New tag: 6.1.43 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #834

deepin-bot[bot] avatar Jul 10 '25 13:07 deepin-bot[bot]

TAG Bot

New tag: 6.1.44 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #837

deepin-bot[bot] avatar Jul 15 '25 13:07 deepin-bot[bot]

TAG Bot

New tag: 6.1.45 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #843

deepin-bot[bot] avatar Jul 22 '25 03:07 deepin-bot[bot]

TAG Bot

New tag: 6.1.46 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #852

deepin-bot[bot] avatar Jul 31 '25 11:07 deepin-bot[bot]

TAG Bot

New tag: 6.1.47 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #853

deepin-bot[bot] avatar Aug 01 '25 01:08 deepin-bot[bot]

TAG Bot

New tag: 6.1.48 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #856

deepin-bot[bot] avatar Aug 08 '25 03:08 deepin-bot[bot]

TAG Bot

New tag: 6.1.49 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #857

deepin-bot[bot] avatar Aug 12 '25 02:08 deepin-bot[bot]

TAG Bot

New tag: 6.1.50 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #862

deepin-bot[bot] avatar Aug 15 '25 02:08 deepin-bot[bot]

TAG Bot

New tag: 6.1.51 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #871

deepin-bot[bot] avatar Aug 21 '25 06:08 deepin-bot[bot]

TAG Bot

New tag: 6.1.52 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #881

deepin-bot[bot] avatar Aug 28 '25 12:08 deepin-bot[bot]

TAG Bot

New tag: 6.1.53 DISTRIBUTION: unstable Suggest: synchronizing this PR through rebase #888

deepin-bot[bot] avatar Sep 04 '25 13:09 deepin-bot[bot]