Better qrcode url handling

This is a little simplification. Please test and merge if you're happy with it.