QSettings on OS X 10.9 - unable to locate/clear it
Asked Answered
E

1

11

I have a Qt (4.8.5) based application running on OS X 10.9. The app uses QSettings class specifying app name and company. Plist file is created by QSetttings under:

~/Library/Preferences/com.company_name.app_name.plist

The app works pretty fine in terms of saving/restoring preferences. Then I quit the app, delete *.plist file, run the app again and voila - it restored its preferences! Based on what what file? Hot to delete it?

I was unable to find the answer in the Qt doc for QSettings class.

Electrochemistry answered 2/11, 2013 at 13:37 Comment(5)
Are you sure it restores its preferences or it actually resets to the default values?Labiovelar
The source code is where you will find the answer :)Pastorship
Yes I'm sure it doesn't reset to defaults. The link to source code is great but I think it's also somehow related to app sandboxing in Mac.Electrochemistry
This behaviour is still observed on MacOS 10.11.Babar
See also this SO thread about the same problem.Babar
W
18

In 10.9 (and higher) .plist files are being cached. So once you have deleted a .plist file, the cache must be refreshed. Either log out or execute the following command in Terminal:

killall -u yourusername cfprefsd
Wrest answered 9/11, 2013 at 22:48 Comment(1)
On 10.11, logging out doesn't seem to work, but the command does. Thanks!Nonprofessional

© 2022 - 2024 — McMap. All rights reserved.