diff options
author | Youngjin Kim <youngjin78.kim@lge.com> | 2021-09-02 10:14:32 +0900 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-02 10:43:29 +0000 |
commit | 82eb793281ba55e0c5b0bd3726ba4ce2b419ca08 (patch) | |
tree | 683f4ab4f0572dfd02409e1e88b0b9d098fa24da | |
parent | b5b13a94d0a717bb6218f2376d4462a814b48c22 (diff) | |
download | qtwayland-82eb793281ba55e0c5b0bd3726ba4ce2b419ca08.tar.gz |
Use scope resolution operator for request
If the combination of the name of the protocol interface and the name of
its request is same as another interface name, it can cause problem in
calling the constructor instead of method generated by wayland-scanner
when calling request.
For example, if you have an interface named "foo" and its request named
"bar", it might conflict with another interface named "foo_bar".
A real example for this is presentation_time protocol which has
a request "feedback" in the interface "wp_presentation" while it also
has another interface named as "wp_presentation_feedback".
Change-Id: I7c007978d4aa404d10441643d5461372f33954e5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 1eded03865193d95fab7fd9279e34fb0dbe0cb45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qtwaylandscanner/qtwaylandscanner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp index 93f4b68f..f84673d4 100644 --- a/src/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/qtwaylandscanner/qtwaylandscanner.cpp @@ -1236,7 +1236,7 @@ bool Scanner::process() printf("\n"); } int actualArgumentCount = new_id ? int(e.arguments.size()) - 1 : int(e.arguments.size()); - printf(" %s%s_%s(\n", new_id ? "return " : "", interfaceName, e.name.constData()); + printf(" %s::%s_%s(\n", new_id ? "return " : "", interfaceName, e.name.constData()); printf(" m_%s%s", interfaceName, actualArgumentCount > 0 ? "," : ""); bool needsComma = false; for (const WaylandArgument &a : e.arguments) { |