OS X 10.9上的QSettings - 无法找到/清除它

时间:2021-07-20 10:40:45

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:

我有一个基于Qt(4.8.5)的应用程序在OS X 10.9上运行。该应用程序使用QSettings类指定应用程序名称和公司。 Plist文件由QSetttings在以下位置创建:

~/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?

该应用程序在保存/恢复首选项方面非常好。然后我退出应用程序,删除* .plist文件,再次运行应用程序并瞧 - 它恢复了它的首选项!根据什么文件?热门删除吗?

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

我无法在Qt doc for QSettings类中找到答案。

1 个解决方案

#1


16  

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:

在10.9(及更高版本)中,正在缓存.plist文件。因此,一旦删除了.plist文件,就必须刷新缓存。在终端中注销或执行以下命令:

killall -u yourusername cfprefsd

#1


16  

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:

在10.9(及更高版本)中,正在缓存.plist文件。因此,一旦删除了.plist文件,就必须刷新缓存。在终端中注销或执行以下命令:

killall -u yourusername cfprefsd