From 3d2f4db565a7b29fdf83bb41e0b80cffd6a88b3d Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 19 Aug 2016 10:28:49 -0700 Subject: [PATCH] Keymap: Reinitialize ref after creating Keymap dir In the case that the Keymap directory does not exist and has to be created, reinitialize ref to the newly created directory. Thanks Stippi for your help There is still a bug present where if the Keymap directory is a symlink to another directory, the File Panel does not follow that link and instead opens to your home directory. More on this later. --- src/preferences/keymap/KeymapWindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/preferences/keymap/KeymapWindow.cpp b/src/preferences/keymap/KeymapWindow.cpp index 0b17345b94..3d6bd9ddb7 100644 --- a/src/preferences/keymap/KeymapWindow.cpp +++ b/src/preferences/keymap/KeymapWindow.cpp @@ -136,8 +136,11 @@ KeymapWindow::KeymapWindow() get_ref_for_path(path.Path(), &ref); BDirectory userKeymapsDir(&ref); - if (userKeymapsDir.InitCheck() != B_OK) - create_directory(path.Path(), S_IRWXU | S_IRWXG | S_IRWXO); + if (userKeymapsDir.InitCheck() != B_OK + && create_directory(path.Path(), S_IRWXU | S_IRWXG | S_IRWXO) + == B_OK) { + get_ref_for_path(path.Path(), &ref); + } BMessenger messenger(this); fOpenPanel = new BFilePanel(B_OPEN_PANEL, &messenger, &ref,