diff options
Diffstat (limited to 'src/corelib/io/qstorageinfo.cpp')
-rw-r--r-- | src/corelib/io/qstorageinfo.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp index 27f0552a31..e2c1f0232f 100644 --- a/src/corelib/io/qstorageinfo.cpp +++ b/src/corelib/io/qstorageinfo.cpp @@ -40,6 +40,8 @@ #include "qstorageinfo.h" #include "qstorageinfo_p.h" +#include "qdebug.h" + QT_BEGIN_NAMESPACE /*! @@ -431,4 +433,37 @@ QStorageInfo QStorageInfo::root() volume than the \a second; otherwise returns false. */ +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug debug, const QStorageInfo &s) +{ + QDebugStateSaver saver(debug); + debug.nospace(); + debug.noquote(); + debug << "QStorageInfo("; + if (s.isValid()) { + const QStorageInfoPrivate *d = s.d.constData(); + debug << '"' << d->rootPath << '"'; + if (!d->fileSystemType.isEmpty()) + debug << ", type=" << d->fileSystemType; + if (!d->name.isEmpty()) + debug << ", name=\"" << d->name << '"'; + if (!d->device.isEmpty()) + debug << ", device=\"" << d->device << '"'; + if (!d->subvolume.isEmpty()) + debug << ", subvolume=\"" << d->subvolume << '"'; + if (d->readOnly) + debug << " [read only]"; + debug << (d->ready ? " [ready]" : " [not ready]"); + if (d->bytesTotal > 0) { + debug << ", bytesTotal=" << d->bytesTotal << ", bytesFree=" << d->bytesFree + << ", bytesAvailable=" << d->bytesAvailable; + } + } else { + debug << "invalid"; + } + debug<< ')'; + return debug; +} +#endif // !QT_NO_DEBUG_STREAM + QT_END_NAMESPACE |