Changeset View
Changeset View
Standalone View
Standalone View
src/mediatransport_p.cpp
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 131 | { | |||
---|---|---|---|---|---|
134 | } | 134 | } | ||
135 | 135 | | |||
136 | for (auto it = changed.constBegin(); it != changed.constEnd(); ++it) { | 136 | for (auto it = changed.constBegin(); it != changed.constEnd(); ++it) { | ||
137 | const QString &key = it.key(); | 137 | const QString &key = it.key(); | ||
138 | const QVariant &value = it.value(); | 138 | const QVariant &value = it.value(); | ||
139 | 139 | | |||
140 | if (key == QLatin1String("Volume")) { | 140 | if (key == QLatin1String("Volume")) { | ||
141 | m_volume = value.toUInt(); | 141 | m_volume = value.toUInt(); | ||
142 | Q_EMIT q.data()->volumeChanged(m_volume); | 142 | Q_EMIT q.lock()->volumeChanged(m_volume); | ||
143 | } else if (key == QLatin1String("State")) { | 143 | } else if (key == QLatin1String("State")) { | ||
144 | m_state = stringToState(value.toString()); | 144 | m_state = stringToState(value.toString()); | ||
145 | Q_EMIT q.data()->stateChanged(m_state); | 145 | Q_EMIT q.lock()->stateChanged(m_state); | ||
146 | } | 146 | } | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | for (const QString &property : invalidated) { | 149 | for (const QString &property : invalidated) { | ||
150 | if (property == QLatin1String("Volume")) { | 150 | if (property == QLatin1String("Volume")) { | ||
151 | m_volume = 0; | 151 | m_volume = 0; | ||
152 | Q_EMIT q.data()->volumeChanged(m_volume); | 152 | Q_EMIT q.lock()->volumeChanged(m_volume); | ||
153 | } else if (property == QLatin1String("State")) { | 153 | } else if (property == QLatin1String("State")) { | ||
154 | PROPERTY_INVALIDATED(m_state, MediaTransport::State::Idle, stateChanged); | 154 | PROPERTY_INVALIDATED(m_state, MediaTransport::State::Idle, stateChanged); | ||
155 | } | 155 | } | ||
156 | } | 156 | } | ||
157 | } | 157 | } | ||
158 | 158 | | |||
159 | } // namespace BluezQt | 159 | } // namespace BluezQt |