Remove extra variable assignment

Thanks to clang's scan-build for catching this.
Do not perform qobject_cast twice in a row

That variable was not actually used; the cast was supposed to happen (and
happened) in the while's condition.

Thanks to clang's scan-build.