cmake: Simplification: do not list the headers explicitly

The list of headers is not used anywhere, so it doesn't make sense to maintain
that listing by hand. Previously, this used to be needed for moc, but we're
relying on automoc now.

REVIEW: 113098
Move the SettingsCategoryGuard to an extra file
Use the SettingsCategoryGuard everywhere

QSettings has a couple of similar methods, the
beginReadArray/beginWriteArray/endArray. These are *not* used by this patch; the
correct API would probably have to be built on iterators in order to be
reasonably useful. That's going to be much more involved, though, and therefore
outside of scope of this change -- patches welcome.

REVIEW: 113099
Do not compile debugging files which are only occasionally used by the developers
Remove useless loop when not building the debug version
Prefer Q_ASSERT(expression) over explicit variable assignment

This version can be optimized out in the release builds, yielding performance
improvements and fewer warnings.
Fix build warnings for unused variables

These are for situations where one cannot directly use Q_ASSERT(expression) due
to the expression's side effects. Adding a Q_UNUSED seems like a best fix here
-- it retains the existing funcitonality when debugging and also fixes any
warnings when building in release mode.
Merge branch 'fix-warnings-in-release'

REVIEW: 113107