quickpreview: Fix warning and simplify code