QDateTime: drop quotes in QDebug output

As requested in review of 1d2efe1f27.
I didn't add a comma in front of the timeSpec() as the other fields
aren't separated by commas, either.

Change-Id: I54d74b7199ca7e46e28d2ceca22b02205e318c90
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2015-02-15 21:01:39 +01:00
parent 94d79cf3d5
commit de8a34b9bd
2 changed files with 3 additions and 2 deletions

View File

@ -4965,7 +4965,8 @@ QDebug operator<<(QDebug dbg, const QTime &time)
QDebug operator<<(QDebug dbg, const QDateTime &date)
{
QDebugStateSaver saver(dbg);
dbg.nospace() << "QDateTime(" << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t"))
dbg.nospace() << "QDateTime(";
dbg.noquote() << date.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t"))
<< ' ' << date.timeSpec();
switch (date.d->m_spec) {
case Qt::UTC:

View File

@ -70,7 +70,7 @@ void tst_QNoDebug::streaming() const
{
QDateTime dt(QDate(1,2,3),QTime(4,5,6));
const QString debugString = dt.toString(QStringLiteral("yyyy-MM-dd HH:mm:ss.zzz t"));
QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(\"%1\" Qt::TimeSpec(LocalTime))").arg(debugString)));
QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(%1 Qt::TimeSpec(LocalTime))").arg(debugString)));
qWarning() << dt;
}