Skip to content

Commit

Permalink
fix: error datetime tooltip
Browse files Browse the repository at this point in the history
issue: linuxdeepin/developer-center#7056
log: correct longtimeformat and timeformat str
  • Loading branch information
tsic404 authored and deepin-bot[bot] committed Jan 23, 2024
1 parent 3939ca9 commit 7097ae7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frame/window/components/datetimedisplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ void DateTimeDisplayer::initDConfig()
m_shortDateFormatStr = currentLocale.dateFormat(QLocale::ShortFormat);
}

if (!m_config->isDefaultValue(shortDateFormat_key)) {
m_longDateFormatStr = m_config->value(longDateFormat_key).toString();
} else {
m_longDateFormatStr = currentLocale.dateFormat(QLocale::LongFormat);
}

if (!m_config->isDefaultValue(shortTimeFormat_key)) {
m_shortTimeFormatStr = m_config->value(shortTimeFormat_key).toString();
} else {
Expand All @@ -106,12 +112,6 @@ void DateTimeDisplayer::initDConfig()
m_longTimeFormatStr = currentLocale.timeFormat(QLocale::LongFormat);
}

if (!m_config->isDefaultValue(longDateFormat_key)) {
m_longDateFormatStr = m_config->value(longDateFormat_key).toString();
} else {
m_longTimeFormatStr = currentLocale.dateFormat(QLocale::LongFormat);
}

connect(m_config, &DTK_CORE_NAMESPACE::DConfig::valueChanged, this, [this] (const QString &key) {
if (key == shortDateFormat_key) {
m_shortDateFormatStr = m_config->value(key).toString();
Expand Down

0 comments on commit 7097ae7

Please sign in to comment.