diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index d5e80af9f5..2aee32d4b7 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1737,18 +1737,18 @@ void PrefShortcuts::apply(LyXRC & rc) const { rc.bind_file = internal_path(fromqstr(bindFileED->text())); // write user_bind and user_unbind to .lyx/bind/user.bind - string bind_dir = addPath(package().user_support().absFilename(), "bind"); - if (!FileName(bind_dir).exists() && FileName(bind_dir).createDirectory(0777)) { + FileName bind_dir(addPath(package().user_support().absFilename(), "bind")); + if (!bind_dir.exists() && !bind_dir.createDirectory(0777)) { lyxerr << "LyX could not create the user bind directory '" << bind_dir << "'. All user-defined key bindings will be lost." << endl; return; } - if (!FileName(bind_dir).isDirWritable()) { + if (!bind_dir.isDirWritable()) { lyxerr << "LyX could not write to the user bind directory '" << bind_dir << "'. All user-defined key bindings will be lost." << endl; return; } - FileName user_bind_file = FileName(addName(bind_dir, "user.bind")); + FileName user_bind_file(bind_dir.absFilename() + "/user.bind"); user_bind_.write(user_bind_file.toFilesystemEncoding(), false, false); user_unbind_.write(user_bind_file.toFilesystemEncoding(), true, true); // immediately apply the keybindings. Why this is not done before?