mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 13:30:19 +00:00
Add print to PDF to recent manager
Printing a file with to PDF/etc. with the virtual printer option doesn't add the file to the list of recently used files. It should be there, so I can easily access it. https://bugzilla.gnome.org/show_bug.cgi?id=668598
This commit is contained in:
parent
3f5af532f7
commit
f682aabf74
@ -384,7 +384,10 @@ file_print_cb_locked (GtkPrintBackendFile *print_backend,
|
||||
GError *error,
|
||||
gpointer user_data)
|
||||
{
|
||||
gchar *uri;
|
||||
|
||||
_PrintStreamData *ps = (_PrintStreamData *) user_data;
|
||||
GtkRecentManager *recent_manager;
|
||||
|
||||
if (ps->target_io_stream != NULL)
|
||||
g_output_stream_close (G_OUTPUT_STREAM (ps->target_io_stream), NULL, NULL);
|
||||
@ -398,6 +401,11 @@ file_print_cb_locked (GtkPrintBackendFile *print_backend,
|
||||
gtk_print_job_set_status (ps->job,
|
||||
(error != NULL)?GTK_PRINT_STATUS_FINISHED_ABORTED:GTK_PRINT_STATUS_FINISHED);
|
||||
|
||||
recent_manager = gtk_recent_manager_get_default ();
|
||||
uri = output_file_from_settings (gtk_print_job_get_settings (ps->job), NULL);
|
||||
gtk_recent_manager_add_item (recent_manager, uri);
|
||||
g_free (uri);
|
||||
|
||||
if (ps->job)
|
||||
g_object_unref (ps->job);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user