Fix(datetime interface): cannot set Beijing time zone
Description: cannot set Beijing time zone Log: 时区设置北京无效 Bug: https://gitee.com/openkylin/ukui-control-center/issues/I981M3?from=project-issue
This commit is contained in:
parent
34cd7d241d
commit
ed87159726
|
@ -1336,7 +1336,9 @@ void Theme::changeEffectSlot(bool checked)
|
|||
// 提供给外部监听特效接口
|
||||
setEffectStatus(checked);
|
||||
mTranWidget->setVisible(checked && !UkccCommon::isTablet());
|
||||
mCornerWidget->setVisible(checked && !UkccCommon::isTablet());
|
||||
#ifdef Nile
|
||||
mCornerWidget->setVisible(checked);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Theme::changeEffectBtnSlot(bool checked)
|
||||
|
|
|
@ -44,7 +44,7 @@ QStringList DatetimeInterface::getTimezone()
|
|||
QString showTimezone = reply.value();
|
||||
if (!reply.isValid() || reply.value() != timezoneT) {
|
||||
// showTimezone 异常,重新设置
|
||||
if (showTimezone.isEmpty()) {
|
||||
if (!LINK_SHANGHAI_TIMEZONE.contains(showTimezone) || showTimezone.isEmpty()) {
|
||||
showTimezone = timezoneT;
|
||||
UniversalInterface::self()->ukccSystemDbus()->call("setShowTimezone", showTimezone);
|
||||
}
|
||||
|
@ -91,6 +91,8 @@ QString DatetimeInterface::getTimeMode()
|
|||
void DatetimeInterface::setTimezone(QString timezone)
|
||||
{
|
||||
QString setTimezone = timezone;
|
||||
if (LINK_SHANGHAI_TIMEZONE.contains(timezone))
|
||||
setTimezone = "Asia/Shanghai";
|
||||
QDBusMessage retDBus = timeDateInterface->call("SetTimezone", setTimezone, true);
|
||||
if (retDBus.type() == QDBusMessage::ErrorMessage) {
|
||||
return;
|
||||
|
|
|
@ -39,7 +39,7 @@ private:
|
|||
QDBusInterface *timeDateInterface = nullptr;
|
||||
const QStringList LINK_SHANGHAI_TIMEZONE = {
|
||||
"Asia/Beijing",
|
||||
"Asia/Urumqi"
|
||||
// "Asia/Urumqi"
|
||||
};
|
||||
const QString TIMEZONES_KEY = QString("timezones");
|
||||
|
||||
|
|
Loading…
Reference in New Issue