After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587086 - setting custom output uri doesn't work right
setting custom output uri doesn't work right
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
: 514122 (view as bug list)
Depends on:
Blocks: 587053
 
 
Reported: 2009-06-26 18:53 UTC by Matthias Clasen
Modified: 2010-10-11 04:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthias Clasen 2009-06-26 18:53:19 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.
Comment 1 Matthias Clasen 2009-06-27 01:02:36 UTC
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.
Comment 2 Matthias Clasen 2009-06-28 20:35:51 UTC
I've committed this fix, even if it is not perfect.
Comment 3 Javier Jardón (IRC: jjardon) 2010-10-11 04:09:20 UTC
*** Bug 514122 has been marked as a duplicate of this bug. ***