summaryrefslogtreecommitdiffstats
path: root/src/tools/dbusxml2qt3/main.cpp
diff options
context:
space:
mode:
authorEmanoil Kotsev <deloptes@gmail.com>2020-03-11 18:11:28 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-03-11 18:11:28 +0900
commit7d4929217698d7ed663732d08540420ee835bf08 (patch)
tree378d516207349eb243c846e8ba9eecba700f2736 /src/tools/dbusxml2qt3/main.cpp
parente9bf60b236c3a449b7c507646898945178cb8957 (diff)
downloaddbus-1-tqt-7d492921.tar.gz
dbus-1-tqt-7d492921.zip
Generate DBusBaseNode class to handle the empty nodes.
- Prevent showing Introspection in empty nodes - fix method generation for objectpath array in signature like a{oa{sa{sv}}} - Hide Introspectable interface if there is no interface in the node - Add support for multiple nodes introspection - addChildNode function to support multiple nodes Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
Diffstat (limited to 'src/tools/dbusxml2qt3/main.cpp')
-rw-r--r--src/tools/dbusxml2qt3/main.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/tools/dbusxml2qt3/main.cpp b/src/tools/dbusxml2qt3/main.cpp
index 747af9e..018bc5d 100644
--- a/src/tools/dbusxml2qt3/main.cpp
+++ b/src/tools/dbusxml2qt3/main.cpp
@@ -119,7 +119,10 @@ int main(int argc, char** argv)
{
hasIntrospectable = true;
}
- interfaces << classData;
+ else
+ {
+ interfaces << classData;
+ }
}
}
}
@@ -398,6 +401,34 @@ int main(int argc, char** argv)
headerStream, sourceStream);
ClassGenerator::finishStreams(baseName, headerStream, sourceStream);
+
+ // create dummy node to handle the path hierarchy
+ if ( nameParts.size() > 1 ) {
+ TQTextStream headerStreamDBusBaseNode;
+ TQTextStream sourceStreamDBusBaseNode;
+
+ TQString baseName = "DBusBase";
+ Class classDataDBusBaseNode;
+ classDataDBusBaseNode.name = baseName + "Node";
+ TQValueList<Class> interfacesDBusBase = TQValueList<Class>();
+
+ TQString baseNameDBusBaseNode = baseName.lower() + "Node";
+
+ if (!ClassGenerator::initStreams(baseNameDBusBaseNode, headerStreamDBusBaseNode, sourceStreamDBusBaseNode))
+ {
+ std::cerr << "dbusxml2qt3: interface files, using base name '"
+ << baseNameDBusBaseNode.local8Bit().data()
+ << "', could not be opened for writing"
+ << std::endl;
+ exit(4);
+ }
+
+ ClassGenerator::generateNode(classDataDBusBaseNode,
+ interfacesDBusBase, baseNameDBusBaseNode,
+ headerStreamDBusBaseNode, sourceStreamDBusBaseNode);
+
+ ClassGenerator::finishStreams(baseNameDBusBaseNode, headerStreamDBusBaseNode, sourceStreamDBusBaseNode);
+ }
}
return 0;