bool QtBluezDiscoveryManager::registerDiscoveryInterest(const QString &adapterPath) { if (adapterPath.isEmpty()) return false; // already monitored adapter? -> increase ref count -> done if (d->references.contains(adapterPath)) { d->references[adapterPath]->reference++; return true; } AdapterData *data = new AdapterData(); OrgFreedesktopDBusPropertiesInterface *propIface = new OrgFreedesktopDBusPropertiesInterface( QStringLiteral("org.bluez"), adapterPath, QDBusConnection::systemBus()); connect(propIface, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)), SLOT(PropertiesChanged(QString,QVariantMap,QStringList))); data->propteryListener = propIface; OrgBluezAdapter1Interface iface(QStringLiteral("org.bluez"), adapterPath, QDBusConnection::systemBus()); data->wasListeningAlready = iface.discovering(); d->references[adapterPath] = data; if (!data->wasListeningAlready) iface.StartDiscovery(); return true; }
PlayerContainer::PlayerContainer(const QString& busAddress, QObject* parent) : DataContainer(parent) , m_caps(NoCaps) , m_fetchesPending(0) , m_dbusAddress(busAddress) , m_currentRate(0.0) { Q_ASSERT(!busAddress.isEmpty()); Q_ASSERT(busAddress.startsWith(QLatin1String("org.mpris.MediaPlayer2."))); m_propsIface = new OrgFreedesktopDBusPropertiesInterface( busAddress, MPRIS2_PATH, QDBusConnection::sessionBus(), this); m_playerIface = new OrgMprisMediaPlayer2PlayerInterface( busAddress, MPRIS2_PATH, QDBusConnection::sessionBus(), this); m_rootIface = new OrgMprisMediaPlayer2Interface( busAddress, MPRIS2_PATH, QDBusConnection::sessionBus(), this); connect(m_propsIface, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)), this, SLOT(propertiesChanged(QString,QVariantMap,QStringList))); connect(m_playerIface, SIGNAL(Seeked(qlonglong)), this, SLOT(seeked(qlonglong))); refresh(); }
NMGsmNetworkInterface::NMGsmNetworkInterface(NMGsmNetworkInterfacePrivate & dd, NMNetworkManager * manager, QObject * parent) : NMSerialNetworkInterface(dd, manager, parent), modemGsmCardIface(0), modemGsmNetworkIface(0) { Q_D(NMGsmNetworkInterface); connect( &d->gsmIface, SIGNAL(PropertiesChanged(QVariantMap)), this, SLOT(gsmPropertiesChanged(QVariantMap))); }
void QBluetoothTransferReplyBluez::sessionStarted(QDBusPendingCallWatcher *watcher) { QDBusPendingReply<QDBusObjectPath, QVariantMap> reply = *watcher; if (reply.isError()) { qCWarning(QT_BT_BLUEZ) << "Failed to start obex session:" << reply.error().name() << reply.reply().errorMessage(); m_errorStr = QBluetoothTransferReply::tr("Push session cannot be started"); m_error = QBluetoothTransferReply::SessionError; m_finished = true; m_running = false; cleanupSession(); emit QBluetoothTransferReply::error(m_error); emit finished(this); watcher->deleteLater(); return; } const QDBusObjectPath path = reply.argumentAt<0>(); const QVariantMap map = reply.argumentAt<1>(); m_transfer_path = path.path(); //watch the transfer OrgFreedesktopDBusPropertiesInterface *properties = new OrgFreedesktopDBusPropertiesInterface( QStringLiteral("org.bluez.obex"), path.path(), QDBusConnection::sessionBus(), this); connect(properties, SIGNAL(PropertiesChanged(QString,QVariantMap,QStringList)), SLOT(sessionChanged(QString,QVariantMap,QStringList))); watcher->deleteLater(); }
void MprisControlPlugin::addPlayer(const QString& service) { QDBusInterface mprisInterface(service, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2"); //FIXME: This call hangs and returns an empty string if KDED is still starting! const QString identity = mprisInterface.property("Identity").toString(); playerList[identity] = service; qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris addPlayer" << service << "->" << identity; sendPlayerList(); OrgFreedesktopDBusPropertiesInterface* freedesktopInterface = new OrgFreedesktopDBusPropertiesInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus(), this); connect(freedesktopInterface, SIGNAL(PropertiesChanged(QString, QVariantMap, QStringList)), this, SLOT(propertiesChanged(QString, QVariantMap))); OrgMprisMediaPlayer2PlayerInterface* mprisInterface0 = new OrgMprisMediaPlayer2PlayerInterface(service, "/org/mpris/MediaPlayer2", QDBusConnection::sessionBus()); connect(mprisInterface0, SIGNAL(Seeked(qlonglong)), this, SLOT(seeked(qlonglong))); }
WifiSettingsDialog::WifiSettingsDialog(const QString &preferredInterface, QWidget *parent) : QDialog(parent), ui(new Ui::WifiSettingsDialog), _qpd(NULL), _connecting(false) { setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint); ui->setupUi(this); ui->list->setItemDelegate(new TwoIconsDelegate(this)); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); connect(ui->passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(checkSettings())); FiW1Wpa_supplicant1Interface *wpa = WpaFactory::createWpaSupplicantProxy(this); _ifpath = wpa->GetInterface(preferredInterface).value(); if (_ifpath.path().isEmpty()) { /* Preferred wlan interface not available, take first one out of list instead */ QList<QDBusObjectPath> ifaces = wpa->interfaces(); if (ifaces.count()) { _ifpath = ifaces.first(); } else { QMessageBox::critical(parent, tr("No wifi interfaces"), tr("No wifi interfaces available"), QMessageBox::Close); close(); } } _interface = WpaFactory::createInterfaceProxy(_ifpath, this); _ifname = _interface->ifname(); qDebug() << "Using wifi interface" << _ifname; _currentBSS = _interface->currentBSS(); connect(_interface, SIGNAL(BSSAdded(QDBusObjectPath,QVariantMap)), this, SLOT(onBSSAdded(QDBusObjectPath))); connect(_interface, SIGNAL(PropertiesChanged(QVariantMap)), this, SLOT(onPropertiesChanged(QVariantMap))); /* Call onBSSAdded() for BSSes already scanned prior to opening the dialog */ QList<QDBusObjectPath> bSSs = _interface->bSSs(); foreach (QDBusObjectPath bsspath, bSSs) { onBSSAdded(bsspath); }
Properties::Properties(const QString &objectPath, const QString &interface, QObject *parent) : SystemBusInterface(parent), mObjectPath(objectPath), mInterface(interface) { qDebug() << "Connected" << QDBusConnection::systemBus().connect(getServiceName(), getObjectPath(), getInterfaceName(), "PropertiesChanged", this, SLOT(PropertiesChanged(QString,QMap<QString,QVariant>,QList<QString>))); }
void SelectorControl::ItemNameChanged() const { PropertyAddress address(kCMIOSelectorControlPropertyItemName); PropertiesChanged(1, &address); }
void SelectorControl::AvailableItemsChanged() const { PropertyAddress address(kCMIOSelectorControlPropertyAvailableItems); PropertiesChanged(1, &address); }
void SelectorControl::CurrentItemChanged() const { PropertyAddress address(kCMIOSelectorControlPropertyCurrentItem); PropertiesChanged(1, &address); }
void BooleanControl::ValueChanged() const { PropertyAddress address(kCMIOBooleanControlPropertyValue); PropertiesChanged(1, &address); }