r679 introduced an error, assuming 'filename' would never be an absolute path. This...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 17 Sep 2007 21:49:58 +0000 (21:49 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 17 Sep 2007 21:49:58 +0000 (21:49 +0000)
git-svn-id: http://svn.voria.com/code@699 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/app.cpp

index c73cd35..d665c41 100644 (file)
@@ -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;