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
This commit is contained in:
Morgan Hardwood
2018-02-07 00:55:44 +01:00
parent 81ce5581e8
commit 536ebb9974
2 changed files with 2 additions and 4 deletions

View File

@@ -280,8 +280,6 @@ void SaveAsDialog::okPressed ()
void SaveAsDialog::cancelPressed () void SaveAsDialog::cancelPressed ()
{ {
fname = fchooser->get_filename();
response (Gtk::RESPONSE_CANCEL); 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; this->fname = fname;
fchooser->set_current_name(fname); fchooser->set_current_name(fname);

View File

@@ -57,7 +57,7 @@ public:
bool getToTailOfQueue (); bool getToTailOfQueue ();
int getSaveMethodNum (); int getSaveMethodNum ();
void setInitialFileName (Glib::ustring iname); void setInitialFileName (const Glib::ustring& iname);
void setImagePath (const Glib::ustring& imagePath); void setImagePath (const Glib::ustring& imagePath);
void okPressed (); void okPressed ();