diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-13 23:03:51 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-13 23:03:51 +0200 |
commit | b7ac036b727784624cf33f5f11b8d2d1b6f16538 (patch) | |
tree | 3214d3689d3de3f5a770d96529d58d4e03424d1f /src/corelib/io | |
parent | 967e4f258cd39991fd2d0ac3753544900d51fbc2 (diff) | |
parent | a7297ed85bc58a1f242b49a643e3abbdc7cf7e24 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
src/network/socket/qabstractsocket.cpp
src/plugins/platforms/winrt/qwinrtscreen.cpp
src/sql/drivers/mysql/qsql_mysql.cpp
Change-Id: Ifb73623d09f53340ee5e10283f1f86b580998902
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdebug.cpp | 56 | ||||
-rw-r--r-- | src/corelib/io/qdebug.h | 16 | ||||
-rw-r--r-- | src/corelib/io/qlockfile_unix.cpp | 6 |
3 files changed, 68 insertions, 10 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 13eccce9da..81af96b96b 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -696,6 +696,62 @@ QDebug &QDebug::resetFormat() */ /*! + \fn QDebug operator<<(QDebug stream, const QList<T> &list) + \relates QDebug + + Writes the contents of \a list to \a stream. \c T needs to + support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QVector<T> &vector) + \relates QDebug + + Writes the contents of \a vector to \a stream. \c T needs to + support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QSet<T> &set) + \relates QDebug + + Writes the contents of \a set to \a stream. \c T needs to + support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QMap<Key, T> &map) + \relates QDebug + + Writes the contents of \a map to \a stream. Both \c Key and + \c T need to support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QHash<Key, T> &hash) + \relates QDebug + + Writes the contents of \a hash to \a stream. Both \c Key and + \c T need to support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QPair<T1, T2> &pair) + \relates QDebug + + Writes the contents of \a pair to \a stream. Both \c T1 and + \c T2 need to support streaming into QDebug. +*/ + +/*! + \fn QDebug operator<<(QDebug stream, const QFlags<T> &flag) + \relates QDebug + \since 4.7 + + Writes \a flag to \a stream. +*/ + +/*! \class QDebugStateSaver \inmodule QtCore \brief Convenience class for custom QDebug operators diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 2f626dfc1f..b1a0396f35 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -216,12 +216,12 @@ inline QDebug operator<<(QDebug debug, const QVector<T> &vec) return operator<<(debug, vec.toList()); } -template <class aKey, class aT> -inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map) +template <class Key, class T> +inline QDebug operator<<(QDebug debug, const QMap<Key, T> &map) { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QMap("; - for (typename QMap<aKey, aT>::const_iterator it = map.constBegin(); + for (typename QMap<Key, T>::const_iterator it = map.constBegin(); it != map.constEnd(); ++it) { debug << '(' << it.key() << ", " << it.value() << ')'; } @@ -230,12 +230,12 @@ inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map) return debug.maybeSpace(); } -template <class aKey, class aT> -inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash) +template <class Key, class T> +inline QDebug operator<<(QDebug debug, const QHash<Key, T> &hash) { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QHash("; - for (typename QHash<aKey, aT>::const_iterator it = hash.constBegin(); + for (typename QHash<Key, T>::const_iterator it = hash.constBegin(); it != hash.constEnd(); ++it) debug << '(' << it.key() << ", " << it.value() << ')'; debug << ')'; @@ -276,7 +276,7 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache) return debug.maybeSpace(); } -#ifndef QT_NO_QOBJECT +#if !defined(QT_NO_QOBJECT) && !defined(Q_QDOC) Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug&, int value, const QMetaObject *meta, const char *name); Q_CORE_EXPORT QDebug qt_QMetaEnum_flagDebugOperator(QDebug &dbg, quint64 value, const QMetaObject *meta, const char *name); @@ -305,7 +305,7 @@ inline typename QtPrivate::QEnableIf< !QtPrivate::IsQEnumHelper<T>::Value && !QtPrivate::IsQEnumHelper<QFlags<T> >::Value, QDebug>::Type qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags) -#else // !QT_NO_QOBJECT +#else // !QT_NO_QOBJECT && !Q_QDOC template <class T> inline QDebug qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags) #endif diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 019059917a..365f3e07ab 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -171,8 +171,10 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys() } } // Ensure nobody else can delete the file while we have it - if (!setNativeLocks(fd)) - qWarning() << "setNativeLocks failed:" << strerror(errno); + if (!setNativeLocks(fd)) { + const int errnoSaved = errno; + qWarning() << "setNativeLocks failed:" << qt_error_string(errnoSaved); + } if (qt_write_loop(fd, fileData.constData(), fileData.size()) < fileData.size()) { close(fd); |