Move waitForQuit() into correct file.