Change QTemporaryDir variable "dir" to local variable.