GNOME Bugzilla – Bug 587086
setting custom output uri doesn't work right
Last modified: 2010-10-11 04:09:20 UTC
If I set a custom output uri with settings = gtk_print_settings_new (); uri = g_strconcat ("file://", g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS), "/gtk-demo-printing-example.pdf", NULL); gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_URI, uri); it works initially, but switching to a cups printer and back brings the default 'output.pdf' back. It shouldn't. The code is in gtk-demos printing example if you want an easy testcase.
It looks like not nuking initial_settings in gtkprintunixdialog.c makes this almost work: @@ -1431,12 +1431,6 @@ options_changed_cb (GtkPrintUnixDialog *dialog) schedule_idle_mark_conflicts (dialog); - if (priv->initial_settings) - { - g_object_unref (priv->initial_settings); - priv->initial_settings = NULL; - } - g_free (priv->waiting_for_printer); priv->waiting_for_printer = NULL; } It is still somewhat wrong, since switching from file to cups to file will forget what output filename you entered before, and go back to the initial value.
I've committed this fix, even if it is not perfect.
*** Bug 514122 has been marked as a duplicate of this bug. ***