From 971694c28f857e78add60f728e73cd753e031a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 25 Oct 2016 14:29:19 +0200 Subject: [PATCH] [tools] Generate eventQueue methods only for global classes The event queue gets set by the factory method for resource classes. --- src/wayland/tools/generator.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/wayland/tools/generator.cpp b/src/wayland/tools/generator.cpp index 6f80d02923..63a723ecdb 100644 --- a/src/wayland/tools/generator.cpp +++ b/src/wayland/tools/generator.cpp @@ -930,16 +930,6 @@ void Generator::generateClientCpp(const Interface &interface) " d->%2.destroy();\n" "}\n" "\n" -"void %1::setEventQueue(EventQueue *queue)\n" -"{\n" -" d->queue = queue;\n" -"}\n" -"\n" -"EventQueue *%1::eventQueue()\n" -"{\n" -" return d->queue;\n" -"}\n" -"\n" "%1::operator %3*() {\n" " return d->%2;\n" "}\n" @@ -956,6 +946,20 @@ void Generator::generateClientCpp(const Interface &interface) *m_stream.localData() << templateString.arg(interface.kwaylandClientName()) .arg(interface.kwaylandClientName().toLower()) .arg(interface.name()); + if (interface.isGlobal()) { + const QString templateStringGlobal = QStringLiteral( +"void %1::setEventQueue(EventQueue *queue)\n" +"{\n" +" d->queue = queue;\n" +"}\n" +"\n" +"EventQueue *%1::eventQueue()\n" +"{\n" +" return d->queue;\n" +"}\n\n" + ); + *m_stream.localData() << templateStringGlobal.arg(interface.kwaylandClientName()); + } } void Generator::generateClientGlobalClassDoxy(const Interface &interface)