Changeset View
Changeset View
Standalone View
Standalone View
src/config.cpp
Show First 20 Lines • Show All 361 Lines • ▼ Show 20 Line(s) | 341 | { | |||
---|---|---|---|---|---|
362 | setValid(other->isValid()); | 362 | setValid(other->isValid()); | ||
363 | } | 363 | } | ||
364 | 364 | | |||
365 | 365 | | |||
366 | QDebug operator<<(QDebug dbg, const KScreen::ConfigPtr &config) | 366 | QDebug operator<<(QDebug dbg, const KScreen::ConfigPtr &config) | ||
367 | { | 367 | { | ||
368 | if (config) { | 368 | if (config) { | ||
369 | dbg << "KScreen::Config("; | 369 | dbg << "KScreen::Config("; | ||
370 | for (const auto output : config->outputs()) { | 370 | const auto outputs = config->outputs(); | ||
371 | for (const auto &output : outputs) { | ||||
broulik: This still calls `config->outputs().begin()` and might detach, wouldn't it?
`qAsConst` also… | |||||
371 | if (output->isConnected()) { | 372 | if (output->isConnected()) { | ||
372 | dbg << endl << output; | 373 | dbg << endl << output; | ||
373 | } | 374 | } | ||
374 | } | 375 | } | ||
375 | dbg << ")"; | 376 | dbg << ")"; | ||
376 | } else { | 377 | } else { | ||
377 | dbg << "KScreen::Config(NULL)"; | 378 | dbg << "KScreen::Config(NULL)"; | ||
378 | } | 379 | } | ||
379 | return dbg; | 380 | return dbg; | ||
380 | } | 381 | } | ||
381 | 382 | | |||
382 | 383 | | |||
383 | #include "config.moc" | 384 | #include "config.moc" |
This still calls config->outputs().begin() and might detach, wouldn't it?
qAsConst also doesn't work for return value of a method call, so looks like you're gonna have to store it in a const variable first