summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qstorageinfo.cpp8
-rw-r--r--src/corelib/io/qstorageinfo.h25
2 files changed, 14 insertions, 19 deletions
diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp
index 9054d8e894..86b8ae0ac3 100644
--- a/src/corelib/io/qstorageinfo.cpp
+++ b/src/corelib/io/qstorageinfo.cpp
@@ -413,9 +413,7 @@ QStorageInfo QStorageInfo::root()
}
/*!
- \fn inline bool operator==(const QStorageInfo &first, const QStorageInfo &second)
-
- \relates QStorageInfo
+ \fn bool QStorageInfo::operator==(const QStorageInfo &first, const QStorageInfo &second)
Returns true if the \a first QStorageInfo object refers to the same drive or volume
as the \a second; otherwise it returns false.
@@ -425,9 +423,7 @@ QStorageInfo QStorageInfo::root()
*/
/*!
- \fn inline bool operator!=(const QStorageInfo &first, const QStorageInfo &second)
-
- \relates QStorageInfo
+ \fn bool QStorageInfo::operator!=(const QStorageInfo &first, const QStorageInfo &second)
Returns true if the \a first QStorageInfo object refers to a different drive or
volume than the \a second; otherwise returns false.
diff --git a/src/corelib/io/qstorageinfo.h b/src/corelib/io/qstorageinfo.h
index ec95ea3b23..d441915a9e 100644
--- a/src/corelib/io/qstorageinfo.h
+++ b/src/corelib/io/qstorageinfo.h
@@ -93,23 +93,22 @@ public:
private:
friend class QStorageInfoPrivate;
- friend bool operator==(const QStorageInfo &first, const QStorageInfo &second);
+ friend inline bool operator==(const QStorageInfo &first, const QStorageInfo &second)
+ {
+ if (first.d == second.d)
+ return true;
+ return first.device() == second.device() && first.rootPath() == second.rootPath();
+ }
+
+ friend inline bool operator!=(const QStorageInfo &first, const QStorageInfo &second)
+ {
+ return !(first == second);
+ }
+
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QStorageInfo &);
QExplicitlySharedDataPointer<QStorageInfoPrivate> d;
};
-inline bool operator==(const QStorageInfo &first, const QStorageInfo &second)
-{
- if (first.d == second.d)
- return true;
- return first.device() == second.device() && first.rootPath() == second.rootPath();
-}
-
-inline bool operator!=(const QStorageInfo &first, const QStorageInfo &second)
-{
- return !(first == second);
-}
-
inline bool QStorageInfo::isRoot() const
{ return *this == QStorageInfo::root(); }