qt single app instance refactor