diff options
Diffstat (limited to 'src/corelib/time/qdatetimeparser.cpp')
-rw-r--r-- | src/corelib/time/qdatetimeparser.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index 24f3969851..790c20004a 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -410,7 +410,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) QDTPDEBUGN("parseFormat: %s", newFormat.toLatin1().constData()); QVector<SectionNode> newSectionNodes; - Sections newDisplay = 0; + Sections newDisplay; QStringList newSeparators; int i, index = 0; int add = 0; @@ -431,7 +431,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) switch (sect) { case 'H': case 'h': - if (parserType != QVariant::Date) { + if (parserType != QMetaType::QDate) { const Section hour = (sect == 'h') ? Hour12Section : Hour24Section; const SectionNode sn = { hour, i - add, countRepeat(newFormat, i, 2), 0 }; newSectionNodes.append(sn); @@ -442,7 +442,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } break; case 'm': - if (parserType != QVariant::Date) { + if (parserType != QMetaType::QDate) { const SectionNode sn = { MinuteSection, i - add, countRepeat(newFormat, i, 2), 0 }; newSectionNodes.append(sn); appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote); @@ -452,7 +452,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } break; case 's': - if (parserType != QVariant::Date) { + if (parserType != QMetaType::QDate) { const SectionNode sn = { SecondSection, i - add, countRepeat(newFormat, i, 2), 0 }; newSectionNodes.append(sn); appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote); @@ -463,7 +463,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) break; case 'z': - if (parserType != QVariant::Date) { + if (parserType != QMetaType::QDate) { const SectionNode sn = { MSecSection, i - add, countRepeat(newFormat, i, 3) < 3 ? 1 : 3, 0 }; newSectionNodes.append(sn); appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote); @@ -474,7 +474,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) break; case 'A': case 'a': - if (parserType != QVariant::Date) { + if (parserType != QMetaType::QDate) { const bool cap = (sect == 'A'); const SectionNode sn = { AmPmSection, i - add, (cap ? 1 : 0), 0 }; newSectionNodes.append(sn); @@ -488,7 +488,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } break; case 'y': - if (parserType != QVariant::Time) { + if (parserType != QMetaType::QTime) { const int repeat = countRepeat(newFormat, i, 4); if (repeat >= 2) { const SectionNode sn = { repeat == 4 ? YearSection : YearSection2Digits, @@ -502,7 +502,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } break; case 'M': - if (parserType != QVariant::Time) { + if (parserType != QMetaType::QTime) { const SectionNode sn = { MonthSection, i - add, countRepeat(newFormat, i, 4), 0 }; newSectionNodes.append(sn); newSeparators.append(unquote(newFormat.midRef(index, i - index))); @@ -512,7 +512,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } break; case 'd': - if (parserType != QVariant::Time) { + if (parserType != QMetaType::QTime) { const int repeat = countRepeat(newFormat, i, 4); const Section sectionType = (repeat == 4 ? DayOfWeekSectionLong : (repeat == 3 ? DayOfWeekSectionShort : DaySection)); @@ -525,7 +525,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } break; case 't': - if (parserType != QVariant::Time) { + if (parserType != QMetaType::QTime) { const SectionNode sn = { TimeZoneSection, i - add, countRepeat(newFormat, i, 4), 0 }; newSectionNodes.append(sn); appendSeparator(&newSeparators, newFormat, index, i - index, lastQuote); @@ -1164,7 +1164,7 @@ QDateTimeParser::scanString(const QDateTime &defaultValue, } pos += separator.size(); sectionNodes[index].pos = pos; - int *current = 0; + int *current = nullptr; const SectionNode sn = sectionNodes.at(index); ParsedSection sect; @@ -1265,7 +1265,7 @@ QDateTimeParser::scanString(const QDateTime &defaultValue, return StateNode(); } - if (parserType != QVariant::Time) { + if (parserType != QMetaType::QTime) { if (year % 100 != year2digits && (isSet & YearSection2Digits)) { if (!(isSet & YearSection)) { year = (year / 100) * 100; @@ -1335,7 +1335,7 @@ QDateTimeParser::scanString(const QDateTime &defaultValue, } } - if (parserType != QVariant::Date) { + if (parserType != QMetaType::QDate) { if (isSet & Hour12Section) { const bool hasHour = isSet & Hour24Section; if (ampm == -1) { @@ -1373,7 +1373,7 @@ QDateTimeParser::scanString(const QDateTime &defaultValue, // If hour wasn't specified, check the default we're using exists on the // given date (which might be a spring-forward, skipping an hour). - if (parserType == QVariant::DateTime && !(isSet & HourSectionMask) && !when.isValid()) { + if (parserType == QMetaType::QDateTime && !(isSet & HourSectionMask) && !when.isValid()) { qint64 msecs = when.toMSecsSinceEpoch(); // Fortunately, that gets a useful answer, even though when is invalid ... const QDateTime replace = @@ -1809,7 +1809,7 @@ int QDateTimeParser::SectionNode::maxChange() const QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const { - FieldInfo ret = 0; + FieldInfo ret; const SectionNode &sn = sectionNode(index); switch (sn.type) { case MSecSection: |