Changeset View
Changeset View
Standalone View
Standalone View
src/configmonitor.cpp
Show First 20 Lines • Show All 161 Lines • ▼ Show 20 Line(s) | 161 | if (mPendingEDIDRequests[config].isEmpty()) { | |||
---|---|---|---|---|---|
162 | mPendingEDIDRequests.remove(config); | 162 | mPendingEDIDRequests.remove(config); | ||
163 | updateConfigs(config); | 163 | updateConfigs(config); | ||
164 | } | 164 | } | ||
165 | } | 165 | } | ||
166 | 166 | | |||
167 | 167 | | |||
168 | void ConfigMonitor::Private::updateConfigs(const KScreen::ConfigPtr &newConfig) | 168 | void ConfigMonitor::Private::updateConfigs(const KScreen::ConfigPtr &newConfig) | ||
169 | { | 169 | { | ||
170 | Q_ASSERT(BackendManager::instance()->method() == BackendManager::OutOfProcess); | | |||
171 | QMutableListIterator<QWeakPointer<Config>> iter(watchedConfigs); | 170 | QMutableListIterator<QWeakPointer<Config>> iter(watchedConfigs); | ||
172 | while (iter.hasNext()) { | 171 | while (iter.hasNext()) { | ||
173 | KScreen::ConfigPtr config = iter.next().toStrongRef(); | 172 | KScreen::ConfigPtr config = iter.next().toStrongRef(); | ||
174 | if (!config) { | 173 | if (!config) { | ||
175 | iter.remove(); | 174 | iter.remove(); | ||
176 | continue; | 175 | continue; | ||
177 | } | 176 | } | ||
178 | 177 | | |||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
242 | 241 | | |||
243 | void ConfigMonitor::connectInProcessBackend(KScreen::AbstractBackend* backend) | 242 | void ConfigMonitor::connectInProcessBackend(KScreen::AbstractBackend* backend) | ||
244 | { | 243 | { | ||
245 | Q_ASSERT(BackendManager::instance()->method() == BackendManager::InProcess); | 244 | Q_ASSERT(BackendManager::instance()->method() == BackendManager::InProcess); | ||
246 | connect(backend, &AbstractBackend::configChanged, [=](KScreen::ConfigPtr config) { | 245 | connect(backend, &AbstractBackend::configChanged, [=](KScreen::ConfigPtr config) { | ||
247 | if (config.isNull()) { | 246 | if (config.isNull()) { | ||
248 | return; | 247 | return; | ||
249 | } | 248 | } | ||
250 | const QWeakPointer<Config> weakConfig = config.toWeakRef(); | 249 | qCDebug(KSCREEN) << "Backend change!" << config; | ||
251 | if (d->watchedConfigs.contains(weakConfig)) { | 250 | d->updateConfigs(config); | ||
252 | emit configurationChanged(); | | |||
253 | } | | |||
254 | }); | 251 | }); | ||
255 | } | 252 | } | ||
256 | 253 | | |||
257 | 254 | | |||
258 | #include "configmonitor.moc" | 255 | #include "configmonitor.moc" |