diff options
author | Marc Mutz <[email protected]> | 2023-03-03 17:16:10 +0100 |
---|---|---|
committer | Marc Mutz <[email protected]> | 2023-03-05 21:57:21 +0100 |
commit | b955648224929e07b133744742344b9a45ae9c9e (patch) | |
tree | e0fe0e1e15319aec82cb52fc3bc430c88f45ff61 | |
parent | 28f56f29bb9b9874c5df41609ef4979d120333a1 (diff) |
QDBusError: don't refer to a QT_NAMESPACE'ed get() as ::get()
This code predates the public history. I don't know exactly how this
worked before, but I guess it's because the QT_USE_NAMESPACE in our
headers.
If there's _any_ get() function at the global scope, then name lookup
stops there and considers _only_ that function. And if that happens to
have a compatible signature, good night.
Use unqualified lookup instead. That will find the QT_NAMESPACE one,
ignoring other overloads at global scope. And when non-namespaced,
will emit an ambiguity error in the presence of another matching get()
function at global scope.
Task-number: QTBUG-111598
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iea141ea543193394ba527b414caf31c1f3a2355b
Reviewed-by: Thiago Macieira <[email protected]>
-rw-r--r-- | src/dbus/qdbuserror.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 13feb4c1590..49c30e5b251 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -176,7 +176,7 @@ QDBusError::QDBusError(const DBusError *error) if (!error || !q_dbus_error_is_set(error)) return; - code = ::get(error->name); + code = get(error->name); msg = QString::fromUtf8(error->message); nm = QString::fromUtf8(error->name); } @@ -191,7 +191,7 @@ QDBusError::QDBusError(const QDBusMessage &qdmsg) if (qdmsg.type() != QDBusMessage::ErrorMessage) return; - code = ::get(qdmsg.errorName().toUtf8().constData()); + code = get(qdmsg.errorName().toUtf8().constData()); nm = qdmsg.errorName(); msg = qdmsg.errorMessage(); } @@ -238,7 +238,7 @@ QDBusError &QDBusError::operator=(const QDBusError &other) QDBusError &QDBusError::operator=(const QDBusMessage &qdmsg) { if (qdmsg.type() == QDBusMessage::ErrorMessage) { - code = ::get(qdmsg.errorName().toUtf8().constData()); + code = get(qdmsg.errorName().toUtf8().constData()); nm = qdmsg.errorName(); msg = qdmsg.errorMessage(); } else { |