summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetimeparser.cpp
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2015-01-02 10:09:21 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-05-28 06:35:44 +0000
commite22d75d0b139fe9e4b11f32ebc5fb1024f493fbe (patch)
tree2af9fa35f658e444c687beff53cbde8f3ec20251 /src/corelib/tools/qdatetimeparser.cpp
parent765fea8dad269872a7fbb80a253367ac5e905259 (diff)
Translate AM/PM under the QDateTimeParser context so it is consistent
In order to ensure that the same text will be used in both QDateTimeParser and QDateTimeEdit, use the QDateTimeParser context for the AM and PM strings. Task-number: QTBUG-251 Change-Id: I89b0809825251181440bf19cbe5828024a43acfb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools/qdatetimeparser.cpp')
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 255e9557e2..eaa695ef27 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -1362,11 +1362,11 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex
\internal
returns
- 0 if str == QDateTimeEdit::tr("AM")
- 1 if str == QDateTimeEdit::tr("PM")
- 2 if str can become QDateTimeEdit::tr("AM")
- 3 if str can become QDateTimeEdit::tr("PM")
- 4 if str can become QDateTimeEdit::tr("PM") and can become QDateTimeEdit::tr("AM")
+ 0 if str == tr("AM")
+ 1 if str == tr("PM")
+ 2 if str can become tr("AM")
+ 3 if str can become tr("PM")
+ 4 if str can become tr("PM") and can become tr("AM")
-1 can't become anything sensible
*/
@@ -1737,9 +1737,9 @@ QDateTime QDateTimeParser::getMaximum() const
QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const
{
if (ap == AmText) {
- return (cs == UpperCase ? QLatin1String("AM") : QLatin1String("am"));
+ return (cs == UpperCase ? tr("AM") : tr("am"));
} else {
- return (cs == UpperCase ? QLatin1String("PM") : QLatin1String("pm"));
+ return (cs == UpperCase ? tr("PM") : tr("pm"));
}
}