Changeset View
Changeset View
Standalone View
Standalone View
dataengines/mpris2/multiplexedservice.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 45 | { | |||
---|---|---|---|---|---|
46 | if (m_control) { | 46 | if (m_control) { | ||
47 | return m_control.data()->createJob(operation, parameters); | 47 | return m_control.data()->createJob(operation, parameters); | ||
48 | } | 48 | } | ||
49 | return nullptr; | 49 | return nullptr; | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | void MultiplexedService::updateEnabledOperations() | 52 | void MultiplexedService::updateEnabledOperations() | ||
53 | { | 53 | { | ||
54 | const auto ops = operationNames(); | ||||
54 | if (m_control) { | 55 | if (m_control) { | ||
55 | foreach (const QString &op, operationNames()) { | 56 | for (const QString &op : ops) { | ||
56 | setOperationEnabled(op, m_control.data()->isOperationEnabled(op)); | 57 | setOperationEnabled(op, m_control.data()->isOperationEnabled(op)); | ||
57 | } | 58 | } | ||
58 | } else { | 59 | } else { | ||
59 | foreach (const QString &op, operationNames()) { | 60 | for (const QString &op : ops) { | ||
60 | setOperationEnabled(op, false); | 61 | setOperationEnabled(op, false); | ||
61 | } | 62 | } | ||
62 | } | 63 | } | ||
63 | } | 64 | } | ||
64 | 65 | | |||
65 | void MultiplexedService::activePlayerChanged(PlayerContainer *container) | 66 | void MultiplexedService::activePlayerChanged(PlayerContainer *container) | ||
66 | { | 67 | { | ||
67 | delete m_control.data(); | 68 | delete m_control.data(); | ||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |