|
|
|
@ -553,6 +553,56 @@ static void writeNodeInitialization(const Class& classData,
|
|
|
|
|
stream << " return true;" << endl;
|
|
|
|
|
stream << "}" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stream << "bool " << classData.name
|
|
|
|
|
<< "::registerObject(const TQT_DBusConnection& connection, "
|
|
|
|
|
<< "const TQString& path, const TQString& next)" << endl;
|
|
|
|
|
stream << "{" << endl;
|
|
|
|
|
stream << " if (path.isEmpty()) return false;" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
|
|
|
|
|
stream << " if (!m_private->objectPath.isEmpty()) unregisterObject();"
|
|
|
|
|
<< endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
|
|
|
|
|
stream << " m_private->connection = connection;" << endl;
|
|
|
|
|
stream << " m_private->objectPath = path;" << endl;
|
|
|
|
|
stream << " m_private->nextNode = next;" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
stream << " if (!m_private->connection.registerObject(path, this))" << endl;
|
|
|
|
|
stream << " {" << endl;
|
|
|
|
|
stream << " m_private->connection = TQT_DBusConnection();" << endl;
|
|
|
|
|
stream << " m_private->objectPath = TQString();" << endl;
|
|
|
|
|
stream << " m_private->nextNode = TQString();" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
stream << " return false;" << endl;
|
|
|
|
|
stream << " }" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
|
|
|
|
|
stream << " if (m_private->interfaces.isEmpty())" << endl;
|
|
|
|
|
stream << " {" << endl;
|
|
|
|
|
stream << " TQString name = \"org.freedesktop.DBus.Introspectable\";"
|
|
|
|
|
<< endl;
|
|
|
|
|
stream << " TQT_DBusObjectBase* interface = m_private;" << endl;
|
|
|
|
|
stream << " m_private->interfaces.insert(name, interface);" << endl;
|
|
|
|
|
|
|
|
|
|
it = interfaces.begin();
|
|
|
|
|
endIt = interfaces.end();
|
|
|
|
|
for (; it != endIt; ++it)
|
|
|
|
|
{
|
|
|
|
|
stream << endl;
|
|
|
|
|
stream << " name = \"" << (*it).dbusName << "\";" << endl;
|
|
|
|
|
stream << " interface = createInterface(name);" << endl;
|
|
|
|
|
stream << " Q_ASSERT(interface != 0);" << endl;
|
|
|
|
|
stream << " m_private->interfaces.insert(name, interface);" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stream << " }" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
stream << " return true;" << endl;
|
|
|
|
|
stream << "}" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
}
|
|
|
|
|
static void writeNodeIntrospection(const Class& classData,
|
|
|
|
|
const TQValueList<Class>& interfaces, TQTextStream& stream)
|
|
|
|
@ -587,6 +637,13 @@ static void writeNodeIntrospection(const Class& classData,
|
|
|
|
|
stream << " nodeElement.appendChild(interfaceElement);" << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stream << endl;
|
|
|
|
|
stream << " if (!nextNode.isEmpty()) {" << endl;
|
|
|
|
|
stream << " TQDomElement nodeElement1 = doc.createElement(\"node\");" << endl;
|
|
|
|
|
stream << " nodeElement1.setAttribute ( \"name\", nextNode );" << endl;
|
|
|
|
|
stream << " nodeElement.appendChild(nodeElement1);" << endl;
|
|
|
|
|
stream << " }" << endl;
|
|
|
|
|
|
|
|
|
|
stream << endl;
|
|
|
|
|
stream << " doc.appendChild(nodeElement);" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
@ -1724,6 +1781,7 @@ void MethodGenerator::writeNodePrivate(const Class& classData, TQTextStream& str
|
|
|
|
|
stream << endl;
|
|
|
|
|
stream << " TQT_DBusConnection connection;" << endl;
|
|
|
|
|
stream << " TQString objectPath;" << endl;
|
|
|
|
|
stream << " TQString nextNode;" << endl;
|
|
|
|
|
stream << endl;
|
|
|
|
|
|
|
|
|
|
stream << "protected:" << endl;
|
|
|
|
|