Ejemplo n.º 1
0
MixedProjectInterface::MixedProjectInterface( MixedDoc* doc )
:
    ProjectInterface( doc ),
    m_mixedDoc( doc )
{
    m_audioInterface = new AudioProjectInterface( doc->audioDoc(), dbusPath() + "/audio" );
    m_dataInterface = new DataProjectInterface( doc->dataDoc(), dbusPath() + "/data" );
}
Ejemplo n.º 2
0
Device::Device(QObject* parent, const QString& id)
    : QObject(parent)
    , m_deviceId(id)
    , m_pairStatus(Device::Paired)
    , m_protocolVersion(NetworkPackage::ProtocolVersion) //We don't know it yet
{
    KdeConnectConfig::DeviceInfo info = KdeConnectConfig::instance()->getTrustedDevice(id);

    m_deviceName = info.deviceName;
    m_deviceType = str2type(info.deviceType);
    m_publicKey = QCA::RSAPublicKey::fromPEM(info.publicKey);

    m_pairingTimeut.setSingleShot(true);
    m_pairingTimeut.setInterval(30 * 1000);  //30 seconds of timeout
    connect(&m_pairingTimeut, SIGNAL(timeout()),
            this, SLOT(pairingTimeout()));

    //Register in bus
    QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
}
Ejemplo n.º 3
0
Device::Device(QObject* parent, const NetworkPackage& identityPackage, DeviceLink* dl)
    : QObject(parent)
    , m_deviceId(identityPackage.get<QString>("deviceId"))
    , m_deviceName(identityPackage.get<QString>("deviceName"))
    , m_deviceType(str2type(identityPackage.get<QString>("deviceType")))
    , m_pairStatus(Device::NotPaired)
    , m_protocolVersion(identityPackage.get<int>("protocolVersion", -1))
{
    addLink(identityPackage, dl);

    //Register in bus
    QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);

    //Implement deprecated signals
    connect(this, &Device::pairingChanged, this, [this](bool newPairing) {
        if (newPairing)
            Q_EMIT pairingSuccesful();
        else
            Q_EMIT unpaired();
    });
}
Ejemplo n.º 4
0
void SharePlugin::connected()
{
    QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableInvokables);
}