-
Notifications
You must be signed in to change notification settings - Fork 94
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(power)!: switch backend from lmt to tlp #559
Conversation
7469f0a
to
414b5e4
Compare
414b5e4
to
cd04867
Compare
"os/exec" | ||
"regexp" | ||
"strings" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
添加空行,下面几处同理
system/power1/manager_powersave.go
Outdated
return | ||
} | ||
var enable bool | ||
// var tlpCfgChanged bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要的变量删掉
system/power1/manager_tlp.go
Outdated
"os/exec" | ||
"path/filepath" | ||
"strings" | ||
//"github.com/linuxdeepin/go-lib/dbusutil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要的包删掉
system/power1/manager_tlp.go
Outdated
if os.IsNotExist(err) { | ||
return false, nil | ||
} | ||
logger.Warning(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这一行可以移到65行
@@ -803,3 +824,12 @@ func (m *Manager) doSetCpuGovernor(governor string) error { | |||
} | |||
return err | |||
} | |||
|
|||
func (m *Manager) setPowerSavingModeEnabled(enable bool) (changed bool) { | |||
changed = m.setPropPowerSavingModeEnabled(enable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果这个属性没有change, 是否还需要写呢
system/power1/manager_powersave.go
Outdated
import ( | ||
"errors" | ||
"github.com/godbus/dbus/v5" | ||
ConfigManager "github.com/linuxdeepin/go-dbus-factory/org.desktopspec.ConfigManager" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigManager小写命名
@@ -694,7 +715,7 @@ func (m *Manager) doSetMode(mode string) error { | |||
break | |||
} | |||
|
|||
m.setPropPowerSavingModeEnabled(false) | |||
m.setPowerSavingModeEnabled(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是否需要加锁,下面两处同理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,我看powersave那边也加锁了,那这边确实要加锁
6ee7982
to
7a259f6
Compare
7a259f6
to
559a4d7
Compare
559a4d7
to
d481b14
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Decodetalkers 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 |
那个锁在manager已经锁了一次了,所以如果再锁就会卡住 |
d481b14
to
846e5be
Compare
需要调研 |
TAG Bot New tag: 6.0.30 |
TAG Bot New tag: 6.0.31 |
846e5be
to
adf72b6
Compare
TAG Bot New tag: 6.0.32 |
TAG Bot New tag: 6.0.33 |
TAG Bot New tag: 6.0.34 |
TAG Bot New tag: 6.0.35 |
Log: