Changeset View
Changeset View
Standalone View
Standalone View
dataengines/mpris2/mpris2engine.cpp
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Line(s) | |||||
140 | void Mpris2Engine::serviceNameFetchFinished(QDBusPendingCallWatcher* watcher) | 140 | void Mpris2Engine::serviceNameFetchFinished(QDBusPendingCallWatcher* watcher) | ||
141 | { | 141 | { | ||
142 | QDBusPendingReply<QStringList> propsReply = *watcher; | 142 | QDBusPendingReply<QStringList> propsReply = *watcher; | ||
143 | watcher->deleteLater(); | 143 | watcher->deleteLater(); | ||
144 | 144 | | |||
145 | if (propsReply.isError()) { | 145 | if (propsReply.isError()) { | ||
146 | qCWarning(MPRIS2) << "Could not get list of available D-Bus services"; | 146 | qCWarning(MPRIS2) << "Could not get list of available D-Bus services"; | ||
147 | } else { | 147 | } else { | ||
148 | foreach (const QString& serviceName, propsReply.value()) { | 148 | const auto value = propsReply.value(); | ||
149 | for (const QString& serviceName : value) { | ||||
149 | if (serviceName.startsWith(QLatin1String("org.mpris.MediaPlayer2."))) { | 150 | if (serviceName.startsWith(QLatin1String("org.mpris.MediaPlayer2."))) { | ||
150 | qCDebug(MPRIS2) << "Found MPRIS2 service" << serviceName; | 151 | qCDebug(MPRIS2) << "Found MPRIS2 service" << serviceName; | ||
151 | // watch out for race conditions; the media player could | 152 | // watch out for race conditions; the media player could | ||
152 | // have appeared between starting the service watcher and | 153 | // have appeared between starting the service watcher and | ||
153 | // this call being dealt with | 154 | // this call being dealt with | ||
154 | // NB: _disappearing_ between sending this call and doing | 155 | // NB: _disappearing_ between sending this call and doing | ||
155 | // this processing is fine | 156 | // this processing is fine | ||
156 | QString sourceName = serviceName.mid(23); | 157 | QString sourceName = serviceName.mid(23); | ||
Show All 39 Lines |