Browse Source

Fixed file paths for MSYS2 on new file and open actions

merge-requests/365/head
U-olece-PC\olece 10 years ago
parent
commit
490a09812c
  1. 3
      src/juci.cc
  2. 4
      src/window.cc

3
src/juci.cc

@ -30,8 +30,7 @@ int Application::on_command_line(const Glib::RefPtr<Gio::ApplicationCommandLine>
boost::system::error_code ec; boost::system::error_code ec;
auto new_p=boost::filesystem::canonical(parent_p, ec); auto new_p=boost::filesystem::canonical(parent_p, ec);
if(!ec && boost::filesystem::is_directory(new_p)) { if(!ec && boost::filesystem::is_directory(new_p)) {
new_p+="/"; new_p/=p.filename();
new_p+=p.filename();
files.emplace_back(new_p); files.emplace_back(new_p);
} }
else else

4
src/window.cc

@ -164,7 +164,7 @@ void Window::set_menu_actions() {
if(filesystem::write(path)) { if(filesystem::write(path)) {
if(Directories::get().current_path!="") if(Directories::get().current_path!="")
Directories::get().update(); Directories::get().update();
notebook.open(path.string()); notebook.open(boost::filesystem::canonical(path));
Terminal::get().print("New file "+path.string()+" created.\n"); Terminal::get().print("New file "+path.string()+" created.\n");
} }
else else
@ -223,7 +223,7 @@ void Window::set_menu_actions() {
menu.add_action("open_file", [this]() { menu.add_action("open_file", [this]() {
auto path=Dialog::open_file(); auto path=Dialog::open_file();
if(path!="") if(path!="")
notebook.open(path); notebook.open(boost::filesystem::canonical(path));
}); });
menu.add_action("open_folder", [this]() { menu.add_action("open_folder", [this]() {
auto path = Dialog::open_folder(); auto path = Dialog::open_folder();

Loading…
Cancel
Save