Example #1
0
PlayerControl::PlayerControl(PlayerContainer* container, QObject* parent)
    : Plasma::Service(parent)
    , m_container(container)
{
    setObjectName(container->objectName() + QLatin1String(" controller"));
    setName("mpris2");
    setDestination(container->objectName());

    connect(container, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)),
            this,      SLOT(updateEnabledOperations()));
    connect(container, SIGNAL(destroyed(QObject*)),
            this,      SLOT(containerDestroyed()));
    updateEnabledOperations();
}
Example #2
0
PlayerControl::PlayerControl(PlayerContainer* container, QObject* parent)
    : Plasma::Service(parent)
    , m_container(container)
{
    setObjectName(container->objectName() + QLatin1String(" controller"));
    setName("mpris2");
    setDestination(container->objectName());

    m_rootIface = new QDBusInterface(container->dbusAddress(),
                                     MPRIS2_PATH, MPRIS2_IFACE,
                                     QDBusConnection::sessionBus(), this);
    m_playerIface = new QDBusInterface(container->dbusAddress(),
                                       MPRIS2_PATH, MPRIS2_PLAYER_IFACE,
                                       QDBusConnection::sessionBus(), this);

    connect(container, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)),
            this,      SLOT(updateEnabledOperations()));
    connect(container, SIGNAL(destroyed(QObject*)),
            this,      SLOT(containerDestroyed()));
    updateEnabledOperations();
}
Example #3
0
X10Service::X10Service(X10Engine* engine, const QString& source)
    : Plasma::Service(engine)
    , m_engine(engine)
{
    if (source.isEmpty())
        setName("service"); // -> service.operations
    else
        setName("unit");    // -> unit.operations

    setDestination(source);

    updateEnabledOperations();
}