Skip to content

Commit

Permalink
fix: timezone set error
Browse files Browse the repository at this point in the history
when system timezone change, User TimeZone property should not update
again if current set timezone is custom timezone

Log:
  • Loading branch information
dengbo11 committed Nov 2, 2023
1 parent 220d49c commit 2714ff8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions timedate1/handle_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package timedate

import (
"github.com/godbus/dbus/v5"
"github.com/linuxdeepin/go-lib/strv"
)

func (m *Manager) listenPropChanged() {
Expand Down Expand Up @@ -57,6 +58,12 @@ func (m *Manager) listenPropChanged() {
return
}
logger.Debug("property Timezone changed to", value)

// 如果要设置的时区是上海时区且当前的时区是自定义时区, 已经在SetTimezone更新过Timezone属性,此处不需要再更新
if value == "Asia/Shanghai" && strv.Strv(customTimeZoneList).Contains(m.Timezone) {
return
}

m.PropsMu.Lock()
m.setPropTimezone(value)
m.PropsMu.Unlock()
Expand Down

0 comments on commit 2714ff8

Please sign in to comment.