From e226b0f94afc85f79d82fc54421487bf2a529ba5 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 19 Sep 2018 13:28:13 +0200 Subject: Modernize the "textdate" feature Change-Id: Ic0b6f13e17c301ed66d6a8297c242086c94ac87d Reviewed-by: Edward Welbourne Reviewed-by: Lars Knoll --- src/corelib/tools/qdatetimeparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qdatetimeparser.cpp') diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index d03518e70d..2007cd597b 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -612,7 +612,7 @@ int QDateTimeParser::sectionSize(int sectionIndex) const int QDateTimeParser::sectionMaxSize(Section s, int count) const { -#ifndef QT_NO_TEXTDATE +#if QT_CONFIG(textdate) int mcount = 12; #endif @@ -636,14 +636,14 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const case DaySection: return 2; case DayOfWeekSectionShort: case DayOfWeekSectionLong: -#ifdef QT_NO_TEXTDATE +#if !QT_CONFIG(textdate) return 2; #else mcount = 7; Q_FALLTHROUGH(); #endif case MonthSection: -#ifdef QT_NO_TEXTDATE +#if !QT_CONFIG(textdate) return 2; #else if (count <= 2) -- cgit v1.2.3 From b26cd68bf61346273a5a03bbc1e60a7cdffa4f0d Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 19 Sep 2018 13:31:18 +0200 Subject: Modernize the "datestring" feature Change-Id: I2236a456fe3758d9054b22e36fe6316f3522d533 Reviewed-by: Lars Knoll Reviewed-by: Edward Welbourne --- src/corelib/tools/qdatetimeparser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/corelib/tools/qdatetimeparser.cpp') diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 2007cd597b..18c44c3a17 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -77,7 +77,7 @@ QDateTimeParser::~QDateTimeParser() int QDateTimeParser::getDigit(const QDateTime &t, int index) const { if (index < 0 || index >= sectionNodes.size()) { -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) qWarning("QDateTimeParser::getDigit() Internal error (%s %d)", qPrintable(t.toString()), index); #else @@ -103,7 +103,7 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const default: break; } -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) qWarning("QDateTimeParser::getDigit() Internal error 2 (%s %d)", qPrintable(t.toString()), index); #else @@ -127,7 +127,7 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const { if (index < 0 || index >= sectionNodes.size()) { -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) qWarning("QDateTimeParser::setDigit() Internal error (%s %d %d)", qPrintable(v.toString()), index, newVal); #else @@ -725,7 +725,7 @@ QString QDateTimeParser::sectionText(int sectionIndex) const } -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) QDateTimeParser::ParsedSection QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionIndex, @@ -1727,7 +1727,7 @@ QDateTimeParser::AmPmFinder QDateTimeParser::findAmPm(QString &str, int sectionI return PossibleBoth; return (!broken[amindex] ? PossibleAM : PossiblePM); } -#endif // QT_NO_DATESTRING +#endif // datestring /*! \internal @@ -1958,7 +1958,7 @@ QString QDateTimeParser::stateName(State s) const } } -#ifndef QT_NO_DATESTRING +#if QT_CONFIG(datestring) bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const { QDateTime val(QDate(1900, 1, 1), QDATETIMEEDIT_TIME_MIN); @@ -1983,7 +1983,7 @@ bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) con } return true; } -#endif // QT_NO_DATESTRING +#endif // datestring QDateTime QDateTimeParser::getMinimum() const { -- cgit v1.2.3