void ConnectionManager::Private::ProtocolWrapper::introspectInterfaces()
{
    if (!mHasAvatarsProps) {
        if (hasInterface(TP_QT_IFACE_PROTOCOL_INTERFACE_AVATARS)) {
            introspectQueue.enqueue(&ProtocolWrapper::introspectAvatars);
        } else {
            debug() << "Full functionality requires CM support for the Protocol.Avatars interface";
        }
    }

    if (!mHasPresenceProps) {
        if (hasInterface(TP_QT_IFACE_PROTOCOL_INTERFACE_PRESENCE)) {
            introspectQueue.enqueue(&ProtocolWrapper::introspectPresence);
        } else {
            debug() << "Full functionality requires CM support for the Protocol.Presence interface";
        }
    }

    if (!mHasAddressingProps) {
        if (hasInterface(TP_QT_IFACE_PROTOCOL_INTERFACE_ADDRESSING)) {
            introspectQueue.enqueue(&ProtocolWrapper::introspectAddressing);
        } else {
            debug() << "Full functionality requires CM support for the Protocol.Addressing interface";
        }
    }
}
Exemple #2
0
QVariant MediaObject::interfaceCall(Interface iface, int command, const QList<QVariant> &params)
{
    if (hasInterface(iface)) {

        switch (iface)
        {
        case TitleInterface:
            switch (command)
            {
            case availableTitles:
                return _iface_availableTitles();
            case title:
                return _iface_currentTitle();
            case setTitle:
                _iface_setCurrentTitle(params.first().toInt());
                break;
            case autoplayTitles:
                return m_autoplayTitles;
            case setAutoplayTitles:
                m_autoplayTitles = params.first().toBool();
                updateStopPosition();
                break;
            }
            break;
        default:
            break;
        }
    }
    return QVariant();
}
int VirtualNetwork::removeInterface(const std::string& interface) {
    if (!hasInterface(interface)) {
        return 0;
    }
    if (int ret = RouteController::removeInterfaceFromVirtualNetwork(mNetId, interface.c_str(),
                                                                     mSecure, mUidRanges)) {
        ALOGE("failed to remove interface %s from VPN netId %u", interface.c_str(), mNetId);
        return ret;
    }
    mInterfaces.erase(interface);
    return 0;
}
int VirtualNetwork::addInterface(const std::string& interface) {
    if (hasInterface(interface)) {
        return 0;
    }
    if (int ret = RouteController::addInterfaceToVirtualNetwork(mNetId, interface.c_str(), mSecure,
                                                                mUidRanges)) {
        ALOGE("failed to add interface %s to VPN netId %u", interface.c_str(), mNetId);
        return ret;
    }
    mInterfaces.insert(interface);
    return 0;
}