diff options
-rw-r--r-- | src/corelib/tools/qcollator.cpp | 9 | ||||
-rw-r--r-- | src/corelib/tools/qcollator.h | 6 | ||||
-rw-r--r-- | src/corelib/tools/qcollator_icu.cpp | 5 | ||||
-rw-r--r-- | src/corelib/tools/qcollator_macx.cpp | 5 | ||||
-rw-r--r-- | src/corelib/tools/qcollator_posix.cpp | 5 | ||||
-rw-r--r-- | src/corelib/tools/qcollator_win.cpp | 5 |
6 files changed, 10 insertions, 25 deletions
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp index 80d330bfca..9c97d6b158 100644 --- a/src/corelib/tools/qcollator.cpp +++ b/src/corelib/tools/qcollator.cpp @@ -328,12 +328,13 @@ QCollatorSortKey& QCollatorSortKey::operator=(const QCollatorSortKey &other) } /*! - \fn bool QCollatorSortKey::operator<(const QCollatorSortKey &otherKey) const + \fn bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs) + \relates QCollatorSortKey - According to the QCollator that created the key, returns \c true if the - key should be sorted before than \a otherKey; otherwise returns \c false. + According to the QCollator that created the keys, returns \c true if \a lhs + should be sorted before \a rhs; otherwise returns \c false. - \sa compare() + \sa QCollatorSortKey::compare() */ /*! diff --git a/src/corelib/tools/qcollator.h b/src/corelib/tools/qcollator.h index 941637e200..781e95b10c 100644 --- a/src/corelib/tools/qcollator.h +++ b/src/corelib/tools/qcollator.h @@ -66,7 +66,6 @@ public: void swap(QCollatorSortKey &other) { d.swap(other.d); } - bool operator<(const QCollatorSortKey &key) const; int compare(const QCollatorSortKey &key) const; protected: @@ -78,6 +77,11 @@ private: QCollatorSortKey(); }; +inline bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs) +{ + return lhs.compare(rhs) < 0; +} + class Q_CORE_EXPORT QCollator { public: diff --git a/src/corelib/tools/qcollator_icu.cpp b/src/corelib/tools/qcollator_icu.cpp index 46f830a34c..407a493d25 100644 --- a/src/corelib/tools/qcollator_icu.cpp +++ b/src/corelib/tools/qcollator_icu.cpp @@ -151,11 +151,6 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const return QCollatorSortKey(new QCollatorSortKeyPrivate(result)); } -bool QCollatorSortKey::operator<(const QCollatorSortKey &otherKey) const -{ - return d->m_key < otherKey.d->m_key; -} - int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const { return qstrcmp(d->m_key, otherKey.d->m_key); diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/tools/qcollator_macx.cpp index 8edd190fbe..8985cd4eba 100644 --- a/src/corelib/tools/qcollator_macx.cpp +++ b/src/corelib/tools/qcollator_macx.cpp @@ -162,11 +162,6 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const return QCollatorSortKey(new QCollatorSortKeyPrivate(ret)); } -bool QCollatorSortKey::operator<(const QCollatorSortKey &key) const -{ - return compare(key) < 0; -} - int QCollatorSortKey::compare(const QCollatorSortKey &key) const { SInt32 order; diff --git a/src/corelib/tools/qcollator_posix.cpp b/src/corelib/tools/qcollator_posix.cpp index a43618dcf1..b47b546d01 100644 --- a/src/corelib/tools/qcollator_posix.cpp +++ b/src/corelib/tools/qcollator_posix.cpp @@ -135,11 +135,6 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const return QCollatorSortKey(new QCollatorSortKeyPrivate(result)); } -bool QCollatorSortKey::operator<(const QCollatorSortKey &otherKey) const -{ - return compare(otherKey) < 0; -} - int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const { return std::wcscmp(d->m_key.constData(), diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp index 282711fbc6..8e59000946 100644 --- a/src/corelib/tools/qcollator_win.cpp +++ b/src/corelib/tools/qcollator_win.cpp @@ -155,11 +155,6 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const return QCollatorSortKey(new QCollatorSortKeyPrivate(ret)); } -bool QCollatorSortKey::operator<(const QCollatorSortKey &otherKey) const -{ - return d->m_key < otherKey.d->m_key; -} - int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const { return d->m_key.compare(otherKey.d->m_key); |