From 536ebb9974caf1c2189fdbc3ac858b9c43fee0be Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Wed, 7 Feb 2018 00:55:44 +0100 Subject: [PATCH] Fix "." filename in Save As dialog If you hit Ctrl+s to save the image, then delete the filename and press the cancel button, the next time you tried to Ctrl+s the same image the filename would show as a period, ".". This patch fixes that - now it will show the original filename. Fixes #3174 --- rtgui/saveasdlg.cc | 4 +--- rtgui/saveasdlg.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/rtgui/saveasdlg.cc b/rtgui/saveasdlg.cc index 1818d748a..7067e8ed1 100644 --- a/rtgui/saveasdlg.cc +++ b/rtgui/saveasdlg.cc @@ -280,8 +280,6 @@ void SaveAsDialog::okPressed () void SaveAsDialog::cancelPressed () { - - fname = fchooser->get_filename(); response (Gtk::RESPONSE_CANCEL); } @@ -297,7 +295,7 @@ void SaveAsDialog::formatChanged (Glib::ustring f) } } -void SaveAsDialog::setInitialFileName (Glib::ustring fname) +void SaveAsDialog::setInitialFileName (const Glib::ustring& fname) { this->fname = fname; fchooser->set_current_name(fname); diff --git a/rtgui/saveasdlg.h b/rtgui/saveasdlg.h index 9b06471e8..073be23f4 100644 --- a/rtgui/saveasdlg.h +++ b/rtgui/saveasdlg.h @@ -57,7 +57,7 @@ public: bool getToTailOfQueue (); int getSaveMethodNum (); - void setInitialFileName (Glib::ustring iname); + void setInitialFileName (const Glib::ustring& iname); void setImagePath (const Glib::ustring& imagePath); void okPressed ();