From 5dbd6a44d81d6eb062878fbc0d14c19464308d21 Mon Sep 17 00:00:00 2001 From: Tatiana Borisova Date: Fri, 19 Apr 2024 14:43:25 +0200 Subject: QMimeType: use modernize comparisons Replace class operators operator==(), operator!=() of QMimeType to friend method comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE macro. Use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of current comparison methods and replace them with a friend. Task-number: QTBUG-120304 Change-Id: I9776e98c8a3b14d599733c91af61fbc12b1f0e57 Reviewed-by: Ivan Solovev --- src/corelib/compat/removed_api.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/corelib/compat/removed_api.cpp') diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 6101e71f79..7d3d3b5bd6 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -1006,6 +1006,13 @@ bool QJsonValue::operator!=(const QJsonValue &other) const return !comparesEqual(*this, other); } +#include "qmimetype.h" + +bool QMimeType::operator==(const QMimeType &other) const +{ + return comparesEqual(*this, other); +} + #include "qobject.h" int QObject::startTimer(std::chrono::milliseconds time, Qt::TimerType timerType) -- cgit v1.2.3