Refactored QSettings usage to reduce file reads and writes.