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.
This commit is contained in:
John Scipione
2016-08-19 10:28:49 -07:00
parent 29f04e867a
commit 3d2f4db565
+5 -2
View File
@@ -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,