Fix -no-feature-datestring and -no-feature-xmlstreamreader
Task-number: QTBUG-112830 Change-Id: I25dad19dee98d64eb5c226cbcc2b628f2a371ea4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
b2e0ff4bca
commit
3ee98d6adf
@ -1237,7 +1237,7 @@ bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSy
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
// see qfilesystemengine_mac.mm
|
||||
#elif defined(QT_BOOTSTRAPPED) || !defined(AT_FDCWD) || defined(Q_OS_ANDROID)
|
||||
#elif defined(QT_BOOTSTRAPPED) || !defined(AT_FDCWD) || defined(Q_OS_ANDROID) || !QT_CONFIG(datestring)
|
||||
// bootstrapped tools don't need this, and we don't want QStorageInfo
|
||||
//static
|
||||
bool QFileSystemEngine::supportsMoveFileToTrash()
|
||||
@ -1607,7 +1607,7 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &source,
|
||||
newLocation = QFileSystemEntry(op.trashPath + "/files/"_L1 + uniqueTrashedName);
|
||||
return true;
|
||||
}
|
||||
#endif // !Q_OS_DARWIN && !QT_BOOTSTRAPPED
|
||||
#endif // !Q_OS_DARWIN && (!QT_BOOTSTRAPPED && AT_FDCWD && !Q_OS_ANDROID && QT_CONFIG(datestring))
|
||||
|
||||
//static
|
||||
bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
|
||||
|
@ -1392,10 +1392,12 @@ static constexpr struct : QMetaTypeModuleHelper
|
||||
result = QCborArray::fromStringList(source);
|
||||
return true;
|
||||
);
|
||||
#if QT_CONFIG(datestring)
|
||||
QMETATYPE_CONVERTER(QCborValue, QDate,
|
||||
result = QCborValue(source.startOfDay());
|
||||
return true;
|
||||
);
|
||||
#endif
|
||||
QMETATYPE_CONVERTER_ASSIGN(QCborValue, QUrl);
|
||||
QMETATYPE_CONVERTER(QCborValue, QJsonValue,
|
||||
result = QCborValue::fromJsonValue(source);
|
||||
@ -1420,6 +1422,7 @@ static constexpr struct : QMetaTypeModuleHelper
|
||||
QMETATYPE_CONVERTER_ASSIGN(QCborValue, QCborMap);
|
||||
QMETATYPE_CONVERTER_ASSIGN(QCborValue, QCborArray);
|
||||
|
||||
#if QT_CONFIG(datestring)
|
||||
QMETATYPE_CONVERTER_ASSIGN(QCborValue, QDateTime);
|
||||
QMETATYPE_CONVERTER(QDateTime, QCborValue,
|
||||
if (source.isDateTime()) {
|
||||
@ -1428,6 +1431,7 @@ static constexpr struct : QMetaTypeModuleHelper
|
||||
}
|
||||
return false;
|
||||
);
|
||||
#endif
|
||||
|
||||
QMETATYPE_CONVERTER_ASSIGN(QCborValue, QCborSimpleType);
|
||||
QMETATYPE_CONVERTER(QCborSimpleType, QCborValue,
|
||||
|
@ -775,6 +775,7 @@ static QCborValue::Type convertToExtendedType(QCborContainerPrivate *d)
|
||||
};
|
||||
|
||||
switch (tag) {
|
||||
#if QT_CONFIG(datestring)
|
||||
case qint64(QCborKnownTags::DateTimeString):
|
||||
case qint64(QCborKnownTags::UnixTime_t): {
|
||||
QDateTime dt;
|
||||
@ -814,6 +815,7 @@ static QCborValue::Type convertToExtendedType(QCborContainerPrivate *d)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
case qint64(QCborKnownTags::Url):
|
||||
@ -2043,6 +2045,7 @@ QCborValue::QCborValue(const QCborValue &other) noexcept
|
||||
container->ref.ref();
|
||||
}
|
||||
|
||||
#if QT_CONFIG(datestring)
|
||||
/*!
|
||||
Creates a QCborValue object of the date/time extended type and containing
|
||||
the value represented by \a dt. The value can later be retrieved using
|
||||
@ -2063,6 +2066,7 @@ QCborValue::QCborValue(const QDateTime &dt)
|
||||
t = DateTime;
|
||||
container->elements[1].type = String;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
/*!
|
||||
@ -2206,6 +2210,7 @@ QString QCborValue::toString(const QString &defaultValue) const
|
||||
return container->stringAt(n);
|
||||
}
|
||||
|
||||
#if QT_CONFIG(datestring)
|
||||
/*!
|
||||
Returns the date/time value stored in this QCborValue, if it is of the
|
||||
date/time extended type. Otherwise, it returns \a defaultValue.
|
||||
@ -2229,6 +2234,7 @@ QDateTime QCborValue::toDateTime(const QDateTime &defaultValue) const
|
||||
Q_ASSERT((container->elements.at(1).flags & Element::StringIsUtf16) == 0);
|
||||
return QDateTime::fromString(byteData->asLatin1(), Qt::ISODateWithMs);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
/*!
|
||||
@ -3173,8 +3179,10 @@ size_t qHash(const QCborValue &value, size_t seed)
|
||||
return seed;
|
||||
case QCborValue::Double:
|
||||
return qHash(value.toDouble(), seed);
|
||||
#if QT_CONFIG(datestring)
|
||||
case QCborValue::DateTime:
|
||||
return qHash(value.toDateTime(), seed);
|
||||
#endif
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
case QCborValue::Url:
|
||||
return qHash(value.toUrl(), seed);
|
||||
@ -3308,8 +3316,10 @@ static QDebug debugContents(QDebug &dbg, const QCborValue &v)
|
||||
else
|
||||
return dbg << v.toDouble();
|
||||
}
|
||||
#if QT_CONFIG(datestring)
|
||||
case QCborValue::DateTime:
|
||||
return dbg << v.toDateTime();
|
||||
#endif
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
case QCborValue::Url:
|
||||
return dbg << v.toUrl();
|
||||
|
@ -122,7 +122,9 @@ public:
|
||||
: QCborValue(QCborTag(t_), tv)
|
||||
{}
|
||||
|
||||
#if QT_CONFIG(datestring)
|
||||
explicit QCborValue(const QDateTime &dt);
|
||||
#endif
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
explicit QCborValue(const QUrl &url);
|
||||
# if QT_CONFIG(regularexpression)
|
||||
@ -196,7 +198,9 @@ public:
|
||||
|
||||
QByteArray toByteArray(const QByteArray &defaultValue = {}) const;
|
||||
QString toString(const QString &defaultValue = {}) const;
|
||||
#if QT_CONFIG(datestring)
|
||||
QDateTime toDateTime(const QDateTime &defaultValue = {}) const;
|
||||
#endif
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
QUrl toUrl(const QUrl &defaultValue = {}) const;
|
||||
# if QT_CONFIG(regularexpression)
|
||||
@ -346,8 +350,10 @@ public:
|
||||
{ return concrete().toByteArray(defaultValue); }
|
||||
QString toString(const QString &defaultValue = {}) const
|
||||
{ return concrete().toString(defaultValue); }
|
||||
#if QT_CONFIG(datestring)
|
||||
QDateTime toDateTime(const QDateTime &defaultValue = {}) const
|
||||
{ return concrete().toDateTime(defaultValue); }
|
||||
#endif
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
QUrl toUrl(const QUrl &defaultValue = {}) const
|
||||
{ return concrete().toUrl(defaultValue); }
|
||||
@ -516,8 +522,10 @@ public:
|
||||
{ return concreteByteArray(*this, defaultValue); }
|
||||
QString toString(const QString &defaultValue = {}) const
|
||||
{ return concreteString(*this, defaultValue); }
|
||||
#if QT_CONFIG(datestring)
|
||||
QDateTime toDateTime(const QDateTime &defaultValue = {}) const
|
||||
{ return concrete().toDateTime(defaultValue); }
|
||||
#endif
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
QUrl toUrl(const QUrl &defaultValue = {}) const
|
||||
{ return concrete().toUrl(defaultValue); }
|
||||
|
@ -553,8 +553,10 @@ QVariant QCborValue::toVariant() const
|
||||
// ignore tags
|
||||
return taggedValue().toVariant();
|
||||
|
||||
#if QT_CONFIG(datestring)
|
||||
case DateTime:
|
||||
return toDateTime();
|
||||
#endif
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
case Url:
|
||||
@ -732,8 +734,10 @@ QCborValue QCborValue::fromVariant(const QVariant &variant)
|
||||
return QCborArray::fromStringList(variant.toStringList());
|
||||
case QMetaType::QByteArray:
|
||||
return variant.toByteArray();
|
||||
#if QT_CONFIG(datestring)
|
||||
case QMetaType::QDateTime:
|
||||
return QCborValue(variant.toDateTime());
|
||||
#endif
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
case QMetaType::QUrl:
|
||||
return QCborValue(variant.toUrl());
|
||||
|
@ -3864,7 +3864,6 @@ void QXmlStreamWriterPrivate::writeStartElement(QAnyStringView namespaceUri, QAn
|
||||
tag.namespaceDeclarationsSize = lastNamespaceDeclaration;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xmlstreamreader)
|
||||
/*! Writes the current state of the \a reader. All possible valid
|
||||
states are supported.
|
||||
|
||||
@ -3929,6 +3928,8 @@ void QXmlStreamWriter::writeCurrentToken(const QXmlStreamReader &reader)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // feature xmlstreamwriter
|
||||
#if QT_CONFIG(xmlstreamreader)
|
||||
static constexpr bool isTokenAllowedInContext(QXmlStreamReader::TokenType type,
|
||||
QXmlStreamReaderPrivate::XmlContext ctxt)
|
||||
{
|
||||
@ -4045,7 +4046,6 @@ void QXmlStreamReaderPrivate::checkToken()
|
||||
*/
|
||||
|
||||
#endif // feature xmlstreamreader
|
||||
#endif // feature xmlstreamwriter
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user