QDateTimeParser::getAmPmText() use QLocale instead of tr()
I am not convinced toUpper/toLower is a generally sound solution here; however, QLocale doesn't make the upper/lower case distinction this parser does and a bug report shows tr() isn't doing an adequate job. Task-number: QTBUG-47815 Change-Id: Iaf654d1d76d4c38d74fc647e168d50debb924a8f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
3b0ea78603
commit
6c473b7e08
@ -1712,11 +1712,9 @@ QDateTime QDateTimeParser::getMaximum() const
|
||||
|
||||
QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const
|
||||
{
|
||||
if (ap == AmText) {
|
||||
return (cs == UpperCase ? tr("AM") : tr("am"));
|
||||
} else {
|
||||
return (cs == UpperCase ? tr("PM") : tr("pm"));
|
||||
}
|
||||
const QLocale loc = locale();
|
||||
QString raw = ap == AmText ? loc.amText() : loc.pmText();
|
||||
return cs == UpperCase ? raw.toUpper() : raw.toLower();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user