Logo Search packages:      
Sourcecode: kdbus version File versions  Download package

DBusInterface::DBusInterface ( QListViewItem *  parent,
QDomElement const &  elem 
) throw ( QDBusXmlError )

Parameters:
parent parent QListViewItem
elem QDomElement representing this interface as returned by org.freedesktop.DBus.Introspectable.Introspect.

Definition at line 31 of file dbusinterface.cpp.

 : DBusAnnotatable( parent, "(unknown interface)", "Interface" )
{
    ensureElementIsNamed( elem, "interface" );
    ensureElementHasAttribute( elem, "name" );


    m_interface = elem.attribute( "name" );
    m_service = discoverService();
    m_object = discoverObject();
    setText( 0, m_interface );

    // Is it permissible to have empty interfaces... ?  We'll assume it is...
    if ( !elem.hasChildNodes() )
        return;

    // Now iterate through self, enumerating methods, signals and properties.
    QDomElement child = elem.firstChild().toElement();

    try {
        do {
            if ( child.tagName() == "method" )
                new DBusMethod( this, child );
            else if ( child.tagName() == "signal" )
                new DBusSignal( this, child );
            else if ( child.tagName() == "property" )
                new DBusProperty( this, child );
            else if ( child.tagName() == "annotation" )
                addAnnotation( child );
            else
                kdWarning() << "Unhandled node in introspect data: "
                            << child.tagName() << endl;
            child = child.nextSibling().toElement();
        } while ( !child.isNull() );
    }
    catch ( std::runtime_error const & e ) {
        m_ok = false;
        m_error = e.what();
    }
}


Generated by  Doxygen 1.6.0   Back to index