save-as: add .syscap extension if necessary

We have *.syscap glob registered with the mime types, so ensure that the
file gets saved with that extension.
This commit is contained in:
Christian Hergert
2016-04-13 09:23:21 -07:00
parent 8743dbd0c9
commit f73f5e98ec

View File

@ -550,6 +550,18 @@ sp_window_save_capture (GSimpleAction *action,
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
if (filename == NULL)
goto failure;
if (!g_str_has_suffix (filename, ".syscap"))
{
gchar *tmp;
tmp = g_strdup_printf ("%s.syscap", filename);
g_free (filename);
filename = tmp;
}
/* this should really be done outside the main loop. */
if (!sp_capture_reader_save_as (reader, filename, &error))
{