From 2e6aed4ffd106b34f0505047a687284c3f8ce8c2 Mon Sep 17 00:00:00 2001 From: Youngjin Kim Date: Thu, 2 Sep 2021 10:14:32 +0900 Subject: [PATCH] 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 --- src/tools/qtwaylandscanner/qtwaylandscanner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qtwaylandscanner/qtwaylandscanner.cpp b/src/tools/qtwaylandscanner/qtwaylandscanner.cpp index 93f4b68ff64..f84673d461a 100644 --- a/src/tools/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/tools/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) {