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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user