Skip to content

Commit

Permalink
fix: Error in modifying the setting area
Browse files Browse the repository at this point in the history
Error in modifying the setting area

pms: BUG-299233
  • Loading branch information
caixr23 committed Jan 10, 2025
1 parent 700d0b1 commit 747ea1f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/plugin-datetime/operation/datetimemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,14 @@ void DatetimeModel::setRegion(const QString &region)

m_regionName = region;
auto reg = m_langRegionsCache.value(region, region);
m_work->setConfigValue(country_key, reg);
Q_EMIT regionChanged(region);
Q_EMIT currentRegionIndexChanged(currentRegionIndex());
for (const auto &locale : m_regions) {
if (locale.territoryToCode(locale.territory()) == reg) {
QString country = locale.countryToString(locale.country());
m_work->setConfigValue(country_key, country);
Q_EMIT regionChanged(region);
Q_EMIT currentRegionIndexChanged(currentRegionIndex());
}
}
}

QStringList DatetimeModel::languagesAndRegions()
Expand Down

0 comments on commit 747ea1f

Please sign in to comment.