Without looking at the rest of the code and how watching of the settings file works. (Isn't there a problem when a user delete the file again?) There are some helper classes to watch files in a directory:
/src/kits/storage/AddOnMonitorHandler.cpp /src/kits/storage/NodeMonitorHandler.cppEspecially AddOnMonitorHandler handle all kind of file manipulation. Maybe interesting for you...
Regards, Clemens Am 26.10.2010, 12:08 Uhr, schrieb <jonas@xxxxxxxxxxx>:
Author: kirilla Date: 2010-10-26 01:08:19 +0200 (Tue, 26 Oct 2010) New Revision: 39148 Changeset: http://dev.haiku-os.org/changeset/39148 Modified: haiku/trunk/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp Log:Create settings file if missing, so shortcut_catchers node monitoring works. Prior to this change, the add-on would not sense the Shortcuts preferences creating the file, and it wouldn't work right away but only after a reboot. This improves first boot, first use.Modified: haiku/trunk/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp===================================================================--- haiku/trunk/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp 2010-10-25 20:20:09 UTC (rev 39147) +++ haiku/trunk/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp 2010-10-25 23:08:19 UTC (rev 39148)@@ -71,6 +71,9 @@ strcpy(fFileName, file); BEntry fileEntry(fFileName); + if (!fileEntry.Exists()) + BFile file(fFileName, B_READ_ONLY|B_CREATE_FILE); + if (fileEntry.InitCheck() == B_NO_ERROR) { node_ref nref;