append .sav suffix to backups if not already present

This commit is contained in:
Lukas Sabota 2020-10-29 16:54:14 -04:00
parent aba5d0fd3c
commit ecd600e76f
1 changed files with 5 additions and 0 deletions

View File

@ -1882,6 +1882,11 @@ static void ExportBackupMemoryDialog(GSimpleAction *action, GVariant *parameter,
GFile *file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(pFileSelection));
gchar *sPath = g_file_get_path(file);
if(! g_str_has_suffix(sPath, ".sav"))
{
sPath = g_strjoin(NULL, sPath, ".sav", NULL);
}
if(MMU_new.backupDevice.exportData(sPath) == false ) {
GtkWidget *pDialog = gtk_message_dialog_new(GTK_WINDOW(pWindow),
GTK_DIALOG_MODAL,