diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qdatetimeparser.cpp | 20 | ||||
-rw-r--r-- | src/corelib/tools/qdatetimeparser_p.h | 4 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 26449750d0..d4004098c5 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1355,22 +1355,20 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex /*! \internal - returns - 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 - + Returns + AM if str == tr("AM") + PM if str == tr("PM") + PossibleAM if str can become tr("AM") + PossiblePM if str can become tr("PM") + PossibleBoth if str can become tr("PM") and can become tr("AM") + Neither if str can't become anything sensible */ - -int QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const +QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionIndex, int *used) const { const SectionNode &s = sectionNode(sectionIndex); if (s.type != AmPmSection) { qWarning("QDateTimeParser::findAmPm Internal error"); - return -1; + return Neither; } if (used) *used = str.size(); diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h index fe6bfa9c3c..257cb6e2cc 100644 --- a/src/corelib/tools/qdatetimeparser_p.h +++ b/src/corelib/tools/qdatetimeparser_p.h @@ -97,7 +97,7 @@ public: none.zeroesAdded = 0; } virtual ~QDateTimeParser() {} - enum { + enum AmPmFinder { Neither = -1, AM = 0, PM = 1, @@ -201,7 +201,7 @@ public: int findDay(const QString &str1, int intDaystart, int sectionIndex, QString *dayName = 0, int *used = 0) const; #endif - int findAmPm(QString &str1, int index, int *used = 0) const; + AmPmFinder findAmPm(QString &str, int index, int *used = 0) const; bool potentialValue(const QString &str, int min, int max, int index, const QDateTime ¤tValue, int insert) const; bool skipToNextSection(int section, const QDateTime ¤t, const QString §ionText) const; |