summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess.cpp
diff options
context:
space:
mode:
authorRym Bouabid <rym.bouabid@qt.io>2024-02-13 18:22:06 +0100
committerRym Bouabid <rym.bouabid@qt.io>2024-02-22 13:37:41 +0100
commit22ebe86f1511f7f06031df1da030b78c1e8092c9 (patch)
tree0ed3790749530366d0a129c7eeb4dd3f2dacd42a /src/corelib/io/qprocess.cpp
parent14b058048247098ba4d81427290f2a083d513dc2 (diff)
QProcessEnvironment: Use new comparison helper macros
QProcessEnvironment had operator==() and operator!=() defined as public member functions, so use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of these methods and replace them with a hidden friend. Use QT_TEST_ALL_EQUALITY_OPS macro in unit-tests. Use new \compares command in the documentation to describe the comparison operators provided by QProcessEnvironment. Task-number: QTBUG-120303 Change-Id: I4c57f6cfb9589e82a37eea6993e079212b34cecd Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r--src/corelib/io/qprocess.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 5f37e47944d..ad6cf46bbfc 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -35,6 +35,8 @@ QT_BEGIN_NAMESPACE
\reentrant
\since 4.6
+ \compares equality
+
A process's environment is composed of a set of key=value pairs known as
environment variables. The QProcessEnvironment class wraps that concept
and allows easy manipulation of those variables. It's meant to be used
@@ -184,15 +186,17 @@ QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &o
*/
/*!
- \fn bool QProcessEnvironment::operator !=(const QProcessEnvironment &other) const
+ \fn bool QProcessEnvironment::operator!=(const QProcessEnvironment &lhs, const QProcessEnvironment &rhs)
- Returns \c true if this and the \a other QProcessEnvironment objects are different.
+ Returns \c true if the process environment objects \a lhs and \a rhs are different.
\sa operator==()
*/
/*!
- Returns \c true if this and the \a other QProcessEnvironment objects are equal.
+ \fn bool QProcessEnvironment::operator==(const QProcessEnvironment &lhs, const QProcessEnvironment &rhs)
+
+ Returns \c true if the process environment objects \a lhs and \a rhs are equal.
Two QProcessEnvironment objects are considered equal if they have the same
set of key=value pairs. The comparison of keys is done case-sensitive on
@@ -200,12 +204,12 @@ QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &o
\sa operator!=(), contains()
*/
-bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const
+bool comparesEqual(const QProcessEnvironment &lhs, const QProcessEnvironment &rhs)
{
- if (d == other.d)
+ if (lhs.d == rhs.d)
return true;
- return d && other.d && d->vars == other.d->vars;
+ return lhs.d && rhs.d && lhs.d->vars == rhs.d->vars;
}
/*!