From 7327585ba353b3ddd6f2d628c406501649b0f8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sundstr=C3=B6m?= Date: Mon, 25 Oct 2010 23:08:19 +0000 Subject: [PATCH] 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39148 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../input_server/filters/shortcut_catcher/KeyCommandMap.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp b/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp index a5bcf30283..1761d740c6 100644 --- a/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp +++ b/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp @@ -71,6 +71,9 @@ KeyCommandMap::KeyCommandMap(const char* file) 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;