summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstorageinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qstorageinfo.cpp')
-rw-r--r--src/corelib/io/qstorageinfo.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp
index 2a12c2cd85..3ed0fd8128 100644
--- a/src/corelib/io/qstorageinfo.cpp
+++ b/src/corelib/io/qstorageinfo.cpp
@@ -9,6 +9,8 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcStorageInfo, "qt.core.qstorageinfo", QtWarningMsg)
+
QT_IMPL_METATYPE_EXTERN(QStorageInfo)
/*!
@@ -20,6 +22,8 @@ QT_IMPL_METATYPE_EXTERN(QStorageInfo)
\ingroup io
\ingroup shared
+ \compares equality
+
Allows retrieving information about the volume's space, its mount point,
label, and filesystem name.
@@ -37,6 +41,11 @@ QT_IMPL_METATYPE_EXTERN(QStorageInfo)
\snippet code/src_corelib_io_qstorageinfo.cpp 2
*/
+QStorageInfo::QStorageInfo(QStorageInfoPrivate &dd)
+ : d(&dd)
+{
+}
+
/*!
Constructs an empty QStorageInfo object.
@@ -381,22 +390,29 @@ QStorageInfo QStorageInfo::root()
}
/*!
- \fn bool QStorageInfo::operator==(const QStorageInfo &first, const QStorageInfo &second)
+ \fn bool QStorageInfo::operator==(const QStorageInfo &lhs, const QStorageInfo &rhs)
- Returns true if the \a first QStorageInfo object refers to the same drive or volume
- as the \a second; otherwise it returns false.
+ Returns \c true if the QStorageInfo object \a lhs refers to the same drive or
+ volume as the QStorageInfo object \a rhs; otherwise it returns \c false.
Note that the result of comparing two invalid QStorageInfo objects is always
positive.
*/
/*!
- \fn bool QStorageInfo::operator!=(const QStorageInfo &first, const QStorageInfo &second)
+ \fn bool QStorageInfo::operator!=(const QStorageInfo &lhs, const QStorageInfo &rhs)
- Returns true if the \a first QStorageInfo object refers to a different drive or
- volume than the \a second; otherwise returns false.
+ Returns \c true if the QStorageInfo object \a lhs refers to a different drive or
+ volume than the QStorageInfo object \a rhs; otherwise returns \c false.
*/
+bool comparesEqual(const QStorageInfo &lhs, const QStorageInfo &rhs)
+{
+ if (lhs.d == rhs.d)
+ return true;
+ return lhs.device() == rhs.device() && lhs.rootPath() == rhs.rootPath();
+}
+
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, const QStorageInfo &s)
{