diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-10-16 17:07:55 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-10-19 18:30:44 +0000 |
commit | b33ac5a7d7bff88021fe6b02c0cbf5c64124042e (patch) | |
tree | c87bcd2a5c1d6fd93fc8131ade22c976466b2a06 /src/qtwaylandscanner/qtwaylandscanner.cpp | |
parent | a727ee0b2f1044ad8d5689208aed3f469b8de1ba (diff) | |
download | qtwayland-b33ac5a7d7bff88021fe6b02c0cbf5c64124042e.tar.gz |
Fix for QStringBuilder
Change-Id: I2a7b82bd2705919a91492edfccac02f4d8fc2c9b
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
Diffstat (limited to 'src/qtwaylandscanner/qtwaylandscanner.cpp')
-rw-r--r-- | src/qtwaylandscanner/qtwaylandscanner.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp index 784687d2..a9c17154 100644 --- a/src/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/qtwaylandscanner/qtwaylandscanner.cpp @@ -196,8 +196,13 @@ QByteArray waylandToCType(const QByteArray &waylandType, const QByteArray &inter return "int32_t"; else if (waylandType == "array") return "wl_array *"; - else if (waylandType == "object" || waylandType == "new_id") - return isServerSide() ? "struct ::wl_resource *" : interface.isEmpty() ? "struct ::wl_object *" : "struct ::" + interface + " *"; + else if (waylandType == "object" || waylandType == "new_id") { + if (isServerSide()) + return "struct ::wl_resource *"; + if (interface.isEmpty()) + return "struct ::wl_object *"; + return "struct ::" + interface + " *"; + } return waylandType; } @@ -839,7 +844,14 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf("\n"); foreach (const WaylandEvent &e, interface.requests) { const WaylandArgument *new_id = newIdArgument(e.arguments); - printf(" %s", new_id ? (new_id->interface.isEmpty() ? "void *" : "struct ::" + new_id->interface + " *").constData() : "void "); + QByteArray new_id_str = "void "; + if (new_id) { + if (new_id->interface.isEmpty()) + new_id_str = "void *"; + else + new_id_str = "struct ::" + new_id->interface + " *"; + } + printf(" %s", new_id_str.constData()); printEvent(e); printf(";\n"); } @@ -955,7 +967,14 @@ void process(QXmlStreamReader &xml, const QByteArray &headerPath, const QByteArr printf("\n"); const WaylandEvent &e = interface.requests.at(i); const WaylandArgument *new_id = newIdArgument(e.arguments); - printf(" %s%s::", new_id ? (new_id->interface.isEmpty() ? "void *" : "struct ::" + new_id->interface + " *").constData() : "void ", interfaceName); + QByteArray new_id_str = "void "; + if (new_id) { + if (new_id->interface.isEmpty()) + new_id_str = "void *"; + else + new_id_str = "struct ::" + new_id->interface + " *"; + } + printf(" %s%s::", new_id_str.constData(), interfaceName); printEvent(e); printf("\n"); printf(" {\n"); |