summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetimeparser_p.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2016-12-15 10:42:27 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2017-06-20 09:54:19 +0000
commite2eafc0c271e44fd9e8969b003e7f8ecd57cd2e6 (patch)
tree4902e75eb9ad1d0c69eb85311daa2ff4cb88c2d3 /src/corelib/tools/qdatetimeparser_p.h
parent68f19fb630dc02463c2d61fc511de7407687795e (diff)
QDateTimeParser: consolidate #if-ery around QT_NO_DATESTRING
Some private methods were conditioned on QT_NO_TEXTDATE but called (without #if-ery) by methods conditioned on QT_NO_DATESTRING; and various private methods without #if-ery were only called by methods within. Consolidate to #if methods all on QT_NO_DATESTRING. Change-Id: I1dd18037e4e7407c07041036cc5b871b7d693016 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetimeparser_p.h')
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index 25afd3a2ad..ee6f9f3054 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -179,11 +179,9 @@ public:
#ifndef QT_NO_DATESTRING
StateNode parse(QString &input, int &cursorPosition, const QDateTime &defaultValue, bool fixup) const;
-#endif
- bool parseFormat(const QString &format);
-#ifndef QT_NO_DATESTRING
bool fromString(const QString &text, QDate *date, QTime *time) const;
#endif
+ bool parseFormat(const QString &format);
enum FieldInfoFlag {
Numeric = 0x01,
@@ -201,14 +199,15 @@ public:
private:
int sectionMaxSize(Section s, int count) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
+#ifndef QT_NO_DATESTRING
int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
int index, QDateTimeParser::State &state, int *used = 0) const;
-#ifndef QT_NO_TEXTDATE
int findMonth(const QString &str1, int monthstart, int sectionIndex,
QString *monthName = 0, int *used = 0) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = 0, int *used = 0) const;
-#endif
+ int findTimeZone(QStringRef str, const QDateTime&when, int *used) const;
+ static int startsWithLocalTimeZone(const QStringRef name); // implemented in qdatetime.cpp
enum AmPmFinder {
Neither = -1,
@@ -219,8 +218,8 @@ private:
PossibleBoth = 4
};
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
- int findTimeZone(QStringRef str, const QDateTime&when, int *used) const;
- static int startsWithLocalTimeZone(const QStringRef name); // implemented in qdatetime.cpp
+#endif // QT_NO_DATESTRING
+
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,