From f08981e12a71624aea21350c419598695f819fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 26 May 2019 00:16:39 +0200 Subject: [PATCH] Fixed problem with missing include of introspectableInterface.h file in generated node file in case the custom interface file name is used. This relates to issue #17. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- src/tools/dbusxml2qt3/classgen.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/tools/dbusxml2qt3/classgen.cpp b/src/tools/dbusxml2qt3/classgen.cpp index 9eacdf4..b8e6040 100644 --- a/src/tools/dbusxml2qt3/classgen.cpp +++ b/src/tools/dbusxml2qt3/classgen.cpp @@ -369,29 +369,31 @@ static void writeInterfaceIncludes(const TQValueList interfaces, { stream << "// interface classes includes" << endl; - if (!customInterfaceFilename.isNull()) + if (!customInterfaceFilename.isEmpty()) { stream << "#include \"" << customInterfaceFilename << ".h\"" << endl; } - else + + bool hasIntrospectable = false; + TQValueList::const_iterator it = interfaces.begin(); + TQValueList::const_iterator endIt = interfaces.end(); + for (; it != endIt; ++it) { - bool hasIntrospectable = false; - TQValueList::const_iterator it = interfaces.begin(); - TQValueList::const_iterator endIt = interfaces.end(); - for (; it != endIt; ++it) + if (customInterfaceFilename.isEmpty()) { stream << "#include \"" << (*it).name.lower() << "Interface.h\"" << endl; - if ((*it).dbusName == "org.freedesktop.DBus.Introspectable") - { - hasIntrospectable = true; - } } - if (!hasIntrospectable) + if ((*it).dbusName == "org.freedesktop.DBus.Introspectable") { - stream << "#include \"introspectableInterface.h\"" << endl; + hasIntrospectable = true; } } + if (!hasIntrospectable) + { + stream << "#include \"introspectableInterface.h\"" << endl; + } + stream << endl; }