Print to a file in the current directory by default

When printing to a file, the filename was not being propagated if a
directory was not specified.

https://bugzilla.gnome.org/show_bug.cgi?id=711177
This commit is contained in:
Mike Gorse 2013-10-30 15:42:09 -05:00
parent 378ea9029f
commit 60189143a4

View File

@ -521,7 +521,16 @@ filesave_changed_cb (GtkWidget *button,
if (g_uri_parse_scheme (file) != NULL)
uri = g_strdup (file);
else
uri = g_build_path ("/", gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (priv->combo)), file, NULL);
{
gchar *chooser_uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (priv->combo));
if (chooser_uri)
{
uri = g_build_path ("/", chooser_uri, file, NULL);
g_free (chooser_uri);
}
else
uri = g_filename_to_uri (file, NULL, NULL);
}
}
if (uri)