Branch: master

f08981e1 2019-05-25 22:16:39 Slávek Banko
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.

Signed-off-by: Slávek Banko <slavek.banko@...>
M src/tools/dbusxml2qt3/classgen.cpp

src/tools/dbusxml2qt3/classgen.cpp

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 @@
 {
     stream << "// interface classes includes" << endl;
 
-    if (!customInterfaceFilename.isNull())
+    if (!customInterfaceFilename.isEmpty())
     {
         stream << "#include \"" << customInterfaceFilename << ".h\"" << endl;
     }
-    else
+
+    bool hasIntrospectable = false;
+    TQValueList<Class>::const_iterator it    = interfaces.begin();
+    TQValueList<Class>::const_iterator endIt = interfaces.end();
+    for (; it != endIt; ++it)
     {
-        bool hasIntrospectable = false;
-        TQValueList<Class>::const_iterator it    = interfaces.begin();
-        TQValueList<Class>::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;
 }