示例#1
0
void DialerControl::newCall( const QPhoneCall& call )
{
    QPhoneCall c = call;
    c.connectStateChanged( this, SLOT(callStateChanged(QPhoneCall)) );
    c.connectPendingTonesChanged( this, SIGNAL(pendingTonesChanged(QPhoneCall)) );
    emit callCreated( c );
    doActiveCalls();
    callStateChanged( call ); //force an update
}
void RemoteAspect::receiveCreated(Connection                &con,
                                  FieldContainerFactoryBase *fcFactory,
                                  FieldContainerVector      &newContainers)
{
    UInt32 remoteTypeId = 0;
    UInt32 localTypeId  = 0;
    UInt32 remoteId     = 0;

    con.getValue(remoteTypeId);
    con.getValue(remoteId);

    LocalTypeMapT::const_iterator  localTypeIt = _localType.find(remoteTypeId);
    FieldContainerType            *fcType      = NULL;
    FieldContainerUnrecPtr         fcPtr       = NULL;

    if(localTypeIt != _localType.end())
    {
        UInt64 fullRemoteId = getFullRemoteId(remoteId);

        if(_localFC.find(fullRemoteId) == _localFC.end())
        {
            localTypeId = localTypeIt->second;
            fcType      = fcFactory->findType(localTypeId);
            fcPtr       = fcType->createContainer();

            // remove this node, when aspect is removed
            _receivedFC.insert(fcPtr->getId());

            // local <-> remote mapping
            _localFC [fullRemoteId  ] = fcPtr->getId();
            _remoteFC[fcPtr->getId()] = fullRemoteId;

            callCreated(fcPtr);

            newContainers.push_back(fcPtr);

#ifndef OSG_REMOTE_ASPECT_SILENT
            SLOG << "Receive CREATED: type (r/l) '" << remoteTypeId
                 << "/" << localTypeId
                 << "' id (r/l) '" << remoteId << "/"
                 << (fcPtr  != NULL ? fcPtr->getId()     : 0)
                 << "' type name '"
                 << (fcType != NULL ? fcType->getName() : "")
                 << "'\n";
#endif
        }
        else
        {
            SWARNING << "Already created a local container ("
                     << _localFC[fullRemoteId] << ") for "
                     << "remote container id '" << remoteId
                     << "'" << std::endl;
        }
    }
    else
    {
        SWARNING << "Unknown (remote) type id '" << remoteTypeId
                 << "' for (remote) container id '" << remoteId
                 << "'" << std::endl;
    }
}