GTK: Fix a warning for file->open dialogs.

SetCurrentName only applies to save dialogs, so call it conditionally.
pull/899/head
phkahler 2021-01-17 17:38:04 -05:00
parent 36719c6234
commit d3951afb12
1 changed files with 4 additions and 1 deletions

View File

@ -1295,14 +1295,17 @@ public:
}
}
//TODO: This is not getting called when the extension selection is changed.
void FilterChanged() {
std::string extension = GetExtension();
if(extension.empty())
return;
Platform::Path path = GetFilename();
if(gtkChooser->get_action() != GTK_FILE_CHOOSER_ACTION_OPEN) {
SetCurrentName(path.WithExtension(extension).FileName());
}
}
void FreezeChoices(SettingsRef settings, const std::string &key) override {
settings->FreezeString("Dialog_" + key + "_Folder",