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".

Pick-to: 6.3
Change-Id: I7c007978d4aa404d10441643d5461372f33954e5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
Youngjin Kim 2021-09-02 10:14:32 +09:00 committed by Jaeyoon Jung
parent 290f345d84
commit 2e6aed4ffd

View File

@ -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) {