From ffac3cad5db5815b5d24730ee2381f16cd568701 Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 17 Sep 2007 21:49:58 +0000 Subject: [PATCH] r679 introduced an error, assuming 'filename' would never be an absolute path. This fixes it. git-svn-id: http://svn.voria.com/code@699 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/app.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index c73cd35..d665c41 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -1707,7 +1707,10 @@ App::dialog_open_file(const std::string &title, std::string &filename) dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT); if(!filename.empty()) - dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); + if (is_absolute_path(filename)) + dialog->set_filename(filename); + else + dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); if(dialog->run()==GTK_RESPONSE_ACCEPT) { filename=dialog->get_filename(); delete dialog; @@ -1817,7 +1820,10 @@ App::dialog_save_file(const std::string &title, std::string &filename) dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog->add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); if(!filename.empty()) - dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); + if (is_absolute_path(filename)) + dialog->set_filename(filename); + else + dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); if(dialog->run()==GTK_RESPONSE_ACCEPT) { filename=dialog->get_filename(); delete dialog; @@ -1884,7 +1890,10 @@ App::dialog_saveas_file(const std::string &title, std::string &filename) dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog->add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT); if(!filename.empty()) - dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); + if (is_absolute_path(filename)) + dialog->set_filename(filename); + else + dialog->set_filename(prev_path + ETL_DIRECTORY_SEPARATOR + filename); if(dialog->run()==GTK_RESPONSE_ACCEPT) { filename=dialog->get_filename(); delete dialog; -- 2.7.4